Ejemplo n.º 1
0
        public void setData(int offerid, SQLConnector scon)
        {
            sCon = scon;
            dS = new DataSet();
            OfferID = offerid;
            if (offerid >= 0)
            {
                lb_id.Text = "Offer-ID: " + offerid;
            }

            //load tours, offer Data from Server
            sDA_tour = sCon.getShip_Tours_List(dS, null);
            sDA_offer = sCon.getOffer(dS, "offer", null, OfferID);

            lBox_tour.DataSource = dS.Tables["ship_tours"];
            lBox_tour.DisplayMember = "TourName";
            lBox_tour.ValueMember = "TourID";

            if (dS.Tables["offer"].Rows.Count > 0)
            {
                lb_id.Text = "Offer-ID: " + dS.Tables["offer"].Rows[0]["ID"];
                lBox_tour.SelectedValue = dS.Tables["offer"].Rows[0]["tourID"];
                dTP_createDate.Value = (DateTime)dS.Tables["offer"].Rows[0]["create_date"];
                dTP_createTime.Value = (DateTime)dS.Tables["offer"].Rows[0]["create_date"];
                dTP_expireDate.Value = (DateTime)dS.Tables["offer"].Rows[0]["expire_date"];
                dTP_expireTime.Value = (DateTime)dS.Tables["offer"].Rows[0]["expire_date"];

                nTB_price.Text = ((Decimal)dS.Tables["offer"].Rows[0]["price"]).ToString();
                tB_name.Text = (string)dS.Tables["offer"].Rows[0]["name"];
            }
        }