Exemple #1
0
        public JsonResult Add(SubContLeaderInfo model)
        {
            if (string.IsNullOrEmpty(model.PhoneNumber) || string.IsNullOrEmpty(model.PhoneNumber))
            {
                return(Json(new ResponseMessage()
                {
                    IsSuccess = false, ErrorCode = (int)ResponseIntValue.Fail, Message = "请输入必填字段"
                }));
            }
            model.CreateUser       = UserSession.Current.UserCode;
            model.CreateTime       = DateTime.Now;
            model.LastModifiedUser = UserSession.Current.UserCode;
            model.LastModifiedTime = DateTime.Now;
            var result = (new YhSubContLeaderInfoManager()).Add(model);

            if (result > 0)
            {
                return(Json(new ResponseMessage()
                {
                    IsSuccess = true
                }));
            }
            else
            {
                return(Json(new ResponseMessage()
                {
                    IsSuccess = false, ErrorCode = (int)result, Message = "新增失败"
                }));
            }
        }
Exemple #2
0
        public JsonResult Edit(SubContLeaderInfo model, string gridStage)
        {
            model.LastModifiedUser = UserSession.Current.UserCode == null ? "" : UserSession.Current.UserCode.ToString();
            model.LastModifiedTime = DateTime.Now;
            var result = (new YhSubContLeaderInfoManager()).Update(model);

            return(Json(new ResponseMessage()
            {
                IsSuccess = true
            }));
        }