public DonationRecNExpModelCollectionSet GetDonationCollectionSet(string inst_code, int show_year, int financial_year, string value_date, string in_donor_name) { DonationRecNExpModelCollectionSet model = new DonationRecNExpModelCollectionSet(); Decimal grand_total_don_ytd = 0; Decimal net_designated_ytd = 0; Decimal net_general_ytd = 0; model.Set = new List <DonationRecNExpModelCollection> { GetDonationCollection(inst_code, show_year, financial_year, value_date, 0, in_donor_name, "I", "Y", ref grand_total_don_ytd, ref net_designated_ytd, ref net_general_ytd), GetDonationCollection(inst_code, show_year, financial_year, value_date, 0, in_donor_name, "E", "Y", ref grand_total_don_ytd, ref net_designated_ytd, ref net_general_ytd), GetDonationCollection(inst_code, show_year, financial_year, value_date, 0, in_donor_name, "I", "N", ref grand_total_don_ytd, ref net_designated_ytd, ref net_general_ytd), GetDonationCollection(inst_code, show_year, financial_year, value_date, 0, in_donor_name, "E", "N", ref grand_total_don_ytd, ref net_designated_ytd, ref net_general_ytd) }; model.Grand_total_don_ytd = grand_total_don_ytd; model.Net_designated_ytd = net_designated_ytd; model.Net_general_ytd = net_general_ytd; return(model); }
public IActionResult Index(string inst_code, string donor_name, int show_year) { Session.SetString("current_sys", "D"); ViewBag.IsHtmlMessage = true; ViewBag.SuccessMessage = TempData["SuccessMessage"] ?? ViewBag.SuccessMessage; ViewBag.ErrorMessage = TempData["ErrorMessage"] ?? ViewBag.ErrorMessage; ViewBag.HospClusterList = MenuService.GetHospitalClusterList(UserHelper.UserInfo(((ClaimsIdentity)User.Identity), "UserGroup_D")); ViewBag.HospClusterExAllList = MenuService.GetHospitalClusterList(UserHelper.UserInfo(((ClaimsIdentity)User.Identity), "UserGroup_D"), false); var financial_year = Convert.ToInt32(UserHelper.UserInfo(((ClaimsIdentity)User.Identity), "Financial_Year")); if (show_year == 0) { show_year = financial_year; } var value_date = UserHelper.UserInfo(((ClaimsIdentity)User.Identity), "Value_Date2"); //"20171101"; //var value_date = //test var in_donor_name = string.IsNullOrEmpty(donor_name)?"": donor_name.Replace("\"\"", "\"\"\"\"").Replace("'", "''"); ViewBag.InDonorName = in_donor_name; Decimal total_cost = 0; ViewBag.CostA = DonationRecNExpService.GetCostA(inst_code, show_year, financial_year, in_donor_name); ViewBag.CostB = DonationRecNExpService.GetCostB(inst_code, show_year, financial_year, in_donor_name); DonationRecNExpModelCollectionSet model = DonationRecNExpService.GetDonationCollectionSet(inst_code, show_year, financial_year, value_date, in_donor_name); model.Net_designated_ytd = model.Net_designated_ytd + ViewBag.CostA; model.Net_general_ytd = model.Net_general_ytd + ViewBag.CostB; model.Grand_total_don_ytd = model.Net_designated_ytd + model.Net_general_ytd; model.Donation_by_year_list = DonationRecNExpService.GetDonationByYear(inst_code, in_donor_name, out total_cost); model.Total_cost = total_cost; ViewBag.HospDesc = MenuService.GetFlashRptHospGpDesc(inst_code); ViewBag.InstCode = inst_code; ViewBag.ShowYear = show_year; return(View(model)); }