public ActionResult DesignResultExamine(int id, string examineType)
        {
            Session["method"] = "Y";
            SetEmployee();
            try
            {
                var model = designResultBLL.GetModel(p => p.id == id);
                var str   = JsonConvert.DeserializeObject <String>(examineType);
                if (str == "true")
                {
                    model.店长审核 = true;
                }
                else if (str == "false")
                {
                    model.店长审核 = false;
                }
                else
                {
                    return(Json("发现非法数据,操作失败!"));
                }
                model.店长     = employeeID;
                model.店长确认日期 = DateTime.Now;
                model.更新人    = employeeName;
                model.更新日期   = DateTime.Now;
                designResultBLL.Modify(model);
            }
            catch (Exception e)
            {
                return(Json("店长设计案审查,数据更新异常!"));
            }

            return(Json("操作成功!"));
        }
        public JsonResult DesignerResultExamine(int id, string examine)
        {
            SetEmployee();
            if (storeEmployeesBLL.GetModel(p => p.ID == employeeID).是否设计师 != true)
            {
                return(Json("违规操作!"));
            }

            var model  = designResultBLL.GetModel(p => p.id == id);
            var isPass = JsonConvert.DeserializeObject <String>(examine);

            if (isPass == "true")
            {
                model.设计师确认   = true;
                model.设计师确认日期 = DateTime.Now;
            }
            if (isPass == "false")
            {
                model.设计师确认   = false;
                model.设计师确认日期 = DateTime.Now;
            }
            Session["method"] = "Y";
            try
            {
                string[] property = new string[2];
                property[0] = "设计师确认";
                property[1] = "设计师确认日期";
                designResultBLL.Modify(model, property);
            }
            catch (Exception e)
            {
                return(Json("违规操作!"));
            }


            return(Json("提交成功!"));
        }
        public ActionResult EditDesignResult(DesignResultViewModel designResultViewModel)
        {
            Session["method"] = "Y";
            SetEmployee();
            if (storeEmployeesBLL.GetModel(p => p.ID == employeeID).职务ID != 4 && storeEmployeesBLL.GetModel(p => p.ID == employeeID).职务ID != 3)
            {
                return(Content("<script>alert('您不具有操作权限!不能进行完结操作!');window.history.go(-1);</script>"));
            }
            设计_设计案完结单 model = new 设计_设计案完结单();

            model        = designResultBLL.GetModel(p => p.id == designResultViewModel.Id);
            model.id     = designResultViewModel.Id;
            model.制单人    = designResultViewModel.制单人;
            model.制单日期   = designResultViewModel.制单日期;
            model.单据编号   = designResultViewModel.单据编号;
            model.合计成交金额 = designResultViewModel.合计成交金额;
            model.实际完成时间 = designResultViewModel.实际完成时间;
            model.实际完成空间 = designResultViewModel.实际完成空间;
            model.审批状态   = designResultViewModel.审批状态;
            model.客户单号   = designResultViewModel.客户编号;
            model.店长     = storeEmployeesBLL.GetModel(p => p.停用标志 == false && p.店铺ID == storeID && p.是否店长 == true).ID;

            model.店长确认日期    = designResultViewModel.店长审核日期;
            model.延期或无法完成原因 = designResultViewModel.延期或无法完成原因;
            model.建议        = designResultViewModel.建议;
            model.更新人       = employeeName;
            model.计划完成时间    = designResultViewModel.计划完成时间;
            model.计划完成空间    = designResultViewModel.计划完成空间;
            model.设计师       = storeEmployeesBLL.GetModel(p => p.停用标志 == false && p.店铺ID == storeID && p.是否设计师 == true).ID;;
            model.设计师确认日期   = designResultViewModel.设计师确认日期;
            model.设计案提交表ID  = designResultViewModel.设计案提交表ID;
            model.销售人员      = employeeID;
            model.销售人员确认日期  = designResultViewModel.销售人员确认日期;
            model.销售单号      = designResultViewModel.销售单号;
            model.更新日期      = DateTime.Now;
            if (ModelState.IsValid)
            {
                designResultBLL.Modify(model);
                Session["method"] = "N";
            }
            else
            {
                List <string> sb = new List <string>();
                //获取所有错误的Key
                List <string> Keys = ModelState.Keys.ToList();
                //获取每一个key对应的ModelStateDictionary
                foreach (var key in Keys)
                {
                    var errors = ModelState[key].Errors.ToList();
                    //将错误描述添加到sb中
                    foreach (var error in errors)
                    {
                        sb.Add(error.ErrorMessage);
                    }
                }
                string msg = "修改完结单信息出错:";
                foreach (var item in sb)
                {
                    msg += item.ToString() + "<br/>";
                }
                return(Content(msg));
            }
            return(RedirectToAction("DesignResultIndex"));
        }