Exemplo n.º 1
0
        // 修改
        public ResultEntity <int> UpdateOutMemberInfo(OutMemberInfo uie)
        {
            ResultEntity <int> result;

            try
            {
                int IntRet    = 0;
                var repResult = dal.Update <OutMemberInfo>(uie);

                if (repResult)
                {
                    IntRet = 1;
                }

                if (IntRet > 0)
                {
                    result = new ResultEntity <int>(true, ConstantDefine.TipSaveSuccess, IntRet);
                }
                else
                {
                    result = new ResultEntity <int>(ConstantDefine.TipSaveFail);
                }
            }
            catch (Exception ex)
            {
                Loger.LogErr(ex);
                result = new ResultEntity <int>(ex.Message);
            }
            return(result);
        }
Exemplo n.º 2
0
        public ActionResult SaveOutMemberInfo(OutMemberInfo entity)
        {
            ResponseEntity <int> response;

            if (entity.Id == 0)
            {
                entity.IsDelete   = 0;
                entity.CreateBy   = "";
                entity.CreateTime = DateTime.Now;
                entity.UpdateBy   = "";
                entity.UpdateTime = DateTime.Now;
                var result = new OutMemberInfoBLL().InsertOutMemberInfo(entity);

                response = new ResponseEntity <int>(result.Success, result.Message, result.Data);
            }
            else
            {
                entity.UpdateBy   = "";
                entity.UpdateTime = DateTime.Now;
                var result = new OutMemberInfoBLL().UpdateOutMemberInfo(entity);

                response = new ResponseEntity <int>(result.Success, result.Message, result.Data);
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        // 添加
        public ResultEntity <int> InsertOutMemberInfo(OutMemberInfo uie)
        {
            ResultEntity <int> result;

            try
            {
                int IntRet    = 0;
                var repResult = dal.Insert <OutMemberInfo>(uie);
                if (repResult != null)
                {
                    IntRet = int.Parse(repResult.ToString());
                }
                if (IntRet > 0)
                {
                    result = new ResultEntity <int>(true, ConstantDefine.TipSaveSuccess, IntRet);
                }
                else
                {
                    result = new ResultEntity <int>(ConstantDefine.TipSaveFail);
                }
            }
            catch (Exception ex)
            {
                Loger.LogErr(ex);
                result = new ResultEntity <int>(ex.Message);
            }
            return(result);
        }