Пример #1
0
        //[HttpGet]
        public ActionResult MasterPartial(Guid masterCode)
        {
            SysSettingViewModel sysSettingVM = masterCode == Guid.Empty ? new SysSettingViewModel() : Mapper.Map <SysSetting, SysSettingViewModel>(_sysSettingBusiness.GetSysSetting(masterCode));

            sysSettingVM.IsUpdate = masterCode == Guid.Empty ? false : true;
            return(PartialView("_AddSysSetting", sysSettingVM));
        }
Пример #2
0
        public string InsertUpdateSysSetting(SysSettingViewModel sysSettingVM)
        {
            object result = null;

            try
            {
                AppUA appUA = Session["AppUA"] as AppUA;
                sysSettingVM.PSASysCommon             = new PSASysCommonViewModel();
                sysSettingVM.PSASysCommon.CreatedBy   = appUA.UserName;
                sysSettingVM.PSASysCommon.CreatedDate = _pSASysCommon.GetCurrentDateTime();
                sysSettingVM.PSASysCommon.UpdatedBy   = appUA.UserName;
                sysSettingVM.PSASysCommon.UpdatedDate = _pSASysCommon.GetCurrentDateTime();
                result = _sysSettingBusiness.InsertUpdateSysSetting(Mapper.Map <SysSettingViewModel, SysSetting>(sysSettingVM));
                return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Success" }));
            }
            catch (Exception ex)
            {
                AppConstMessage cm = _appConstant.GetMessage(ex.Message);
                return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message }));
            }
        }