Exemplo n.º 1
0
    private void GetList()
    {
        if (Application["Config"] != null)
        {
            Libs.Content.Config con = (Libs.Content.Config)Application["Config"];
            lstStatus = con.StatusTicket;
            AppUtils.LoadDropDownList(drpStatus, lstStatus);
        }
        string airline   = drpAir.SelectedValue;
        int    status    = Convert.ToInt32(drpStatus.SelectedValue);
        string startdate = txtFromDate.Value.Trim();

        if (!string.IsNullOrEmpty(startdate))
        {
            startdate = AppUtils.ConvertDateTimeUTC(startdate);
        }
        string enddate = txtToDate.Value.Trim();

        if (!string.IsNullOrEmpty(enddate))
        {
            enddate = DateTime.Parse(enddate, new CultureInfo("vi-VN", true)).AddDays(1).ToString("MM/dd/yyyy");
        }
        lstOrder = new OrdersCheap().Get(status, airline, startdate, enddate);
        if (Session["OrdersCheap"] != null)
        {
            Session.Remove("OrdersCheap");
            Session["OrdersCheap"] = null;
        }
        Session.Add("OrdersCheap", lstOrder);
        rptList.DataSource = lstOrder;
        rptList.DataBind();

        lblTotalRecord.Text = "Tổng số bản ghi: " + rptList.Items.Count;
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OrdersTours order = new OrdersTours();
        int         id    = int.Parse(Request.QueryString["id"].ToString());

        if (Request.QueryString["action"] != null)
        {
            if (Request.QueryString["status"] != null)
            {
                int    status = int.Parse(Request.QueryString["status"].ToString());
                string action = Request.QueryString["action"].ToString();
                if (action == "update")
                {
                    order.UpdateStatus(id, status, AppUtils.UserID().ToString());
                    Response.StatusCode = 200;
                    Response.Flush();
                    return;
                }
            }
        }
        List <OrdersTours> lstOrder = new List <OrdersTours>();

        lstOrder = order.GetById(id);
        if (lstOrder.Count > 0)
        {
            if (Application["Config"] != null)
            {
                Libs.Content.Config con = (Libs.Content.Config)Application["Config"];
                AppUtils.LoadDropDownList(drpStatus, con.StatusTour);
            }
            lblContactName.Text     = lstOrder[0].FirstName + " " + lstOrder[0].LastName;
            lblContactEmail.Text    = lstOrder[0].Email;
            lblContactPhone.Text    = lstOrder[0].Phone;
            lblContactAddress.Text  = lstOrder[0].Address;
            lblRemarks.Text         = lstOrder[0].Remarks;
            lblContactPhone.Text    = lstOrder[0].Phone;
            drpStatus.SelectedValue = lstOrder[0].Status.ToString();
            if (lstOrder[0].Status == 1 || lstOrder[0].Status == 2)
            {
                drpStatus.Enabled = false;
            }
        }
    }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             Title = "Cadavan - Danh sách đơn hàng đặt tour";
             if (Application["Config"] != null)
             {
                 Libs.Content.Config con = (Libs.Content.Config)Application["Config"];
                 lstStatus = con.StatusTour;
                 AppUtils.LoadDropDownList(drpStatus, lstStatus);
             }
             GetList();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int         id    = int.Parse(Request.QueryString["id"].ToString());
        OrdersCheap order = new OrdersCheap();

        if (Request.QueryString["action"] != null)
        {
            int    status = int.Parse(Request.QueryString["status"].ToString());
            string action = Request.QueryString["action"].ToString();
            if (action == "update")
            {
                order.UpdateStatus(id, status, AppUtils.UserID().ToString());
                Response.StatusCode = 200;
                Response.Flush();
                return;
            }
        }
        List <OrdersCheap> lstOrder = new List <OrdersCheap>();

        if (Session["OrdersCheap"] != null)
        {
            lstOrder = (List <OrdersCheap>)Session["OrdersCheap"];
            order    = lstOrder.Where(o => o.OrderId == id).FirstOrDefault();
        }
        else
        {
            lstOrder = order.GetById(id);
            if (lstOrder.Count > 0)
            {
                order = lstOrder[0];
            }
        }
        if (Application["Config"] != null)
        {
            Libs.Content.Config con = (Libs.Content.Config)Application["Config"];
            AppUtils.LoadDropDownList(drpStatus, con.StatusCheapTicket);
        }
        drpStatus.SelectedValue = order.Status.ToString();
        if (order.Status == 2 || order.Status == 3)
        {
            drpStatus.Enabled = false;
        }
        fromname               = order.FromCity;
        toname                 = order.ToCity;
        lblStartDate.Text      = order.DepTime.ToString().Remove(5) + " " + order.StartDate.ToString("dd/MM/yyyy");
        lblEndDate.Text        = order.DicTime.ToString().Remove(5) + " " + order.EndDate.ToString("dd/MM/yyyy");
        lblTimeFly.Text        = AppUtils.CalTimeFly(order.StartDate.ToString("dd/MM/yyyy"), order.EndDate.ToString("dd/MM/yyyy"), order.DepTime.ToString(), order.DicTime.ToString());
        lblTotalPrice.Text     = AppUtils.ConvertPrice(order.Price.ToString());
        lblContactName.Text    = order.FirstName + " " + order.LastName;
        lblContactPhone.Text   = order.Phone;
        lblContactEmail.Text   = order.Email;
        lblContactAddress.Text = order.Address;
        if (order.Target == 0)
        {
            lblTarget.Text = "Người lớn";
        }
        else if (order.Target == 1)
        {
            lblTarget.Text = "Trẻ em";
        }
        else
        {
            lblTarget.Text = "Em bé";
        }
        lblQuantity.Text = order.Num.ToString();
        lblPrice.Text    = AppUtils.ConvertPrice(order.AdultPriceNet.ToString());
    }