protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)  //if not logged in
            {
                Response.Redirect("/");
            }

            try
            {
                dsOrder = new OrdersDataSet();
                on_orderTableAdapter daOrder = new on_orderTableAdapter();

                daOrder.Fill(dsOrder.on_order);


                if (Request.Cookies["ID"] != null) // Request the cookies which contaions the ID Of thr record that was carried over from the index page
                {
                    id = Convert.ToInt32(Request.Cookies["ID"].Value);
                }
                if (Request.Cookies["Action"] != null && Request.Cookies["Action"].Value == "Delete")
                {
                    pnlDeleteConfirm.Visible = true;
                    lblTitle.Text            = "Delete Order";
                }
                else
                {
                    pnlDeleteConfirm.Visible = false;
                }
            }
            catch { return; }
        }
示例#2
0
        static ArrivedOrder()
        {
            on_orderTableAdapter daOrder = new on_orderTableAdapter();

            try
            {
                daOrder.Fill(dsOrder.on_order);
            }
            catch { }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!User.Identity.IsAuthenticated)  //if not logged in
            {
                Response.Redirect("/");
            }

            try
            {
                dsOrder = new OrdersDataSet();
                on_orderTableAdapter daOrder = new on_orderTableAdapter();
                daOrder.Fill(dsOrder.on_order);
                if (Request.Cookies["ID"] != null) // Request the cookies which contaions the ID Of thr record that was carried over from the index page
                {
                    id = Convert.ToInt32(Request.Cookies["ID"].Value);
                }
            }
            catch { return; }
            if (!IsPostBack)
            {
                if (id != -1)
                {
                    try
                    {
                        DataRow order = dsOrder.on_order.FindByid(id); // Find the related Record and fill the fields in the page with the data

                        if (order != null)
                        {
                            this.txtID.Text                   = order.ItemArray[0].ToString();
                            this.txtInvoiceNumber.Text        = order.ItemArray[1].ToString();
                            this.txtArriveDate.Text           = Convert.ToDateTime(order.ItemArray[2]).ToString("yyyy-MM-dd");
                            this.txtNumberInOrder.Text        = order.ItemArray[3].ToString();
                            this.txtPrice.Text                = order.ItemArray[4].ToString();
                            this.ddlInventoryID.SelectedValue = order.ItemArray[5].ToString();
                            this.ddlProdOrderID.SelectedValue = order.ItemArray[6].ToString();
                        }
                        else
                        {
                            lblStatus.Text = "Please Try Again";
                        }
                    }
                    catch
                    {
                        lblStatus.Text = "Database Error";
                    }
                }
            }
        }