public ActionResult Delete(string id)
        {
            ViewBag.businesslines = BusinessLineData.ListAll();
            BusinessDetail model = BusinessDetailData.GetById(id);

            return(View(model));
        }
        // GET: BusinessDetail
        public ActionResult Index()
        {
            ViewBag.businesslines = BusinessLineData.ListAll();
            List <BusinessDetail> model = new List <BusinessDetail>();

            model = BusinessDetailData.ListAll();
            return(View(model));
        }
        public ActionResult Delete(BusinessDetail model)
        {
            bool result = BusinessDetailData.Delete(model.UniqueId.ToString());

            if (result)
            {
                return(RedirectToAction("Index"));
            }

            return(View());
        }
        public ActionResult Edit(BusinessDetail model)
        {
            bool result = BusinessDetailData.Edit(model);

            if (result)
            {
                return(RedirectToAction("Index"));
            }

            return(View());
        }
 // GET: Add Business Record
 public ActionResult Add()
 {
     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();
     ViewBag.Requirements    = RequirementData.GetNew();
     return(View());
 }
        // 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));
        }
        // 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));
        }