Ejemplo n.º 1
0
        public OrderProcessEntity GetOrderProcessByID(string processid, string agentid, string clientid)
        {
            var list = GetOrderProcess(agentid, 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.GetUserByUserID(model.OwnerID, agentid);

                OrderProcess[clientid].Add(model);
            }
            return model;
        }
Ejemplo n.º 2
0
        public List<OrderProcessEntity> GetOrderProcess(string agentid, string clientid)
        {
            if (OrderProcess.ContainsKey(clientid))
            {
                return OrderProcess[clientid].ToList();
            }

            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.GetUserByUserID(model.OwnerID, agentid);
                list.Add(model);
            }
            OrderProcess.Add(clientid, list);

            return list;
        }