Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.tdWidth.Value  = "210";
            this.tdHeight.Value = "99";
            string     IDs    = Request.QueryString["IDs"];
            List <int> IDList = new List <int>();

            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;
                var list = ViewRoomFee.GetViewRoomFeeListByIDs(IDList, UserID: WebUtil.GetUser(this.Context).UserID);
                if (list.Length > 0)
                {
                    RoomID             = list[0].RoomID;
                    ContractID         = list[0].ContractID;
                    DefaultChargeManID = list[0].DefaultChargeManID;
                }
                foreach (var item in list)
                {
                    money += item.TotalCost;
                }
                this.rptProject.DataSource = list;
                this.rptProject.DataBind();
                var project = Foresight.DataAccess.Project.GetProjectByID(ID: RoomID, ContractID: ContractID);
                if (project != null)
                {
                    this.tdRemark.Value         = project.CuiFeiNote;
                    this.tdFirstTitle.InnerHtml = 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.IsPrintUnitPrice = project.IsPrintUnitPrice;
                    if (this.IsPrintUnitPrice)
                    {
                        this.ColumnCount++;
                    }
                    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;
                }
                SetInfo(RoomID);
            }
        }
Esempio n. 2
0
        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)
     {
         if (Request.QueryString["RoomID"] != null)
         {
             int.TryParse(Request.QueryString["RoomID"], out RoomID);
         }
         if (Request.QueryString["DefaultRelationID"] != null)
         {
             int.TryParse(Request.QueryString["DefaultRelationID"], out DefaultRelationID);
         }
         if (Request.QueryString["ContractID"] != null)
         {
             int.TryParse(Request.QueryString["ContractID"], out ContractID);
         }
         if (Request.QueryString["PrintID"] != null)
         {
             int.TryParse(Request.QueryString["PrintID"], out PrintID);
         }
         if (PrintID > 0)
         {
             var history_list = ViewRoomFeeHistory.GetViewRoomFeeHistoryListByPrintID(PrintID);
             if (history_list.Length > 0)
             {
                 DefaultRelationID = history_list[0].DefaultChargeManID;
                 RoomID            = history_list[0].RoomID;
                 ContractID        = history_list[0].ContractID;
                 CanPrintCheque    = true;
             }
         }
         Foresight.DataAccess.RoomPhoneRelation data = null;
         RoomBasic basic = null;
         using (SqlHelper helper = new SqlHelper())
         {
             if (DefaultRelationID > 0)
             {
                 data = RoomPhoneRelation.GetRoomPhoneRelation(DefaultRelationID, helper);
             }
             if (data == null)
             {
                 data = RoomPhoneRelation.GetDefaultInChargeFeeRoomPhoneRelation(RoomID, ContractID, helper);
             }
             if (data == null)
             {
                 basic = RoomBasic.GetRoomBasicByRoomID(RoomID, helper);
             }
         }
         if (data != null)
         {
             this.RelationID                  = data.ID;
             this.tdCompanyName.Value         = data.CompanyName;
             this.tdAddress.Value             = data.HomeAddress;
             this.tdBuyerTaxpayerNumber.Value = data.TaxpayerNumber;
             this.tdBuyerBankAccountNo.Value  = data.BankAccountNo;
             this.tdBuyerBankName.Value       = data.BankName;
             this.tdBuyerEmailAddress.Value   = data.EmailAddress;
         }
         if (basic != null)
         {
             this.tdCompanyName.Value         = basic.ChequeCompanyName;
             this.tdAddress.Value             = basic.ChequeAddress;
             this.tdBuyerTaxpayerNumber.Value = basic.ChequeTaxpayerNumber;
             this.tdBuyerBankAccountNo.Value  = basic.ChequeBankNo;
             this.tdBuyerBankName.Value       = basic.ChequeBankName;
             this.tdBuyerEmailAddress.Value   = basic.ChequeEmailAddress;
         }
         var company = Company.GetCompanies().FirstOrDefault();
         if (company != null)
         {
             this.tdSellerCompanyName.Value    = string.IsNullOrEmpty(company.ChequeTitle) ? company.CompanyName : company.ChequeTitle;
             this.tdSellerAddress.Value        = company.Address;
             this.tdSellerTaxpayerNumber.Value = company.TaxpayerNumber;
             this.tdSellerBankNo.Value         = company.BankAccountNo;
             this.tdSellerBankName.Value       = company.BankName;
             this.tdReCheckUserName.Value      = company.ReCheckUserName;
             this.tdCheque_SL.Value            = company.Cheque_SL > decimal.MinValue ? company.Cheque_SL.ToString("0.00") : string.Empty;
             this.tdCheque_FLBM.Value          = company.Cheque_FLBM;
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            string         GUID        = Request.QueryString["guid"];
            var            temp        = ChargeBackGuaranteeTemp.GetChargeBackGuaranteeTempListByGUID(GUID);
            List <decimal> RealPayList = new List <decimal>();
            List <string>  RemarkList  = new List <string>();

            this.tdWidth.Value  = "210";
            this.tdHeight.Value = "99";
            List <int> IDList = temp.Select(p => p.HistoryID).ToList();

            if (IDList.Count == 0)
            {
                Response.End();
                return;
            }
            if (!IsPostBack)
            {
                int RoomID             = 0;
                int DefaultChargeManID = 0;
                var list = ViewRoomFeeHistory.GetViewRoomFeeHistoryListByIDs(IDList);
                if (list.Length == 0)
                {
                    Response.End();
                    return;
                }
                RoomID             = list[0].RoomID;
                DefaultChargeManID = list[0].DefaultChargeManID;
                var historyfees = list;
                var newlist     = new List <RoomFeeModule>();
                foreach (var item in temp)
                {
                    var roomFeeModule      = new RoomFeeModule();
                    var viewRoomFeeHistory = list.FirstOrDefault(p => p.HistoryID == item.HistoryID);
                    if (viewRoomFeeHistory != null)
                    {
                        roomFeeModule.HistoryID   = viewRoomFeeHistory.HistoryID;
                        roomFeeModule.ChargeTime  = viewRoomFeeHistory.ChargeTime;
                        roomFeeModule.RealCost    = item.RealPay;
                        roomFeeModule.ChargeName  = viewRoomFeeHistory.ChargeName;
                        roomFeeModule.PrintNumber = viewRoomFeeHistory.PrintNumber;
                        roomFeeModule.Remark      = item.Remark;
                        roomFeeModule.ChargeMan   = viewRoomFeeHistory.ChargeMan;
                        this.money += roomFeeModule.RealCost;
                        newlist.Add(roomFeeModule);
                    }
                }
                this.rptProject.DataSource = newlist;
                this.rptProject.DataBind();
                var project = Foresight.DataAccess.Project.GetProjectByID(ID: RoomID, ContractID: 0);
                if (project != null)
                {
                    this.tdRemark.Value = project.PrintCancelNote;
                    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 (DefaultChargeManID > 0)
                {
                    relation = RoomPhoneRelation.GetRoomPhoneRelation(DefaultChargeManID);
                }
                if (relation == null)
                {
                    relation = RoomPhoneRelation.GetDefaultInChargeFeeRoomPhoneRelation(RoomID, ContractID: 0);
                }
                if (relation != null)
                {
                    this.OwnerName = relation.RelationName;
                }
                GetInfo(RoomID);
                SetInfo();
            }
        }
Esempio n. 5
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();
     }
 }