CommonModel.cs
3.14 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AIAHTML5.ADMIN.API.Entity;
namespace AIAHTML5.ADMIN.API.Models
{
public class CountryModel
{
public int Id { get; set; }
public string CountryName { get; set; }
public string CountryCode { get; set; }
public static List<CountryModel> GetCountries(AIADatabaseV5Entities dbContext)
{
List<CountryModel> CountryList = new List<CountryModel>();
CountryModel CountryModelObj = new CountryModel();
try
{
var result = dbContext.EC_GetCountryList().ToList();
if (result.Count > 0)
{
foreach (var item in result)
{
CountryModelObj = new CountryModel();
CountryModelObj.Id = item.Id;
CountryModelObj.CountryName = item.CountryName;
CountryList.Add(CountryModelObj);
}
}
}
catch (Exception ex) { }
return CountryList;
}
}
public class StateModel
{
public int Id { get; set; }
public string StateName { get; set; }
public string StateCode { get; set; }
public static List<StateModel> GetUsStates(AIADatabaseV5Entities dbContext)
{
List<StateModel> StateList = new List<StateModel>();
StateModel StateModelObj = new StateModel();
try
{
var result = dbContext.EC_GetStateList().ToList();
if (result.Count > 0)
{
foreach (var item in result)
{
StateModelObj = new StateModel();
StateModelObj.Id = item.Id;
StateModelObj.StateName = item.StateName;
StateList.Add(StateModelObj);
}
}
}
catch (Exception ex) { }
return StateList;
}
}
public class SecurityQuestionModel
{
public int Id { get; set; }
public string Title { get; set; }
public static List<SecurityQuestionModel> GetSecurityQuestions(AIADatabaseV5Entities dbContext)
{
List<SecurityQuestionModel> SecurityQuestionList = new List<SecurityQuestionModel>();
SecurityQuestionModel SecurityQuestionObj = new SecurityQuestionModel();
try
{
var result = dbContext.EC_GetSecurityQuestionList().ToList();
if (result.Count > 0)
{
foreach (var item in result)
{
SecurityQuestionObj = new SecurityQuestionModel();
SecurityQuestionObj.Id = item.Id;
SecurityQuestionObj.Title = item.Title;
SecurityQuestionList.Add(SecurityQuestionObj);
}
}
}
catch (Exception ex) { }
return SecurityQuestionList;
}
}
}