private List <string> ValidationEntry(object obj) { strvalidationResult.Clear(); EntityValidation = (MDL.FundTransfer)obj; if (string.IsNullOrWhiteSpace(EntityValidation.up_fundbalance)) { strvalidationResult.Add("Amount is required!"); } if (string.IsNullOrWhiteSpace(EntityValidation.up_password)) { strvalidationResult.Add("Password is required!"); } return(strvalidationResult); }
public JsonResult SaveEntry(MDL.FundTransfer model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry(model); if (strvalidationResult.Count() == 0) { if (checkpassword(model.up_password)) { model.up_upperid = Guid.Parse(User.Identity.GetUserId()); string[,] param = { { "PARENTID", model.up_upperid.ToString() }, { "USERID", model.up_userid.ToString() }, { "BALTOADD", model.up_fundbalance }, { "TRANSMODE", model.up_mode }, { "REMARKS", model.up_remakrs }, }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("ADD_FUND_TO_ACCOUNT", 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 />", "Invalid Password !")); } } 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)); }