protected void Page_Load(object sender, EventArgs e) { this.tdWidth.Value = "210"; this.tdHeight.Value = "99"; int PrintID = 0; int.TryParse(Request.QueryString["PrintID"], out PrintID); string IDs = Request.QueryString["IDs"]; List <int> IDList = new List <int>(); List <int> RoomIDList = new List <int>(); if (PrintID == 0) { if (string.IsNullOrEmpty(IDs)) { Response.End(); return; } } if (!string.IsNullOrEmpty(IDs)) { IDList = JsonConvert.DeserializeObject <List <int> >(IDs); } if (!IsPostBack) { int RoomID = 0; int ContractID = 0; int DefaultChargeManID = 0; if (PrintID > 0) { var list = ViewRoomFeeHistory.GetViewRoomFeeHistoryListByIDs(0, IDList, PrintID); if (list.Length > 0) { RoomID = list[0].RoomID; ContractID = list[0].ContractID; DefaultChargeManID = list[0].DefaultChargeManID; } this.rptProject.DataSource = list; this.rptProject.DataBind(); printRoomFeeHistory = PrintRoomFeeHistory.GetPrintRoomFeeHistory(PrintID); } else { var list = ViewTempRoomFeeHistory.GetViewTempRoomFeeHistoryListByIDs(IDList); if (list.Length > 0) { RoomID = list[0].RoomID; } foreach (var item in list) { money += item.ChargeFee; TotalCost += item.Cost; } var historyfees = list; this.rptProject.DataSource = historyfees; this.rptProject.DataBind(); } var project = Foresight.DataAccess.Project.GetProjectByID(ID: RoomID, ContractID: ContractID); if (project != null) { this.tdRemark.Value = project.PrintNote; this.tdFirstTitle.Value = project.PrintTitle; if (project.IsDefinePrintSize) { this.tdWidth.Value = project.PrintWidth > 0 ? project.PrintWidth.ToString() : "210"; this.tdHeight.Value = project.PrintHeight > 0 ? project.PrintHeight.ToString() : WebUtil.GetPrintHeight().ToString(); } else { this.tdWidth.Value = "210"; this.tdHeight.Value = WebUtil.GetPrintHeight(project.PrintType).ToString(); } this.FullName = project.FullName + "-" + project.Name; } RoomPhoneRelation relation = null; if (DefaultChargeManID > 0) { relation = RoomPhoneRelation.GetRoomPhoneRelation(DefaultChargeManID); } if (relation == null) { relation = RoomPhoneRelation.GetDefaultInChargeFeeRoomPhoneRelation(RoomID, ContractID); } if (relation != null) { this.OwnerName = relation.RelationName; } if (PrintID <= 0) { GetInfo(RoomID); } SetInfo(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int.TryParse(Request.QueryString["TempID"], out TempHistoryID); int.TryParse(Request.QueryString["PayServiceID"], out PayServiceID); int.TryParse(Request.QueryString["PrintID"], out PrintID); this.tdWidth.Value = "210"; this.tdHeight.Value = "99"; var newlist = new List <RoomFeeModule>(); if (PrintID > 0) { var payservice = Foresight.DataAccess.PayService.GetPayServiceByPrintID(PrintID); PayServiceID = payservice != null ? payservice.ID : PayServiceID; printRoomFeeHistory = PrintRoomFeeHistory.GetPrintRoomFeeHistory(PrintID); var historys = Foresight.DataAccess.RoomFeeHistory.GetRoomFeeHistoryByPrintID(PrintID); int RoomID = 0; if (historys.Length > 0) { foreach (var item in historys) { var roomFeeModule = new RoomFeeModule(); roomFeeModule.HistoryID = item.HistoryID; roomFeeModule.ChargeTime = item.ChargeTime; roomFeeModule.RealCost = item.RealCost; roomFeeModule.ChargeName = item.ChargeFeeSummaryName; roomFeeModule.PrintNumber = item.PrintNumber; roomFeeModule.Remark = item.BackGuaranteeRemark; roomFeeModule.ChargeMan = item.ChargeMan; this.money += roomFeeModule.RealCost; newlist.Add(roomFeeModule); } RoomID = historys[0].RoomID; } else { var temhistorys = Foresight.DataAccess.TempRoomFeeHistory.GetTempRoomFeeHistorysByPrintID(PrintID); if (temhistorys.Length > 0) { foreach (var item in temhistorys) { var roomFeeModule = new RoomFeeModule(); roomFeeModule.HistoryID = item.TempHistoryID; roomFeeModule.ChargeTime = item.ChargeTime; roomFeeModule.RealCost = item.RealCost; roomFeeModule.ChargeName = item.ChargeFeeSummaryName; roomFeeModule.PrintNumber = item.PrintNumber; roomFeeModule.Remark = item.BackGuaranteeRemark; roomFeeModule.ChargeMan = item.ChargeMan; this.money += roomFeeModule.RealCost; newlist.Add(roomFeeModule); } RoomID = temhistorys[0].RoomID; } } var project = Foresight.DataAccess.Project.GetProject(RoomID); if (project != null) { if (project.IsDefinePrintSize) { this.tdWidth.Value = project.PrintWidth > 0 ? project.PrintWidth.ToString() : "210"; this.tdHeight.Value = project.PrintHeight > 0 ? project.PrintHeight.ToString() : WebUtil.GetPrintHeight().ToString(); } else { this.tdWidth.Value = "210"; this.tdHeight.Value = WebUtil.GetPrintHeight(project.PrintType).ToString(); } this.FirstTitle = project.PayPrintTitle; this.SubTitle = project.PayPrintSubTitle; } if (string.IsNullOrEmpty(this.FirstTitle)) { this.FirstTitle = WebUtil.GetCompany(this.Context).CompanyName; } this.tdFirstTitle.InnerHtml = this.FirstTitle; if (string.IsNullOrEmpty(this.SubTitle)) { this.SubTitle = "付款单据"; } this.tdSubTitle.InnerText = this.SubTitle; } else { var temphistory = Foresight.DataAccess.TempRoomFeeHistory.GetTempRoomFeeHistory(TempHistoryID); if (temphistory == null) { Response.End(); return; } List <decimal> RealPayList = new List <decimal>(); List <string> RemarkList = new List <string>(); TempRoomFeeHistory[] list = new TempRoomFeeHistory[] { temphistory }; foreach (var item in list) { var roomFeeModule = new RoomFeeModule(); roomFeeModule.HistoryID = item.TempHistoryID; roomFeeModule.ChargeTime = item.ChargeTime; roomFeeModule.RealCost = item.RealCost; roomFeeModule.ChargeName = item.ChargeFeeSummaryName; roomFeeModule.PrintNumber = item.PrintNumber; roomFeeModule.Remark = item.BackGuaranteeRemark; roomFeeModule.ChargeMan = item.ChargeMan; this.money += roomFeeModule.RealCost; newlist.Add(roomFeeModule); } var project = Foresight.DataAccess.Project.GetProject(list[0].RoomID); if (project != null) { printRoomFeeHistory.Remark = project.PrintCancelNote; printRoomFeeHistory.RoomFullName = project.FullName; var basic = Foresight.DataAccess.ViewRoomBasic.GetViewRoomBasicByRoomID(list[0].RoomID); if (basic != null) { printRoomFeeHistory.RoomFullName = printRoomFeeHistory.RoomFullName + "-" + project.Name; printRoomFeeHistory.RoomOwnerName = basic.RelationName; this.OwnerName = basic.RelationName; } if (project.IsDefinePrintSize) { this.tdWidth.Value = project.PrintWidth > 0 ? project.PrintWidth.ToString() : "210"; this.tdHeight.Value = project.PrintHeight > 0 ? project.PrintHeight.ToString() : WebUtil.GetPrintHeight().ToString(); } else { this.tdWidth.Value = "210"; this.tdHeight.Value = WebUtil.GetPrintHeight(project.PrintType).ToString(); } this.FirstTitle = project.PayPrintTitle; this.SubTitle = project.PayPrintSubTitle; } if (string.IsNullOrEmpty(this.FirstTitle)) { this.FirstTitle = WebUtil.GetCompany(this.Context).CompanyName; } this.tdFirstTitle.InnerHtml = this.FirstTitle; if (string.IsNullOrEmpty(this.SubTitle)) { this.SubTitle = "付款单据"; } this.tdSubTitle.InnerText = this.SubTitle; GetInfo(list[0].RoomID); } this.rptProject.DataSource = newlist; this.rptProject.DataBind(); SetInfo(); } }
protected void Page_Load(object sender, EventArgs e) { CanPrintCheque = new Utility.SiteConfig().IsWriteChequeOn; this.tdWidth.Value = "210"; this.tdHeight.Value = "99"; int.TryParse(Request.QueryString["PrintID"], out PrintID); string IDs = Request.QueryString["IDs"]; List <int> IDList = new List <int>(); List <int> RoomIDList = new List <int>(); List <int> ContractIDList = new List <int>(); List <string> OwnerNameList = new List <string>(); if (PrintID == 0) { if (string.IsNullOrEmpty(IDs)) { Response.End(); return; } } if (!string.IsNullOrEmpty(IDs)) { IDList = JsonConvert.DeserializeObject <List <int> >(IDs); } if (!IsPostBack) { if (PrintID > 0) { var list = ViewRoomFeeHistory.GetViewRoomFeeHistoryListByIDs(0, IDList, PrintID); if (list.Length > 0) { RoomIDList = list.Select(p => p.RoomID).Distinct().ToList(); } else { Response.End(); return; } this.rptProject.DataSource = list; this.rptProject.DataBind(); OwnerNameList = list.Where(p => !string.IsNullOrEmpty(p.DefaultChargeManName)).Select(p => p.DefaultChargeManName).Distinct().ToList(); printRoomFeeHistory = PrintRoomFeeHistory.GetPrintRoomFeeHistory(PrintID); } else { var list = ViewTempRoomFeeHistory.GetViewTempRoomFeeHistoryListByIDs(IDList); if (list.Length > 0) { RoomIDList = list.Select(p => p.RoomID).Distinct().ToList(); ContractIDList = list.Where(p => p.ContractID > 0).Select(p => p.ContractID).Distinct().ToList(); } foreach (var item in list) { money += item.RealCost; TotalCost += item.Cost; } this.rptProject.DataSource = list; this.rptProject.DataBind(); OwnerNameList = list.Where(p => !string.IsNullOrEmpty(p.DefaultChargeManName)).Select(p => p.DefaultChargeManName).Distinct().ToList(); } RoomID = RoomIDList.Count > 0 ? RoomIDList[0] : 0; ContractID = ContractIDList.Count > 0 ? ContractIDList[0] : 0; if (RoomIDList.Count > 0) { RoomID = RoomIDList[0]; } var project = Foresight.DataAccess.Project.GetProjectByID(ID: RoomID, ContractID: ContractID); var relation = Foresight.DataAccess.RoomPhoneRelation.GetDefaultInChargeFeeRoomPhoneRelation(RoomID, ContractID); DefaultRelationID = relation != null ? relation.ID : 0; string AllParentID = string.Empty; if (project != null) { AllParentID = project.AllParentID; this.tdRemark.Value = project.PrintNote; this.FirstTitle = project.PrintTitle; this.SubTitle = project.PrintSubTitle; this.PrintFont = project.PrintFont; this.IsPrintCount = project.IsPrintCount; this.IsPrintNote = project.IsPrintNote; this.IsPrintCost = project.IsPrintCost; this.IsPrintDiscount = project.IsPrintDiscount; this.IsPrintRoomNo = project.IsPrintRoomNo; this.IsPrintTotalRealCost = project.IsPrintTotalRealCost; this.IsPrintRealCost = project.IsPrintRealCost; this.IsPrintMonthCount = project.IsPrintMonthCount; this.LogoPath = project.LogoPath; this.LogoWidth = project.LogoWidth; this.LogoHeight = project.LogoHeight; this.IsPrintUnitPrice = project.IsPrintUnitPrice; if (project.IsDefinePrintSize) { this.tdWidth.Value = project.PrintWidth > 0 ? project.PrintWidth.ToString() : "210"; this.tdHeight.Value = project.PrintHeight > 0 ? project.PrintHeight.ToString() : WebUtil.GetPrintHeight().ToString(); } else { this.tdWidth.Value = "210"; this.tdHeight.Value = WebUtil.GetPrintHeight(project.PrintType).ToString(); } this.FullName = project.FullName + "-" + project.Name; this.PrintChargeTypeCount = project.PrintChargeTypeCount; } if (this.IsPrintCount) { this.ColumnCount++; } if (this.IsPrintNote) { this.ColumnCount++; } if (this.IsPrintCost) { this.ColumnCount++; } if (this.IsPrintDiscount) { this.ColumnCount++; } if (this.IsPrintRoomNo) { this.ColumnCount++; } if (this.IsPrintTotalRealCost) { this.ColumnCount++; } if (this.IsPrintRealCost) { this.ColumnCount++; } if (this.IsPrintMonthCount) { this.ColumnCount++; } if (this.IsPrintUnitPrice) { this.ColumnCount++; } if (string.IsNullOrEmpty(this.FirstTitle)) { this.FirstTitle = WebUtil.GetCompany(this.Context).CompanyName; } this.tdFirstTitle.Value = this.FirstTitle; if (string.IsNullOrEmpty(this.SubTitle)) { this.SubTitle = "收款单据"; } this.tdSubTitle.InnerText = this.SubTitle; var configList = SysConfig.Get_SysConfigListByProjectIDList(MinProjectID: RoomID, MaxProjectID: RoomID, ConfigName: SysConfigNameDefine.RealCostCouZhengOn); bool isCouZhengOn = SysConfig.IsCouZhengOn(configList, AllParentID); if (isCouZhengOn) { this.ShowWeiShu = true; } if (PrintID <= 0) { GetInfo(RoomID, isCouZhengOn); } SetInfo(RoomID, isCouZhengOn); if (OwnerNameList.Count > 0) { if (OwnerNameList.Count <= 3) { this.OwnerName = string.Join(",", OwnerNameList.ToArray()); } else { this.OwnerName = OwnerNameList[0]; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.tdWidth.Value = "210"; this.tdHeight.Value = "99"; int.TryParse(Request.QueryString["PrintID"], out PrintID); int.TryParse(Request.QueryString["ChargeID"], out ChargeID); this.RoomIDs = Request.QueryString["RoomIDs"]; List <int> RoomIDList = new List <int>(); var newlist = new List <Utility.RoomFeeModule>(); if (!string.IsNullOrEmpty(RoomIDs)) { RoomIDList = JsonConvert.DeserializeObject <List <int> >(RoomIDs); } if (PrintID > 0) { printRoomFeeHistory = PrintRoomFeeHistory.GetPrintRoomFeeHistory(PrintID); var list = ViewRoomFeeHistory.GetPreChargeViewRoomFeeHistoryList(PrintID); for (int i = 0; i < list.Length; i++) { var roomFeeModule = new Utility.RoomFeeModule(); roomFeeModule.ChargeFeeSummaryName = list[i].ChargeFeeSummaryName; roomFeeModule.RealCost = list[i].RealCost; roomFeeModule.ChargeFeeCurrentBalance = list[i].ChargeFeeCurrentBalance; roomFeeModule.TotalRestBalance = list[i].ChargeFeeCurrentBalance - list[i].RealCost; newlist.Add(roomFeeModule); } this.money = printRoomFeeHistory.RealCost; } else { string ChargeFeeSummaryName = "退预收款"; if (ChargeID > 0) { var chargesummary = Foresight.DataAccess.ChargeSummary.GetChargeSummary(ChargeID); ChargeFeeSummaryName = chargesummary != null ? "退" + chargesummary.Name : "退预收款"; } decimal ChargeFeeCurrentBalance = Foresight.DataAccess.ViewRoomBalance.GetPreChargeBalance(RoomIDList, ChargeID); var roomFeeModule = new Utility.RoomFeeModule(); roomFeeModule.ChargeFeeSummaryName = ChargeFeeSummaryName; roomFeeModule.RealCost = ChargeFeeCurrentBalance; roomFeeModule.ChargeFeeCurrentBalance = ChargeFeeCurrentBalance; roomFeeModule.TotalRestBalance = 0; newlist.Add(roomFeeModule); this.money = ChargeFeeCurrentBalance; } this.rptProject.DataSource = newlist; this.rptProject.DataBind(); var project = Foresight.DataAccess.Project.GetProject(RoomIDList[0]); if (project != null) { this.tdRemark.Value = project.PrintNote; if (project.IsDefinePrintSize) { this.tdWidth.Value = project.PrintWidth > 0 ? project.PrintWidth.ToString() : "210"; this.tdHeight.Value = project.PrintHeight > 0 ? project.PrintHeight.ToString() : WebUtil.GetPrintHeight().ToString(); } else { this.tdWidth.Value = "210"; this.tdHeight.Value = WebUtil.GetPrintHeight(project.PrintType).ToString(); } this.FirstTitle = project.PayPrintTitle; this.SubTitle = project.PayPrintSubTitle; if (string.IsNullOrEmpty(this.FirstTitle)) { this.FirstTitle = WebUtil.GetCompany(this.Context).CompanyName; } this.tdFirstTitle.InnerHtml = this.FirstTitle; if (string.IsNullOrEmpty(this.SubTitle)) { this.SubTitle = "付款单据"; } this.tdSubTitle.InnerText = this.SubTitle; this.FullName = project.FullName + "-" + project.Name; } RoomPhoneRelation relation = null; if (relation == null) { relation = RoomPhoneRelation.GetDefaultInChargeFeeRoomPhoneRelation(RoomIDList[0], 0); } if (relation != null) { this.OwnerName = relation.RelationName; } if (printRoomFeeHistory == null) { GetInfo(RoomIDList[0]); } SetInfo(); } }