예제 #1
0
        protected void rptTour_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            GridView gvTour     = e.Item.FindControl("gvTour") as GridView;
            Button   btnAddTour = e.Item.FindControl("btnAddTour") as Button;
            //rptTour.ItemCommand +=new RepeaterCommandEventHandler(rptTour_ItemCommand);

            BillTicketPerson p = e.Item.DataItem as BillTicketPerson;

            var TourList = svr.getTicketTour(int.Parse(hidID.Value), p.OwnerName);
            //当账单人数多于10人,空白记录设为1条,小于10人时,设为4条
            int BlankTourCnt = 4;

            if (gvData.Rows.Count > 10)
            {
                BlankTourCnt = 1;
            }

            if (TourList.Count == 0)
            {
                for (int i = 0; i < BlankTourCnt; i++)
                {
                    TourList.Add(new BillTicketTour());
                }
            }

            gvTour.DataSource = TourList;
            gvTour.DataBind();
        }
예제 #2
0
        private List <BillTicketPerson> BindPerson(bool AddNew, int AddCount)
        {
            List <BillTicketPerson> lis       = new List <BillTicketPerson>();
            List <string>           OwnerList = new List <string>();
            BillTicketPerson        person;
            TextBox      txtOwnerName, txtBankStatement;
            CheckBox     chkShowOnInvoice, chkPayPartly;
            DropDownList ddlMergeWith;
            Label        lblPrice;

            //保存现有的gridview 数据
            for (int i = 0; i < gvData.Rows.Count; i++)
            {
                if (gvData.Rows[i].Visible == false)
                {
                    continue;
                }

                txtOwnerName = (TextBox)gvData.Rows[i].FindControl("txtOwnerName");
                OwnerList.Add(txtOwnerName.Text);
                txtBankStatement       = (TextBox)gvData.Rows[i].FindControl("txtBankStatement");
                chkShowOnInvoice       = (CheckBox)gvData.Rows[i].FindControl("chkShowOnInvoice");
                chkPayPartly           = (CheckBox)gvData.Rows[i].FindControl("chkPayPartly");
                ddlMergeWith           = (DropDownList)gvData.Rows[i].FindControl("ddlMergeWith");
                lblPrice               = (Label)gvData.Rows[i].FindControl("lblPrice");
                person                 = new BillTicketPerson();
                person.OwnerName       = txtOwnerName.Text.Trim();
                person.BankStatement   = txtBankStatement.Text.Trim();
                person.IsShowOnInvoice = chkShowOnInvoice.Checked;
                person.PayNotEnough    = chkPayPartly.Checked;
                person.Price           = decimal.Parse(lblPrice.Text);
                if (ddlMergeWith.SelectedValue == "Prev" && i > 0)
                {
                    person.MergeWith = OwnerList[i - 1];
                }
                lis.Add(person);
            }
            //新增一行
            if (AddNew)
            {
                for (int i = 0; i < AddCount; i++)
                {
                    person = new BillTicketPerson();
                    person.IsShowOnInvoice = true;
                    person.PayNotEnough    = false;
                    lis.Add(person);
                }
            }
            return(lis);
        }
예제 #3
0
        private List<BillTicketPerson> BindPerson(bool AddNew, int AddCount)
        {
            List<BillTicketPerson> lis = new List<BillTicketPerson>();
            List<string> OwnerList = new List<string>();
            BillTicketPerson person;
            TextBox txtOwnerName, txtBankStatement;
            CheckBox chkShowOnInvoice, chkPayPartly;
            DropDownList ddlMergeWith;
            Label lblPrice;
            //保存现有的gridview 数据
            for (int i = 0; i < gvData.Rows.Count; i++)
            {
                if (gvData.Rows[i].Visible == false) continue;

                txtOwnerName = (TextBox)gvData.Rows[i].FindControl("txtOwnerName");
                OwnerList.Add(txtOwnerName.Text);
                txtBankStatement = (TextBox)gvData.Rows[i].FindControl("txtBankStatement");
                chkShowOnInvoice = (CheckBox)gvData.Rows[i].FindControl("chkShowOnInvoice");
                chkPayPartly = (CheckBox)gvData.Rows[i].FindControl("chkPayPartly");
                ddlMergeWith = (DropDownList)gvData.Rows[i].FindControl("ddlMergeWith");
                lblPrice = (Label)gvData.Rows[i].FindControl("lblPrice");
                person = new BillTicketPerson();
                person.OwnerName = txtOwnerName.Text.Trim();
                person.BankStatement = txtBankStatement.Text.Trim();
                person.IsShowOnInvoice = chkShowOnInvoice.Checked;
                person.PayNotEnough = chkPayPartly.Checked;
                person.Price = decimal.Parse(lblPrice.Text);
                if (ddlMergeWith.SelectedValue == "Prev" && i > 0)
                    person.MergeWith = OwnerList[i - 1];
                lis.Add(person);
            }
            //新增一行
            if (AddNew)
            {
                for (int i = 0; i < AddCount; i++)
                {
                    person = new BillTicketPerson();
                    person.IsShowOnInvoice = true;
                    person.PayNotEnough = false;
                    lis.Add(person);
                }

            }
            return lis;
        }