/// <summary> /// 根据ID获取客户来源 /// </summary> /// <param name="sourceid"></param> /// <returns></returns> public CustomSourceEntity GetActivityByID(string sourceid) { CustomSourceEntity model = new CustomSourceEntity(); DataTable dt = CustomDAL.BaseProvider.GetCustomSourceByID(sourceid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); } return model; }
/// <summary> /// 获取客户来源列表 /// </summary> /// <param name="clientid">客户端ID</param> /// <returns></returns> public List<CustomSourceEntity> GetCustomSources(string clientid) { List<CustomSourceEntity> list = new List<CustomSourceEntity>(); DataTable dt = CustomDAL.BaseProvider.GetCustomSources(clientid); foreach (DataRow dr in dt.Rows) { CustomSourceEntity model = new CustomSourceEntity(); model.FillData(dt.Rows[0]); list.Add(model); } return list; }
public CustomSourceEntity GetCustomSourcesByID(string sourceid, string agentid, string clientid) { if (string.IsNullOrEmpty(sourceid)) { return null; } var list = GetCustomSources(agentid, clientid); if (list.Where(m => m.SourceID == sourceid).Count() > 0) { return list.Where(m => m.SourceID == sourceid).FirstOrDefault(); } CustomSourceEntity model = new CustomSourceEntity(); DataTable dt = SystemDAL.BaseProvider.GetCustomSourceByID(sourceid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); CustomSources[clientid].Add(model); } return model; }
public List<CustomSourceEntity> GetCustomSources(string agentid,string clientid) { if (CustomSources.ContainsKey(clientid)) { return CustomSources[clientid]; } List<CustomSourceEntity> list = new List<CustomSourceEntity>(); DataTable dt = SystemDAL.BaseProvider.GetCustomSources(clientid); foreach (DataRow dr in dt.Rows) { CustomSourceEntity model = new CustomSourceEntity(); model.FillData(dr); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, agentid); list.Add(model); } CustomSources.Add(clientid, list); return list; }