コード例 #1
0
ファイル: SystemController.cs プロジェクト: Michauxquan/MTest
        public JsonResult SaveOrderProcess(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            OrderProcessEntity   model      = serializer.Deserialize <OrderProcessEntity>(entity);

            if (string.IsNullOrEmpty(model.ProcessID))
            {
                model.ProcessID = new SystemBusiness().CreateOrderProcess(model.ProcessName, model.ProcessType, model.CategoryID, model.PlanDays, model.IsDefault, CurrentUser.UserID, CurrentUser.UserID, CurrentUser.ClientID);
            }
            else
            {
                bool bl = new SystemBusiness().UpdateOrderProcess(model.ProcessID, model.ProcessName, model.PlanDays, CurrentUser.UserID, OperateIP, CurrentUser.ClientID);
                if (!bl)
                {
                    model.ProcessID = "";
                }
            }
            model.Owner = OrganizationBusiness.GetUserCacheByUserID(CurrentUser.UserID, CurrentUser.ClientID);
            JsonDictionary.Add("model", model);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
コード例 #2
0
ファイル: SystemBusiness.cs プロジェクト: Michauxquan/MTest
        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);
        }
コード例 #3
0
ファイル: SystemBusiness.cs プロジェクト: Michauxquan/MTest
        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);
        }