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("提交成功!"));
        }
        /// <summary>
        /// 设计案完结详细
        /// </summary>
        /// <param name="id">完结单ID</param>
        /// <returns></returns>
        public ActionResult DesignResultInfoView(int id)
        {
            Session["method"] = "N";
            SetEmployee();
            ViewBag.Store      = store;
            ViewBag.Employee   = employeeName;
            ViewBag.IsManager  = storeEmployeesBLL.GetModel(p => p.ID == employeeID).是否店长;
            ViewBag.IsDesigner = storeEmployeesBLL.GetModel(p => p.ID == employeeID).是否设计师;
            ViewBag.IsEmployee = storeEmployeesBLL.GetModel(p => p.ID == employeeID).是否销售;
            var model = designResultBLL.GetModel(p => p.id == id);
            DesignResultViewModel designResultViewModel = new DesignResultViewModel();

            designResultViewModel.Id        = model.id;
            designResultViewModel.制单人       = model.制单人;
            designResultViewModel.制单日期      = model.制单日期;
            designResultViewModel.单据编号      = model.单据编号;
            designResultViewModel.合计成交金额    = model.合计成交金额;
            designResultViewModel.实际完成时间    = model.实际完成时间;
            designResultViewModel.实际完成空间    = model.实际完成空间;
            designResultViewModel.审批状态      = model.审批状态;
            designResultViewModel.客户编号      = model.客户单号;
            designResultViewModel.店长        = storeEmployeesBLL.GetModel(p => p.ID == model.店长).姓名;
            designResultViewModel.店长审核日期    = model.店长确认日期;
            designResultViewModel.延期或无法完成原因 = model.延期或无法完成原因;
            designResultViewModel.建议        = model.建议;
            designResultViewModel.更新人       = model.更新人;
            designResultViewModel.计划完成时间    = model.计划完成时间;
            designResultViewModel.计划完成空间    = model.计划完成空间;
            designResultViewModel.设计师       = storeEmployeesBLL.GetModel(p => p.ID == model.设计师).姓名;
            designResultViewModel.设计师确认日期   = model.设计师确认日期;
            designResultViewModel.设计案提交表ID  = model.设计案提交表ID;
            designResultViewModel.销售人员      = storeEmployeesBLL.GetModel(p => p.ID == model.销售人员).姓名;
            designResultViewModel.销售人员确认日期  = model.销售人员确认日期;
            designResultViewModel.销售单号      = model.销售单号;
            designResultViewModel.更新日期      = model.更新日期;

            var phoneNumber = designSubmitBLL.GetModel(w => w.id == model.设计案提交表ID).联系方式;
            var sellID      = salesOrderBLL.GetModel(p => p.客户联系方式 == phoneNumber && p.店铺ID == storeID).ID;
            var lis         = salesOrder_DetailsBLL.GetModels(p => p.单据ID == sellID).ToList();//根据订单ID查询订单详细
            List <DesignResult_OrderDetailViewModel> list = new List <DesignResult_OrderDetailViewModel>();

            foreach (var item in lis)
            {
                DesignResult_OrderDetailViewModel m = new DesignResult_OrderDetailViewModel();
                var spuid     = product_SKUBLL.GetModel(p => p.ID == item.SKU_ID).SPU_ID;
                var productid = product_SPUBLL.GetModel(p => p.ID == spuid).商品ID;
                var product   = productBLL.GetModel(p => p.ID == productid);
                m.产品型号 = product.编号;
                m.单位   = product.计量单位;
                m.成交价  = item.零售小计;
                m.数量   = item.数量;
                m.空间   = "";
                list.Add(m);
            }
            designResultViewModel.DesignResult_OrderDetailViewModel = list;
            var files = design_ProjectDrawingsBLL.GetModels(p => p.设计案提交表ID == model.设计案提交表ID && p.文件类型 == 8);

            if (files.Count() > 0)
            {
                designResultViewModel.完成效果图 = true;
                List <String> listPath = new List <string>();
                foreach (var item in files)
                {
                    listPath.Add(item.存储路径);
                }
                designResultViewModel.完成效果图路径 = listPath;
            }
            else
            {
                designResultViewModel.完成效果图 = false;
            }

            var submodel = designSubmitBLL.GetModel(p => p.id == model.设计案提交表ID);

            designResultViewModel.楼盘具体位置 = submodel.楼盘具体位置;
            designResultViewModel.客户姓名   = submodel.客户姓名;
            designResultViewModel.联系方式   = submodel.联系方式;
            ViewBag.Person = submodel.客户姓名;
            return(View(designResultViewModel));
        }