public SpotterFeeViewModel FnPopulateSpotterFee(string spotterRefNum) { glog.Debug("FnPopulateSpotterFee: Entry"); var result = new ResultViewModel(); using (var db = new MainDbContext()) { try { var SpotterFee = new SpotterFeeViewModel(); SpotterFee.SpotterSummary = new SpotterSummaryViewModel(); SpotterFee.SpotterDetails = db.Database.SqlQuery <SpotterDetailsViewModel>( "exec GetSpotterDetails" ).ToList(); SpotterFee.SpotterDetails.Select(c => { c.SumOfAmount = Math.Round((decimal)c.SumOfAmount, 2); return(c); }).ToList(); glog.Debug("FnPopulateSpotterFee: Exit"); return(SpotterFee); } catch (Exception ex) { glog.Error("FnPopulateSpotterFee Exception: " + ex.Message + ex.InnerException); result.Status = 0; result.Message = "Please contact MIS, error: " + ex.Message; return(new SpotterFeeViewModel()); } } }
public ActionResult SpotterPaymentEdit(string SubMenuId) { #region Check UserGroup when user direct key in URL if (!(_clsGlobal.CheckUserGroup(((ClaimsIdentity)User.Identity).FindFirst("UserGroupCode").Value, Convert.ToInt16(SubMenuId)))) { ViewData["Message"] = "You Have No Access Rights For This Module!, error: Invalid Access Rights"; } #endregion Check UserGroup when user direct key in URL var vm = new SpotterFeeViewModel(); SelectList lstType = new SelectList(_clsPayment.GetSpotterRefNumber()); ViewBag.ListOfRefNumber = lstType; return(View(vm)); }
public ActionResult SpotterPaymentNew(string SubMenuId) { #region Check UserGroup when user direct key in URL if (!(_clsGlobal.CheckUserGroup(((ClaimsIdentity)User.Identity).FindFirst("UserGroupCode").Value, Convert.ToInt16(SubMenuId)))) { ViewData["Message"] = "You Have No Access Rights For This Module!, error: Invalid Access Rights"; } #endregion Check UserGroup when user direct key in URL var vm = new SpotterFeeViewModel(); var outstandingSpotterFee = new List <OutstandingSpotterFeeViewModel>(); outstandingSpotterFee = _clsPayment.FnRetrieveOutstandingSpotterFee(DateTime.Now.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture)); System.Web.HttpContext.Current.Session.Add("OutstandingFee", outstandingSpotterFee); return(View(vm)); }