public OrderProcessEntity GetOrderProcessByID(string processid, string clientid) { var list = GetOrderProcess(clientid); if (list.Where(m => m.ProcessID == processid).Count() > 0) { return(list.Where(m => m.ProcessID == processid).FirstOrDefault()); } OrderProcessEntity model = new OrderProcessEntity(); DataTable dt = SystemDAL.BaseProvider.GetOrderProcessByID(processid); if (dt.Rows.Count > 0) { model.FillData(dt.Rows[0]); model.Owner = OrganizationBusiness.GetUserCacheByUserID(model.OwnerID, clientid); model.OwnerName = model.Owner.Name; model.CategoryName = GetProcessCategoryByID(model.CategoryID).Name; list.Add(model); } return(model); }
public List <OrderProcessEntity> GetOrderProcess(string clientid) { if (OrderProcess.ContainsKey(clientid)) { return(OrderProcess[clientid]); } List <OrderProcessEntity> list = new List <OrderProcessEntity>(); DataSet ds = SystemDAL.BaseProvider.GetOrderProcess(clientid); foreach (DataRow dr in ds.Tables["Stages"].Rows) { OrderProcessEntity model = new OrderProcessEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserCacheByUserID(model.OwnerID, clientid); model.OwnerName = model.Owner.Name; model.CategoryName = GetProcessCategoryByID(model.CategoryID).Name; list.Add(model); } OrderProcess.Add(clientid, list); return(list); }