예제 #1
0
 public string InsertUpdateCountry(CountryViewModel CountryVM)
 {
     try
     {
         AppUA appUA = Session["AppUA"] as AppUA;
         CountryVM.PSASysCommon = new PSASysCommonViewModel
         {
             CreatedBy   = appUA.UserName,
             CreatedDate = _psaSysCommon.GetCurrentDateTime(),
             UpdatedBy   = appUA.UserName,
             UpdatedDate = _psaSysCommon.GetCurrentDateTime(),
         };
         var result = _contryBusiness.InsertUpdateCountry(Mapper.Map <CountryViewModel, Country>(CountryVM));
         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 }));
     }
 }