private ASOISearchModel ASOISearchModelValueSetUp(ASOISearchModel model) { ViewBag.SubCatByCatNo = ASOIService.GetSubCatByCatNo(model.Cat_no, Resource.Any); ViewBag.NatureIncomeByCatNo = ASOIService.GetNatureIncomeByCatNo(model.Cat_no, Resource.Any); ViewBag.ServiceProvidedByCatNo = ASOIService.GetServiceProvidedByCatNo(model.Cat_no, Resource.Any); model.Subcat_check = ASOIService.GetSubcatCheck(model.Cat_no); model.Nat_inc_check = ASOIService.GetNatIncCheck(model.Cat_no); model.Ser_prov_check = ASOIService.GetSerProvCheck(model.Cat_no); model.Cat_name = ASOIService.GetCatName(model.Cat_no); model.Get_max_period = ASOIService.GetMaxPeriod(); model.Period = ASOIService.GetPeriod(); return(model); }
public IActionResult Index(string cat_no, string hosp_code, string search_corp = "", string sch_analytical_start = "", string sch_analytical_end = "") { pageSetUp(); sch_analytical_start = sch_analytical_start == "" ? "00000" : sch_analytical_start; sch_analytical_end = sch_analytical_end == "" ? "ZZZZZ" : sch_analytical_end; ASOISearchModel model = new ASOISearchModel(); model.Cat_no = cat_no; model.Hosp_code = hosp_code; model.Sch_analytical_start = sch_analytical_start; model.Sch_analytical_end = sch_analytical_end; ASOISearchModelValueSetUp(model); return(View(model)); }
public List <ASOIResultModel> GetASOIResultList(ASOISearchModel model) { List <ASOIResultModel> result = new List <ASOIResultModel>(); var ds = AsASOIProgrammesRepository.GetASOIResultList(model.Hosp_code, model.Get_max_period, model.Sch_allcat, model.Cat_no, model.Sch_start_date_begin, model.Sch_start_date_until, model.Sch_analytical_start, model.Sch_analytical_end, model.Sch_section, model.Sch_program_code, model.Sch_prog_subcat, model.Sch_description_location, model.Sch_organizer_department, model.Sch_nature_income, model.Sch_service_provided); if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count != 0) { foreach (DataRow dr in ds.Tables[0].Rows) { ASOIResultModel asoi = new ASOIResultModel(); asoi.Id = dr["id"].ToString(); asoi.Cat = dr["cat"].ToString(); asoi.Analytical = dr["analytical"].ToString(); asoi.Section = dr["section"].ToString(); asoi.Program_code = dr["program_code"].ToString(); asoi.Prog_sub_cat = dr["prog_sub_cat"].ToString(); asoi.Prog_desc = dr["prog_desc"].ToString(); asoi.Nature_income = dr["nature_income"].ToString(); asoi.Prog_organizer = dr["prog_organizer"].ToString(); asoi.Service_provided = dr["service_provided"].ToString(); asoi.Start_date = DateTime.Parse(dr["start_date"].ToString()).ToString("dd/MM/yyyy"); asoi.No_project = model.Cat_no != "10" ? dr["no_project"].ToString() : ""; if (model.Sch_allcat == "all" || model.Subcat_check != "none") { asoi.Prog_sub_cat = AsProgSubcatRepository.GetSubCatByValue(dr["prog_sub_cat"].ToString()); } asoi.Nature_income = AsNatureIncomeRepository.GetNatureIncomeById(dr["nature_income"].ToString()); asoi.Service_provided = AsServiceProvidedRepository.GetServiceProvidedById(dr["service_provided"].ToString()); if (asoi.Start_date.ToString() == "01/01/1900") { asoi.Start_date = ""; } result.Add(asoi); } } return(result); }
public IActionResult Index(ASOISearchModel model) { pageSetUp(); if (!string.IsNullOrEmpty(model.Sch_cat_no)) { model.Cat_no = model.Sch_cat_no; } if (!string.IsNullOrEmpty(model.Sch_description_location)) { model.Sch_description_location = model.Sch_description_location.Replace("\"\"", """); } if (!string.IsNullOrEmpty(model.Sch_organizer_department)) { model.Sch_organizer_department = model.Sch_organizer_department.Replace("\"\"", """); } model.Sch_analytical_start = model.Sch_analytical_start == "" ? "00000" : model.Sch_analytical_start; model.Sch_analytical_end = model.Sch_analytical_end == "" ? "ZZZZZ" : model.Sch_analytical_end; ASOISearchModelValueSetUp(model); model.Result_list = ASOIService.GetASOIResultList(model); return(View(model)); }