protected void Page_Load(object sender, EventArgs e)
 {
     objcustomer = new clsCustomer();
     sCOM        = new Common();
     if (!Page.IsPostBack)
     {
         sSQL = objcustomer.DispDataAll();
         //To Fill Gridview
         sCOM.setGridView(GridView1, sSQL);
     }
 }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //objpayment = new clsBooking();
        //objcarmaster = new clsCarMaster();
        objcustomer = new clsCustomer();
        //objdriver = new clsDriver();
        objpayment = new clsPayment();
        sCOM       = new Common();

        //txtbdate.Text = .ToDateTime.now();

        //To fill Dropdownlist
        uname = (String)Session["uname"];
        if (uname != null)
        {
            txtuname.Text = uname;
        }
        else
        {
            txtuname.Text = "travelagent";
        }
        if (!Page.IsPostBack)
        {
            //sSQL = objcarmaster.DispDataAll();
            //sCOM.setDropDownList(drpcarcode, sSQL, "CarName", "CarCode");
            sSQL = objcustomer.DispDataAll();
            sCOM.setDropDownList(drpcustcode, sSQL, "CustName", "CustCode");

            //sSQL = objdriver.DispDataAll();
            //sCOM.setDropDownList(drpdrcode, sSQL, "DriverName", "Dcode");
            if (Request.QueryString["action"] == "add")
            {
                txtpaymtdate.Text = DateTime.Now.Date.ToString();
                txtpaymtcode.Text = sCOM.setAutoID("Payment", "PaymentCode").ToString();
            }
            else if (Request.QueryString["action"] == "edit")
            {
                if (Request.QueryString["ec"] != null)
                {
                    string ec = (Request.QueryString["ec"].ToString());
                    txtpaymtcode.Text = ec;
                    objpayment        = objpayment.GetData(ec);

                    /*if (chkStatus.Checked == true)
                     * {
                     *  objdriver.Status = "Active";
                     * }
                     * else
                     * {
                     *  objdriver.Status = "Inactive";
                     * }*/

                    txtpaymtdate.Text = objpayment.PaymentDate.ToString();
                    drpcustcode.Text  = objpayment.CustCode.ToString();
                    txtamount.Text    = objpayment.Amount.ToString();
                    txtrefno.Text     = objpayment.ReferenceNo.ToString();
                    txtrefdate.Text   = objpayment.ReferenceDate.ToString();
                    drpmode.Text      = objpayment.Mode.ToString();
                    txtbankname.Text  = objpayment.BankName;
                    txtchqno.Text     = objpayment.ChequeNo.ToString();
                    txtchqdte.Text    = objpayment.ChequeDate.ToString();
                    txtuname.Text     = objpayment.Username;
                }
            }
            else
            {
                //Error Page
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        objbooking   = new clsBooking();
        objcarmaster = new clsCarMaster();
        objcustomer  = new clsCustomer();
        objdriver    = new clsDriver();
        sCOM         = new Common();

        //txtbdate.Text = .ToDateTime.now();

        //To fill Dropdownlist



        /* uname = (String)Session["uname"];
         * if (uname != null)
         * {
         *   txtdname.Text = uname;
         * }
         * else
         * {
         *   txtdname.Text = "travelagent";
         * }*/
        if (!Page.IsPostBack)
        {
            sSQL = objcarmaster.DispDataAll();
            sCOM.setDropDownList(drpcarcode, sSQL, "CarName", "CarCode");
            sSQL = objcustomer.DispDataAll();
            sCOM.setDropDownList(drpcustcode, sSQL, "CustName", "CustCode");

            sSQL = objdriver.DispDataAll();
            sCOM.setDropDownList(drpdrcode, sSQL, "DriverName", "Dcode");
            if (Request.QueryString["action"] == "add")
            {
                txtbdate.Text = DateTime.Now.Date.ToString();
                txtbcode.Text = sCOM.setAutoID("Booking", "BookingCode").ToString();
            }
            else if (Request.QueryString["action"] == "edit")
            {
                if (Request.QueryString["ec"] != null)
                {
                    string ec = (Request.QueryString["ec"].ToString());
                    txtbcode.Text = ec;
                    objbooking    = objbooking.GetData(ec);

                    /*if (chkStatus.Checked == true)
                     * {
                     *  objdriver.Status = "Active";
                     * }
                     * else
                     * {
                     *  objdriver.Status = "Inactive";
                     * }*/

                    txtpckdate.Text    = objbooking.PickupDate.ToString();
                    txtdrpdate.Text    = objbooking.DropDate.ToString();
                    drpcustcode.Text   = objbooking.CustCode.ToString();
                    drpcarcode.Text    = objbooking.CarCode.ToString();
                    drpdrcode.Text     = objbooking.DriverCode.ToString();
                    drppassengers.Text = objbooking.Passengers.ToString();
                    txtpckaddress.Text = objbooking.PickupAddress;
                    txtdraddress.Text  = objbooking.DropAddress;
                    txtremark.Text     = objbooking.Remark;
                    txtbdate.Text      = objbooking.BookingDate.ToString();
                    txtfare.Text       = objbooking.Fare.ToString();
                    drpstatus.Text     = objbooking.Status;
                }
            }
            else
            {
                //Error Page
            }
        }
    }