public List <LableColorEntity> GetLableColor(string clientid, EnumMarkType lableType) { string tableName = ""; if (lableType == EnumMarkType.Customer) { tableName = "CustomerColor"; if (CustomColor.ContainsKey(clientid)) { return(CustomColor[clientid]); } } else if (lableType == EnumMarkType.Orders) { tableName = "OrderColor"; if (OrderColor.ContainsKey(clientid)) { return(OrderColor[clientid]); } } else if (lableType == EnumMarkType.Tasks) { tableName = "TaskColor"; if (TaskColor.ContainsKey(clientid)) { return(TaskColor[clientid]); } } List <LableColorEntity> list = new List <LableColorEntity>(); DataTable dt = LableColorDAL.BaseProvider.GetLableColor(tableName, clientid); foreach (DataRow dr in dt.Rows) { LableColorEntity model = new LableColorEntity(); model.FillData(dr); list.Add(model); } if (lableType == EnumMarkType.Customer) { CustomColor.Add(clientid, list); } else if (lableType == EnumMarkType.Orders) { OrderColor.Add(clientid, list); } else if (lableType == EnumMarkType.Tasks) { TaskColor.Add(clientid, list); } return(list); }