Beispiel #1
0
        protected void Find_Click(object sender, EventArgs e)
        {
            DateTime          value;
            ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
            long?    nullable  = new long?((long)0);
            DateTime?nullable1 = new DateTime?(DateTime.MinValue);
            string   str       = "";
            bool?    nullable2 = new bool?(false);

            if ((int)proceduresAdapter.GetSaleOrder(this.SaleOrderCode.Text, new int?((int)this.Session["UserID"]), ref nullable, ref nullable1, ref str, ref nullable2) == 1)
            {
                this.FailureText.Text              = "Nu s-a gasit o comanda de vanzare cu acest cod!";
                this.DocDate.Text                  = "";
                this.CustomerName.Text             = "";
                this.SaleOrderLinesView.DataSource = null;
                this.SaleOrderLinesView.DataBind();
                this.Finish.Visible         = false;
                this.Session["SaleOrderId"] = null;
                return;
            }
            if (nullable2.Value)
            {
                this.FailureText.Text = "Aceasta comanda este livrata integral!";
                TextBox docDate = this.DocDate;
                value                              = nullable1.Value;
                docDate.Text                       = value.ToString("dd/MM/yyyy");
                this.CustomerName.Text             = str;
                this.SaleOrderLinesView.DataSource = null;
                this.SaleOrderLinesView.DataBind();
                this.Finish.Visible         = false;
                this.Session["SaleOrderId"] = null;
                return;
            }
            TextBox textBox = this.DocDate;

            value                  = nullable1.Value;
            textBox.Text           = value.ToString("dd/MM/yyyy");
            this.CustomerName.Text = str;
            SaleOrderLinesTableAdapter saleOrderLinesTableAdapter = new SaleOrderLinesTableAdapter();

            this.SaleOrderLinesView.Columns[0].Visible = true;
            this.SaleOrderLinesView.DataSource         = saleOrderLinesTableAdapter.GetData(nullable);
            this.SaleOrderLinesView.DataBind();
            this.Finish.Visible         = true;
            this.Session["SaleOrderId"] = nullable;
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (base.IsPostBack)
     {
         this.FailureText.Text = "";
         this.SuccessText.Text = "";
         return;
     }
     if (base.Request.UrlReferrer != null && base.Request.UrlReferrer.AbsolutePath.ToLower().Contains("delivery2") && this.Session["SaleOrderId"] != null && this.Session["SaleOrderCode"] != null)
     {
         this.SaleOrderCode.Text = this.Session["SaleOrderCode"].ToString();
         this.DocDate.Text       = this.Session["DocDate"].ToString();
         this.CustomerName.Text  = this.Session["CustomerName"].ToString();
         SaleOrderLinesTableAdapter saleOrderLinesTableAdapter = new SaleOrderLinesTableAdapter();
         long item = (long)this.Session["SaleOrderId"];
         this.SaleOrderLinesView.DataSource = saleOrderLinesTableAdapter.GetData(new long?(item));
         this.Finish.Visible = true;
     }
     this.SaleOrderLinesView.DataBind();
 }