// GET: Business Record public ActionResult Index() { ViewBag.GetNew = RequirementData.GetNew(); ViewBag.GetRenew = RequirementData.GetRenew(); List <BusinessRecord> model = new List <BusinessRecord>(); model = BusinessRecordData.ListAll(); return(View(model)); }
public ActionResult Delete(BusinessRecord model) { bool result = BusinessRecordData.Delete(model.UniqueId.ToString()); if (result) { return(RedirectToAction("Index")); } return(View(model)); }
// GET: Delete Business Record public ActionResult Delete(string id) { ViewBag.businessowners = BusinessOwnerData.ListAll(); ViewBag.businessdetails = BusinessDetailData.ListAll(); ViewBag.provinces = ProvincesData.ListAll(); ViewBag.cities = CitiesData.ListAll(); ViewBag.districts = DistrictData.ListAll(); ViewBag.barangays = BarangayData.ListAll(); ViewBag.streets = StreetData.ListAll(); ViewBag.businesstype = BusinessTypeData.ListAll(); BusinessRecord model = BusinessRecordData.GetById(id); return(View(model)); }
public ActionResult Business(string id) { DB db = new DB(); var model = new CollectionViewModel(); BusinessRecord record = BusinessRecordData.GetById(id); model.Id = record.Id; model.BusinessName = record.BusinessName; model.OwnerName = record.BusinessOwner.FirstName + " " + record.BusinessOwner.LastName; model.quarter = record.isAssessed; model.isNew = record.BusinessDetail.isNew; model.lastDatePaid = record.BusinessDetail.lastPayDate; //DateTime cutOffFirst = DateTime.ParseExact("2017-03-31", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffSecond = DateTime.ParseExact("2017-06-30", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffThird = DateTime.ParseExact("2017-09-30", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffFourth = DateTime.ParseExact("2017-12-31", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); if (/*model.lastDatePaid <= cutOffFirst */ record.isCollected <= 0) //disabled check because this is always true until March 31, 2017. lastpaiddate will always be before 03/31 because it is updated by DateTime.NOW { model.lastQuarterPaid = 0; } else if (/*(model.lastDatePaid > cutOffFirst && model.lastDatePaid <= cutOffSecond)*/ record.isCollected == 1) { model.lastQuarterPaid = 1; } else if (/*(model.lastDatePaid > cutOffSecond && model.lastDatePaid <= cutOffThird)*/ record.isCollected == 2) { model.lastQuarterPaid = 2; } else if (/*(model.lastDatePaid > cutOffThird && model.lastDatePaid <= cutOffFourth)*/ record.isCollected == 3) { model.lastQuarterPaid = 3; } else if (/*model.lastDatePaid > cutOffFourth &&*/ record.isCollected == 4) { model.lastQuarterPaid = 4; } int orNumber = db.OfficialReceipts.Select(i => i.ORNumber).ToList().LastOrDefault(); model.orNumber = orNumber + 1; model.orDate = DateTime.Now; //ViewBag.Banks = db. return(View(model)); }
// GET: Edit Business Record public ActionResult Edit(string id) { ViewBag.businessowners = BusinessOwnerData.ListAll(); ViewBag.businessdetails = BusinessDetailData.ListAll(); ViewBag.provinces = ProvincesData.ListAll(); ViewBag.cities = CitiesData.ListAll(); ViewBag.districts = DistrictData.ListAll(); ViewBag.barangays = BarangayData.ListAll(); ViewBag.streets = StreetData.ListAll(); ViewBag.businesstype = BusinessTypeData.ListAll(); BusinessRecord model = BusinessRecordData.GetById(id); ViewBag.businessRecords = new HashSet <int>(model.Requirements.Select(i => i.Id)); if (model.BusinessDetail.isNew) { ViewBag.Requirements = RequirementData.GetNew(); } else { ViewBag.Requirements = RequirementData.GetRenew(); } return(View(model)); }
public ActionResult Business(string id) { DB db = new DB(); var model = new AssessmentViewModel(); BusinessRecord record = BusinessRecordData.GetById(id); model.Id = record.Id; int newReqs = db.Requirements.Where(x => x.StatusId != 2).Count(); int renewReqs = db.Requirements.Where(x => x.StatusId != 1).Count(); model.BusinessName = record.BusinessName; model.Address = record.Address; model.isNew = record.BusinessDetail.isNew; model.lastDatePaid = record.BusinessDetail.lastPayDate; model.OwnerName = record.BusinessOwner.FirstName + " " + record.BusinessOwner.LastName; if (model.isNew) { if (record.Requirements.Count == newReqs) { model.completeRequirements = true; } else { model.completeRequirements = false; } } else { if (record.Requirements.Count == renewReqs) { model.completeRequirements = true; } else { model.completeRequirements = false; } } //DateTime cutOffFirst = DateTime.ParseExact("2017-03-31", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffSecond = DateTime.ParseExact("2017-06-30", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffThird = DateTime.ParseExact("2017-09-30", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); //DateTime cutOffFourth = DateTime.ParseExact("2017-12-31", "yyyy-MM-dd", // System.Globalization.CultureInfo.InvariantCulture); model.isCollected = record.isCollected; if (/*model.lastDatePaid <= cutOffFirst */ model.isCollected <= 0) //disabled check because this is always true until March 31, 2017. lastpaiddate will always be before 03/31 because it is updated by DateTime.NOW { model.isFirst = false; model.isSecond = false; model.isThird = false; model.isFourth = false; model.lastQuarterPaid = ""; } else if (/*(model.lastDatePaid > cutOffFirst && model.lastDatePaid <= cutOffSecond)*/ model.isCollected == 1) { model.isFirst = true; model.isSecond = false; model.isThird = false; model.isFourth = false; model.lastQuarterPaid = "First Quarter"; } else if (/*(model.lastDatePaid > cutOffSecond && model.lastDatePaid <= cutOffThird)*/ model.isCollected == 2) { model.isFirst = true; model.isSecond = true; model.isThird = false; model.isFourth = false; model.lastQuarterPaid = "Second Quarter"; } else if (/*(model.lastDatePaid > cutOffThird && model.lastDatePaid <= cutOffFourth)*/ model.isCollected == 3) { model.isFirst = true; model.isSecond = true; model.isThird = true; model.isFourth = false; model.lastQuarterPaid = "Third Quarter"; } else if (/*model.lastDatePaid > cutOffFourth &&*/ model.isCollected == 4) { model.isFirst = true; model.isSecond = true; model.isThird = true; model.isFourth = true; model.lastQuarterPaid = "Fourth Quarter"; } return(View(model)); }