public JsonResult SaveEntry(MDL.WalletRequest model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry(model); if (strvalidationResult.Count() == 0) { model.userid = Guid.Parse(User.Identity.GetUserId()); if (String.IsNullOrEmpty(model.wr_remakrs)) { model.wr_remakrs = string.Empty; } string[,] param = { { "USERID", model.userid.ToString() }, { "AMOUNT", model.wr_amount }, { "TRANSMODE", model.wr_mode.ToString() }, { "ACCOUNTNO", model.wr_accountno }, { "BANKNAME", model.wr_bankname }, { "REFID", model.wr_refrenceid },{ "REMARKS", model.wr_remakrs }, { "USERLEVEL", ((int)User.GetUserlevel()).ToString() } }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("WALLET_REQUEST", param, true); if (M.ValueFromSQL == 1) { GlobalVarible.AddMessage(M.MessageFromSQL); } else { throw new Exception(string.Join("<br />", M.MessageFromSQL)); } } else { throw new Exception(string.Join("<br />", strvalidationResult)); } } catch (Exception ex) { GlobalVarible.AddError(ex.Message); } MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML(); return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet)); }
private List <string> ValidationEntry(object obj) { strvalidationResult.Clear(); EntityValidation = (MDL.WalletRequest)obj; if (string.IsNullOrWhiteSpace(EntityValidation.wr_bankname)) { strvalidationResult.Add("Bank Name is required!"); } if (string.IsNullOrWhiteSpace(EntityValidation.wr_accountno)) { strvalidationResult.Add("Account No is required!"); } if (string.IsNullOrWhiteSpace(EntityValidation.wr_amount)) { strvalidationResult.Add("Amount is required!"); } if (string.IsNullOrWhiteSpace(EntityValidation.wr_refrenceid)) { strvalidationResult.Add("Refrence id is required!"); } return(strvalidationResult); }