/// <summary>
        /// 设计案申请审查
        /// </summary>
        /// <returns></returns>
        public ActionResult DesignApplyExamine(int id, string examineType)
        {
            Session["method"] = "Y";
            SetEmployee();
            try
            {
                var model = designSubmitBLL.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;
                designSubmitBLL.Modify(model);
            }
            catch (Exception e)
            {
                return(Json("店长设计案审查,数据更新异常!"));
            }

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

            var model  = designSubmitBLL.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] = "设计人员审核时间";
                designSubmitBLL.Modify(model, property);
            }
            catch (Exception e)
            {
                return(Json("违规操作!"));
            }


            return(Json("提交成功!"));
        }
Esempio n. 3
0
        /// <summary>
        /// 设计案申请修改(店长审核之后不可修改!)
        /// </summary>
        /// <param name="designSubmitModel">设计案申请实体</param>
        /// <returns></returns>
        public ActionResult DesignApplyEdit(DesignSubmitModel designSubmitModel)
        {
            if (Session["method"].ToString() == "Y")
            {
                string str = string.Format("<script>alert('重复操作!');parent.location.href='TrackLogIndex';</script>");
                return(Content(str));
            }
            SetEmployee();
            try
            {
                销售_设计案提交表 model = new 销售_设计案提交表
                {
                    id           = designSubmitModel.Id,
                    接待记录ID       = designSubmitModel.接待记录ID,
                    客户姓名         = designSubmitModel.客户姓名,
                    联系方式         = designSubmitModel.联系方式,
                    职业           = designSubmitModel.职业,
                    家庭成员         = designSubmitModel.家庭成员,
                    楼盘具体位置       = designSubmitModel.楼盘具体位置,
                    面积大小         = designSubmitModel.面积大小,
                    装修风格         = designSubmitModel.装修风格,
                    装修进度         = designSubmitModel.装修进度,
                    预算           = designSubmitModel.预算,
                    客户喜好或忌讳      = designSubmitModel.客户喜好,
                    客户在意品牌或已购买品牌 = designSubmitModel.客户在意品牌或已购买品牌,
                    客户提问与要求      = designSubmitModel.客户提问与要求,
                    整体软装配饰       = designSubmitModel.整体软装配饰,
                    家具空间         = designSubmitModel.家具空间,
                    项目提交时间       = designSubmitModel.项目提交时间,
                    项目量房时间       = designSubmitModel.项目量房时间,
                    项目预计完成时间     = designSubmitModel.项目预计完成时间,
                    销售人员         = employeeID,
                    备注           = designSubmitModel.备注,
                    更新人          = employeeName,
                    更新日期         = DateTime.Now,
                    店长           = designSubmitBLL.GetModel(p => p.id == designSubmitModel.Id).店长,
                    店长审核         = designSubmitBLL.GetModel(p => p.id == designSubmitModel.Id).店长审核,
                    设计人员         = designSubmitBLL.GetModel(p => p.id == designSubmitModel.Id).设计人员,
                    设计人员审核       = designSubmitModel.设计人员审核
                };
                if (ModelState.IsValid)
                {
                    designSubmitBLL.Modify(model);
                    Session["method"] = "Y";
                }

                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 s = "添加设计案申请信息出错:";
                    foreach (var item in sb)
                    {
                        s += item.ToString() + "<br/>";
                    }
                    return(Content("<script>alert('" + s + "');window.history.go(-1);</script>"));
                }
            }
            catch (Exception e)
            {
                return(Content("<script>alert('信息异常:" + e + "。');window.history.go(-1);</script>"));
            }
            return(RedirectToAction("DesignSchemeIndex", new { id = designSubmitModel.接待记录ID }));
        }