// GET: Admin/Setting public ActionResult Index() { var model = new SystemConfigDAO().GetDetail(1); GetViewBag_Session(); return(View(model)); }
public string MakeOTP() { string UpperCase = "QWERTYUIOPASDFGHJKLZXCVBNM"; string Number = "0123456789"; string allCharacters = UpperCase + Number; Random ran = new Random(); string OTP = ""; var length = new SystemConfigDAO().GetByID("LENGTHOTP"); for (int i = 0; i < Int32.Parse(length.Value); i++) { double rand = ran.NextDouble(); OTP += allCharacters.ToCharArray()[(int)Math.Floor(rand * allCharacters.Length)]; } return(OTP); }
public ActionResult Update(SystemConfig entity) { if (ModelState.IsValid) { var res = new SystemConfigDAO().Update(entity); if (res) { return(RedirectToAction("Index", "Setting")); } else { ModelState.AddModelError("", "Have a error !!! Please check again"); } } return(RedirectToAction("Index", "Setting")); }
public SystemConfigService() { dao = new SystemConfigDAO(); }