示例#1
0
 public string InsertUpdateBank(BankViewModel bankVM)
 {
     try
     {
         AppUA appUA = Session["AppUA"] as AppUA;
         bankVM.PSASysCommon = new PSASysCommonViewModel
         {
             CreatedBy   = appUA.UserName,
             CreatedDate = _psaSysCommon.GetCurrentDateTime(),
             UpdatedBy   = appUA.UserName,
             UpdatedDate = _psaSysCommon.GetCurrentDateTime(),
         };
         var result = _bankBusiness.InsertUpdateBank(Mapper.Map <BankViewModel, Bank>(bankVM));
         return(JsonConvert.SerializeObject(new { Status = "OK", Record = result }));
     }
     catch (Exception ex)
     {
         AppConstMessage cm = _appConst.GetMessage(ex.Message);
         return(JsonConvert.SerializeObject(new { Status = "ERROR", Message = cm.Message }));
     }
 }
示例#2
0
        public string InsertUpdateBank(BankViewModel _bankObj)
        {
            try
            {
                Permission _permission      = Session["UserRights"] as Permission;
                string     permissionAccess = _permission.SubPermissionList.Where(li => li.Name == "ODLimit").First().AccessCode;
                if (permissionAccess.Contains("R") || permissionAccess.Contains("W"))
                {
                    _bankObj.ShowODLimit = true;
                }
                else
                {
                    _bankObj.ShowODLimit = false;
                }

                object result = null;
                AppUA  _appUA = Session["AppUA"] as AppUA;
                _bankObj.commonObj             = new CommonViewModel();
                _bankObj.commonObj.CreatedBy   = _appUA.UserName;
                _bankObj.commonObj.CreatedDate = _appUA.DateTime;
                _bankObj.commonObj.UpdatedBy   = _appUA.UserName;
                _bankObj.commonObj.UpdatedDate = _appUA.DateTime;
                if (!string.IsNullOrEmpty(_bankObj.hdnCode))
                {
                    _bankObj.Code = _bankObj.hdnCode;
                }

                result = _bankBusiness.InsertUpdateBank(Mapper.Map <BankViewModel, Bank>(_bankObj));
                return(JsonConvert.SerializeObject(new { Result = "OK", Records = result }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = c.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message }));
            }
        }