public ActionResult NewRequest(SourceRequestViewModel model) { var principal = (ClaimsIdentity)User.Identity; string EmpNum = principal.FindFirst(ClaimTypes.SerialNumber).Value; string FullName = principal.FindFirst(ClaimTypes.GivenName).Value; string Email = principal.FindFirst(ClaimTypes.Email).Value; if (ModelState.IsValid) { model.INITIATOR_NAME = FullName; model.INITIATOR_NUMBER = EmpNum; model.INITIATOR_EMAIL = Email; ProcessRequest.ProcessNewRequest(model, EmpNum); return(RedirectToAction("RequestHistory")); } else { SourceRequestViewModel item = new SourceRequestViewModel(); string _dept = principal.FindFirst(ClaimTypes.UserData).Value; string _deptCode = principal.FindFirst(ClaimTypes.Actor).Value; string _branch = principal.FindFirst(ClaimTypes.StateOrProvince).Value; string _branchCode = principal.FindFirst(ClaimTypes.PostalCode).Value; item.INITIATING_DEPT = _dept; item.INITIATING_DEPTCODE = _deptCode; item.INITIATING_BRANCH = _branch; item.INITIATING_BRANCHCODE = _branchCode; ViewBag.ItemCategories = Common.GetMainCategory(); ViewBag.Vendors = GetVendors.GetAllVendors(); ViewBag.Error = "An Error Occurred"; return(View(item)); } }
public static List <SelectListItem> GetVendorsList() { List <SelectListItem> _listItems = new List <SelectListItem>(); var _GetAllVendors = GetVendors.GetAllVendors(); foreach (var item in _GetAllVendors) { _listItems.Add(new SelectListItem { Text = item.VENDOR_NAME + " ----- " + item.EMAIL_ADDRESS, Value = Convert.ToString(item.VENDOR_ID) }); } return(_listItems); }
public ActionResult NewRequest() { SourceRequestViewModel item = new SourceRequestViewModel(); var principal = (ClaimsIdentity)User.Identity; string _dept = principal.FindFirst(ClaimTypes.UserData).Value; string _deptCode = principal.FindFirst(ClaimTypes.Actor).Value; string _branch = principal.FindFirst(ClaimTypes.StateOrProvince).Value; string _branchCode = principal.FindFirst(ClaimTypes.PostalCode).Value; item.INITIATING_DEPT = _dept; item.INITIATING_DEPTCODE = _deptCode; item.INITIATING_BRANCH = _branch; item.INITIATING_BRANCHCODE = _branchCode; ViewBag.ItemCategories = Common.GetMainCategory(); ViewBag.Vendors = GetVendors.GetAllVendors(); return(View(item)); }
public ActionResult EditRequest(string RequestId = null) { if (RequestId == null) { return(RedirectToAction("RequestHistory")); } SourceRequestViewModel item = new SourceRequestViewModel(); var principal = (ClaimsIdentity)User.Identity; string _dept = principal.FindFirst(ClaimTypes.UserData).Value; string _deptCode = principal.FindFirst(ClaimTypes.Actor).Value; string _branch = principal.FindFirst(ClaimTypes.StateOrProvince).Value; string _branchCode = principal.FindFirst(ClaimTypes.PostalCode).Value; var RequestHistory = RetrieveRequest.GetRequestHistory(null, RequestId).FirstOrDefault(); ViewBag.ItemCategories = Common.GetMainCategory(); ViewBag.Vendors = GetVendors.GetAllVendors(); return(View(RequestHistory)); }