コード例 #1
0
 public ActionResult CustEvalInsert(TMC_CUST_EVALDTO dto)
 {
     if (!ModelState.IsValid)
     {
         return(View(dto));
     }
     dto.StdMains   = service.GetStdMain();
     dto.C_ID       = Guid.NewGuid().ToString();
     dto.C_EMP_ID   = BaseUser.Id;
     dto.C_EMP_NAME = BaseUser.Name;
     dto.D_MOD_DT   = DateTime.Now;
     service.CustEvalInsert(dto);
     dto.ResultType = 1;
     return(View(dto));
 }
コード例 #2
0
        public AjaxResult CustEvalInsert(JObject jData)
        {
            AjaxResult result = new AjaxResult();

            try
            {
                var custEval = jData.ToObject <TMC_CUST_EVALDTO>();
                custEval.C_ID     = Guid.NewGuid().ToString();
                custEval.D_MOD_DT = DateTime.Now;
                if (BaseUser.CustFile != null)
                {
                    custEval.C_CUST      = BaseUser.CustFile.C_NAME;
                    custEval.N_CUST_TYPE = BaseUser.CustFile.N_TYPE;
                    if (BaseUser.CustFile.CustAddr != null)
                    {
                        custEval.C_TEL = BaseUser.CustFile.CustAddr.C_CGMOBILE;
                    }
                    custEval.C_EMP_NAME = BaseUser.Name;
                    custEval.C_AREA     = qualityService.GetAreaName(BaseUser.CustFile.C_AREATYPE);
                }
                else
                {
                    custEval.C_CUST      = BaseUser.Name;
                    custEval.N_CUST_TYPE = 1;
                    custEval.C_EMP_NAME  = BaseUser.Name;
                }
                basicsService.CustEvalInsert(custEval);
                result.Code   = DoResult.Success;
                result.Result = "添加成功";
            }
            catch (Exception e)
            {
                result.Code   = DoResult.Failed;
                result.Result = e.Message;
            }
            return(result);
        }