コード例 #1
0
 public JavaScriptResult Create(BankBranchViewModel bankBranchvm)
 {
     try
     {
         _bankBranchService.Add(Mapper.Map <BankBranch>(bankBranchvm));
         return(JavaScript($"ShowResult('{"Data saved successfully."}','{"success"}','{"redirect"}','{"/BankBranch"}')"));
     }
     catch (Exception ex)
     {
         return(JavaScript($"ShowResult('{ex.Message}','failure')"));
     }
 }
コード例 #2
0
 public object Save(bool isEditMode, [FromBody] Bankbranch model)
 {
     try
     {
         //if (model.Id != 0)
         if (isEditMode)
         {
             model.UpdateDate = System.DateTime.Now;
             return(bankBranchService.UpdateByStringField(model, "Branchcode"));
         }
         else
         {
             return(bankBranchService.Add(model));
         }
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }