Beispiel #1
0
        public FuncResult Update(string recordid, PostRdModel model, string userid)
        {
            FuncResult fr = new FuncResult()
            {
                IsSuccess = true, Message = "操作成功"
            };

            try
            {
                if (string.IsNullOrWhiteSpace(recordid))
                {
                    fr.IsSuccess = false;
                    fr.Message   = "参数接收异常!";
                    return(fr);
                }
                ApdFctRD rd = context.ApdFctRD.FirstOrDefault(f => f.RecordId.Equals(recordid));
                rd.IsHighTech     = model.IsHighTech;
                rd.RDExpenditure  = model.RDExpenditure;
                rd.Remark         = model.Remark;
                rd.LastUpdateDate = DateTime.Now;
                rd.LastUpdatedBy  = Convert.ToDecimal(userid);

                context.ApdFctRD.Update(rd);
                context.SaveChanges();
                return(fr);
            }
            catch (Exception ex)
            {
                fr.IsSuccess = false;
                fr.Message   = $"{ex.InnerException},{ex.Message}";
                throw new Exception("error", ex);
            }
        }
Beispiel #2
0
        public FuncResult Update(string recordid, [FromBody] PostRdModel model)
        {
            FuncResult fr = new FuncResult()
            {
                IsSuccess = true, Message = "Ok"
            };

            try
            {
                return(rdBll.Update(recordid, model, HttpContext.CurrentUser(cache).Id));
            }
            catch (Exception ex)
            {
                throw new Exception("error", ex);
            }
        }