ConvertUpdInfoToExt.cs
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ControlPanel.Interfaces.Strategys;
using ControlPanel.Models;
using ControlPanel.Models.Extend;
using ControlPanel.Interfaces.Reposytorys;
using ControlPanel.NHInplimentRepository;
namespace ControlPanel.ImplimentStrateges
{
public class ConvertUpdInfoToExt<T> : IConvertToExt<T>
{
private UpdInfoExt _extupdinfo;
private ISubscribersRepository _szsrepository;
public object New(T obj)
{
_extupdinfo = null;
try
{
UpdInfo updinfo = obj as UpdInfo;
try
{
_extupdinfo = new UpdInfoExt();
if (_szsrepository == null)
_szsrepository = new NHSubscribersRepository();
Subscribers szs = _szsrepository.GetByID(updinfo.RefUpdInfoSzs.Id);
_extupdinfo.id = updinfo.id;
_extupdinfo.titleszs = szs.Name;
_extupdinfo.dtupddb = updinfo.dtupddb.ToString("dd.MM.yyyy HH:mm:ss");
_extupdinfo.dtupdsoft = updinfo.dtupdsoft.ToString("dd.MM.yyyy HH:mm:ss");
_extupdinfo.isupddb = updinfo.isupddb;
_extupdinfo.isupdszs = updinfo.isupdszs;
_extupdinfo.isdownload = updinfo.isdownload;
_extupdinfo.id_szs = updinfo.RefUpdInfoSzs.Id;
}
catch (Exception)
{
}
}
catch (Exception)
{
}
return _extupdinfo;
}
}
}