private List <string> ValidationEntry2(object obj) { strvalidationResult.Clear(); EntityValidation2 = (MDL.ApprovedRequest)obj; if (string.IsNullOrWhiteSpace(EntityValidation2.LoginPwd)) { strvalidationResult.Add("Login Password is required!"); } return(strvalidationResult); }
public JsonResult Approved(MDL.ApprovedRequest model) { GlobalVarible.Clear(); try { strvalidationResult = ValidationEntry2(model); if (strvalidationResult.Count() == 0) { if (checkpassword(model.LoginPwd)) { Guid wrid = new Guid(model.wr_id.Replace("/", "")); Guid userid = Guid.Parse(User.Identity.GetUserId()); string[,] param = { { "WR_ID", wrid.ToString() }, { "UPPERID", userid.ToString() } }; COM.DBHelper.SQLReturnValue M = sqlhelper.ExecuteProcWithMessageKMT("WALLET_APPROVED", 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)); }