예제 #1
0
        /// <summary>
        /// 数据更新
        /// </summary>
        /// <param name="ComplaInfoJson"></param>
        /// <returns></returns>
        public string ComplaInfoUpdate(string ComplaInfoJson)
        {
            //JSON转实体类
            ComplaInfoUpdateInputDTO complaInfo = JsonConvert.DeserializeObject <ComplaInfoUpdateInputDTO>(ComplaInfoJson);
            string Admin = Session["AdminID"].ToString();

            if (ComplaInfoService.DTOUpdate(complaInfo, Admin) > 0)
            {
                return("ok");
            }
            else
            {
                return("no");
            }
        }
예제 #2
0
        /// <summary>
        /// DTO修改方法
        /// </summary>
        /// <param name="inputEntity"></param>
        /// <param name="AdminID"></param>
        /// <returns></returns>
        public int DTOUpdate(ComplaInfoUpdateInputDTO inputEntity, string AdminID)
        {
            //先查AsNoTracking() 不追踪
            ComplaInfo checkmodel = complaInfoDAL.LoadEntities(u => u.ComplaID == inputEntity.ComplaID).FirstOrDefault();

            if (checkmodel != null)
            {
                checkmodel.RsolveData = inputEntity.RsolveData;
                checkmodel.State      = inputEntity.State;
                checkmodel.AdminID    = AdminID;
                checkmodel.Remarks    = inputEntity.Remarks;

                return(complaInfoDAL.EditAndSaveChange(checkmodel));
            }
            else
            {
                return(0);
            }
        }