public ActionResult Create(FrequencyObj model, string m) { try { menuId = SmartUtil.GetMenuId(m); ViewBag.MenuId = HttpUtility.UrlDecode(m); var errorMsg = ""; if (ModelState.IsValid) { if (model.ITBID > 0) { //using (var txscope = new TransactionScope(TransactionScopeOption.RequiresNew)) //{ var BType = new SM_FREQUENCYTEMP() { FREQUENCY_DESC = model.FREQUENCY_DESC, WORKDAYS = model.WORKDAYS, STATUS = open, RECORDID = model.ITBID, USERID = User.Identity.Name, CREATEDATE = DateTime.Now }; repoFreqTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = model.STATUS == active ? eventEdit : model.STATUS, MENUID = menuId, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Frequency Record"); TempData["msg"] = "Record Updated SuccessFully...Authorization Pending."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(RedirectToAction("Index", "Frequency", new { m = m })); //return Json(new { RespCode = 0, RespMessage = "Record Updated SuccessFully...Authorization Pending." }); } else { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", new { m = m, id = model.ITBID })); //return Json(new { RespCode = 1, RespMessage = "Problem Updating Record." }); } } // var ret = _repo.PostRole(model, 1); //if (ret != null && ret.RespCode == 0) //{ // model.RoleId = int.Parse(ret.OutputKey.ToString()); // return Json(new { data = model, RespCode = 0, RespMessage = "Record Created Successfully" }); //} } else { var BType = new SM_FREQUENCYTEMP() { FREQUENCY_DESC = model.FREQUENCY_DESC, WORKDAYS = model.WORKDAYS, STATUS = open, RECORDID = model.ITBID, USERID = User.Identity.Name, CREATEDATE = DateTime.Now }; repoFreqTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { //var controller = ControllerContext.Controller..ToString(); SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventInsert, MENUID = menuId, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { //newR = 1; EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Frequency Record"); TempData["msg"] = "Record Created SuccessFully...Authorization Pending."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(RedirectToAction("Index", new { m = m })); //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); } else { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", new { m = m })); // return Json(new { RespCode = 1, RespMessage = "Problem Creating Record." }); } } } } // If we got this far, something failed, redisplay form return(Json(new { RespCode = 1, RespMessage = errorMsg })); } catch (SqlException ex) { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", new { m = m })); //return Json(new { RespCode = 1, RespMessage = ex.Message }); } catch (Exception ex) { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", new { m = m })); //return Json(new { RespCode = 1, RespMessage = ex.Message }); } }
// [ValidateAntiForgeryToken] public ActionResult Process() { string batchId = ""; try { var rv = new SetReconUpldSession(); var rec = rv.GetSetReconUpload(User.Identity.Name); // isUp = userInstitutionItbid == 1 ? true : false; //using (var txscope = new TransactionScope(TransactionScopeOption.RequiresNew, new TimeSpan(0, 30, 0))) //{ int errorcnt = 0; DateTime curDate = DateTime.Now; batchId = SmartObj.GenRefNo2(); int i = 0; int valCount = rec.Count(f => f.VALIDATIONERRORSTATUS == false); foreach (var d in rec) { if (i == 0) { SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventInsert, MENUID = menuId, //MENUNAME = "", // RECORDID = objG.ITBID, STATUS = open, //TABLENAME = "SM_FREQUENCY", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, BATCHID = batchId, POSTTYPE = Batch }; repoAuth.Insert(auth); } i++; if (d.VALIDATIONERRORSTATUS == true) { errorcnt++; continue; } var obj = new SM_SETRECONCILIATION_TEMP()// SM_MERCHANTTERMINALUPLD() { PAYREFNO = d.PAYREFNO, AMOUNT = d.AMOUNT, PAYMENTDATE = d.PAYMENTDATE, VALUEDATE = d.VALUEDATE, //RECEIPTNO = d.RECEIPTNO, CUSTOMERNAME = d.CUSTOMERNAME, PAYMENTMETHOD = d.PAYMENTMETHOD, //TRANSACTIONSTATUS = d.TRANSACTIONSTATUS, //DEPOSITSLIPNO = d.DEPOSITSLIPNO, BANKNAME = d.BANKNAME, //BRANCHNAME = d.BRANCHNAME, //PAYERID = d.PAYERID, //VALUEGRANTED = d.VALUEGRANTED, //RECONCILE = d.RECONCILE, BATCHID = batchId, CREATEDATE = curDate, STATUS = open, USERID = User.Identity.Name, }; repoSetReconciliationTemp.Insert(obj); //cnt++; } var rst = uow.Save(User.Identity.Name); if (rst > 0) { //SessionHelper.GetCart(Session).Clear(); rv.PurgeSetReconUpload(User.Identity.Name); try { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, string.Format("Setttlement Reconciliation Upload Batch #{0}", batchId)); } catch { } //txscope.Complete(); } else { return(Json(new { RespCode = 1, RespMessage = "Problem Processing Request." })); } //} } catch (Exception ex) { return(Json(new { RespCode = 1, RespMessage = ex.Message })); } var msg = string.Format("<i class='fa fa-check' ></i> Record with Batch-ID #{0} Processed SuccessFully and has been forwarded for authorization", batchId); return(Json(new { RespCode = 0, RespMessage = msg })); }
public ActionResult AddPolicy(CompanyProfileObj model, int?m) { try { //menuId = SmartUtil.GetMenuId(m); //GetMenuId(); var errorMsg = ""; if (ModelState.IsValid) { if (model.ITBID > 0) { var BType = new SM_COMPANY_PROFILETEMP() { COMPANY_ADDRESS = model.COMPANY_ADDRESS, COMPANY_CITY = model.COMPANY_CITY, COMPANY_CODE = model.COMPANY_CODE, COMPANY_COUNTRY = model.COMPANY_COUNTRY, COMPANY_EMAIL = model.COMPANY_EMAIL, COMPANY_NAME = model.COMPANY_NAME, COMPANY_PHONE1 = model.COMPANY_PHONE1, COMPANY_PHONE2 = model.COMPANY_PHONE2, COMPANY_STATE = model.COMPANY_STATE, COMPANY_WEBSITE = model.COMPANY_WEBSITE, STATUS = open, RECORDID = model.ITBID, USERID = User.Identity.Name, CREATEDATE = DateTime.Now, LOCKOUT_TRIAL_COUNT = model.LOCKOUT_TRIAL_COUNT, PASSWORDLENGTH = model.PASSWORDLENGTH, PASSWORD_CHANGE_DAYS = model.PASSWORD_CHANGE_DAYS, SYSTEM_IDLE_TIMEOUT = model.SYSTEM_IDLE_TIMEOUT }; //BType = model; // BType.RECORDID = model.ITBID; // BType.USERID = model.USERID; // BType.CREATEDATE = model.CREATEDATE; // BType.STATUS = open; // BType.ITBID = 0; repoCompTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventEdit, // model.STATUS == active ? eventEdit : model.STATUS, MENUID = m, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single, //TABLENAME = "COMP" }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Department Record"); return(Json(new { RespCode = 0, RespMessage = "Record Updated SuccessFully...Authorization Pending." })); } } return(Json(new { RespCode = 1, RespMessage = "Problem Updating Record." })); } else { var BType = new SM_COMPANY_PROFILETEMP(); BType = model; BType.RECORDID = model.ITBID; BType.USERID = model.USERID; BType.CREATEDATE = model.CREATEDATE; BType.STATUS = open; BType.ITBID = 0; repoCompTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { //var controller = ControllerContext.Controller..ToString(); SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventInsert, MENUID = m, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single, //TABLENAME = "COMP" }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { //newR = 1; EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Department Record"); return(Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." })); } else { return(Json(new { RespCode = 1, RespMessage = "Problem Creating Record." })); } } } } // If we got this far, something failed, redisplay form return(Json(new { RespCode = 1, RespMessage = errorMsg })); } catch (SqlException ex) { return(Json(new { RespCode = 1, RespMessage = ex.Message })); } catch (Exception ex) { return(Json(new { RespCode = 1, RespMessage = ex.Message })); } }
public ActionResult ResetLockout(string[] selected_value) { try { //ViewBag.MenuId = menuId; //HttpUtility.UrlDecode(m); var bid = SmartObj.GenRefNo2(); var errorMsg = ""; if (ModelState.IsValid) { if (selected_value != null) { foreach (var d in selected_value) { var BType = new SM_RESETLOCKOUT_TEMP() { BatchId = bid, UserName = d, Status = open, UserId = User.Identity.Name, CreateDate = DateTime.Now, }; repoReset.Insert(BType); } if (uow.Save(User.Identity.Name) > 0) { SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventInsert,// model.STATUS == active ? eventEdit : model.STATUS, MENUID = menuId, BATCHID = bid, //MENUNAME = "", //RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Lockout Reset Record"); return(Json(new { RespCode = 0, RespMessage = "Record Updated SuccessFully...Authorization Pending." })); } else { return(Json(new { RespCode = 1, RespMessage = "Problem Processing Record." })); } } } else { return(Json(new { RespCode = 1, RespMessage = "Problem Processing Record." })); } } // If we got this far, something failed, redisplay form return(Json(new { RespCode = 1, RespMessage = errorMsg })); } catch (SqlException ex) { var msg = "Problem Updating Record."; return(Json(new { RespCode = 1, RespMessage = msg })); } catch (Exception ex) { var msg = "Problem Updating Record."; return(Json(new { RespCode = 1, RespMessage = msg })); } }
public ActionResult Add(SERVICEChannelObj model, string m) { try { menuId = SmartUtil.GetMenuId(m); ViewBag.MenuId = HttpUtility.UrlDecode(m); var errorMsg = ""; if (ModelState.IsValid) { if (model.ITBID == 0) { ViewBag.HeaderTitle = "Add ServiceChannel"; ViewBag.StatusVisible = false; ViewBag.ButtonText = "Save"; } else { //var d = _repo.GetSession(0, true); ViewBag.HeaderTitle = "Edit ServiceChannel"; ViewBag.StatusVisible = true; ViewBag.ButtonText = "Update"; } if (model.ITBID > 0) { //using (var txscope = new TransactionScope(TransactionScopeOption.RequiresNew)) //{ var BType = new SM_SERVICECHANNELSTEMP() { CODE = model.CODE, DESCRIPTION = model.DESCRIPTION, ChannelID = model.ChannelID, BankCode = model.BankCode, BankAccount = model.BankAccount, STATUS = open, RECORDID = model.ITBID, USERID = User.Identity.Name, CREATEDATE = DateTime.Now }; repoServiceChannelTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = model.STATUS == active ? eventEdit : model.STATUS, MENUID = menuId, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "ServiceChannel Record"); TempData["msg"] = "Record Updated SuccessFully...Authorization Pending."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(RedirectToAction("Index", "ServiceChannel", new { m = m })); //return Json(new { RespCode = 0, RespMessage = "Record Updated SuccessFully...Authorization Pending." }); } else { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", model)); //return Json(new { RespCode = 1, RespMessage = "Problem Updating Record." }); } } } else { var BType = new SM_SERVICECHANNELSTEMP() { CODE = model.CODE, DESCRIPTION = model.DESCRIPTION, STATUS = open, RECORDID = model.ITBID, ChannelID = model.ChannelID, BankCode = model.BankCode, BankAccount = model.BankAccount, USERID = User.Identity.Name, CREATEDATE = DateTime.Now }; repoServiceChannelTemp.Insert(BType); if (uow.Save(User.Identity.Name) > 0) { //var controller = ControllerContext.Controller..ToString(); SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventInsert, MENUID = menuId, //MENUNAME = "", RECORDID = BType.ITBID, STATUS = open, // TABLENAME = "ADMIN_DEPARTMENT", URL = Request.FilePath, USERID = User.Identity.Name, INSTITUTION_ITBID = institutionId, POSTTYPE = Single }; repoAuth.Insert(auth); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { //newR = 1; EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "ServiceChannel Record"); TempData["msg"] = "Record Created SuccessFully...Authorization Pending."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(RedirectToAction("Index", new { m = m })); //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); } else { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", model)); // return Json(new { RespCode = 1, RespMessage = "Problem Creating Record." }); } } } } // If we got this far, something failed, redisplay form //errorMsg = GetModelError(); errorMsg = ModelStateErrorHandler.StringifyModelErrors(ModelState); ViewBag.Message = errorMsg; return(View("Add", model)); } catch (SqlException ex) { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", model)); //return Json(new { RespCode = 1, RespMessage = ex.Message }); } catch (Exception ex) { ViewBag.Message = "Problem Updating Record."; //return Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." }); return(View("Add", model)); //return Json(new { RespCode = 1, RespMessage = ex.Message }); } }
public ActionResult Add(int MenuId, int NoLevel, string m) { try { string bid = SmartObj.GenRefNo2(); var errorMsg = ""; if (ModelState.IsValid) { //using (var txscope = new TransactionScope(TransactionScopeOption.RequiresNew)) //{ SM_APPROVAL_ROUTE_TEMP BType = new SM_APPROVAL_ROUTE_TEMP() { // BType.PARTY_CODE = int.Parse(txtpartyCode.Value); MENUID = MenuId, NOLEVEL = NoLevel, STATUS = open, CREATEDATE = DateTime.Now, BATCHID = bid, USERID = User.Identity.Name, //RECORDID = model.ITBID, }; repoAppRouteTemp.Insert(BType); var rst = uow.Save(User.Identity.Name) > 0 ? true : false; if (rst) { SaveRouteOfficerTemp(eventEdit, bid); SM_AUTHLIST auth = new SM_AUTHLIST() { CREATEDATE = DateTime.Now, EVENTTYPE = eventEdit, MENUID = menuId, RECORDID = BType.ITBID, STATUS = open, URL = Request.FilePath, USERID = User.Identity.Name, POSTTYPE = Single, BATCHID = bid, INSTITUTION_ITBID = institutionId }; repoAuth.Insert(auth); var rst1 = uow.Save(User.Identity.Name); if (rst1 > 0) { EmailerNotification.SendForAuthorization(menuId, fullName, deptCode, institutionId, "Approval Route Record"); //txscope.Complete(); //TempData["msg"] = "Record Created SuccessFully...Authorization Pending."; return(Json(new { RespCode = 0, RespMessage = "Record Created SuccessFully...Authorization Pending." })); //return RedirectToAction("Index", new { m = m }); } } //} // If we got this far, something failed, redisplay form return(Json(new { RespCode = 1, RespMessage = errorMsg })); } } catch (SqlException ex) { //BindCombo(); //ViewBag.PartyAcct = GetRvHeadLines(); //ViewBag.Message = ex.Message; //return View("Add", model); return(Json(new { RespCode = 1, RespMessage = ex.Message })); } catch (Exception ex) { //BindCombo(); //ViewBag.PartyAcct = GetRvHeadLines(); //ViewBag.Message = ex.Message; //return View("Add", model); return(Json(new { RespCode = 1, RespMessage = ex.Message })); } //BindCombo(); //ViewBag.PartyAcct = GetRvHeadLines(); //ViewBag.Message = "Problem Processing Request, Try again or Contact Administrator."; //return View("Add", model); return(Json(new { RespCode = 1, RespMessage = "Problem Processing Request, Try again or Contact Administrator." })); }