public static void setJsonModelFromEntity(AgentJsonModel jModel, Agent agent) { jModel.id = agent.c_id; jModel.name = agent.c_name; jModel.mobile = agent.c_mobile; jModel.level = CommConfigLogic.GetValueFromConfig((int)ConfigCategory.PostitionLevel, agent.c_levle); }
public static List <AgentJsonModel> getJsonListFromEntityList(List <Agent> agetnList) { var list = new List <AgentJsonModel>(); foreach (var item in agetnList) { AgentJsonModel m = new AgentJsonModel(); setJsonModelFromEntity(m, item); list.Add(m); } return(list); }