Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack)
     {
         return;
     }
     if (this.Session["DocDate"] != null && this.Session["SupplierName"] != null && this.Session["SupplyOrderId"] != null)
     {
         this.DocDate.Text      = (string)this.Session["DocDate"];
         this.SupplierName.Text = (string)this.Session["SupplierName"];
         ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
         long   num           = (long)this.Session["SupplyOrderId"];
         string str           = "";
         long?  SupplyOrderID = new long?(num);
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string SupplierDocNum = @str;
         proceduresAdapter.GetSupplyOrderInfo(SupplyOrderID, ref SupplierDocNum);
         this.SupplierDocNum.Text = str;
     }
     else
     {
         this.Response.Redirect("Receiving1");
     }
 }
Exemple #2
0
 protected void Receive_Click(object sender, EventArgs e)
 {
     if (!this.IsValid)
     {
         this.FailureText.Text = "";
     }
     else if (this.Session["SupplyOrderLineId"] == null)
     {
         this.Response.Redirect("Receiving1");
     }
     else
     {
         ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
         long   num1              = (long)this.Session["SupplyOrderLineId"];
         double num2              = Convert.ToDouble(this.ReceivedQty.Text);
         string text1             = this.InternalBatchNo.Text;
         string text2             = this.SupplierBatchNo.Text;
         long?  SupplyOrderLineID = new long?(num1);
         double?Quantity          = new double?(num2);
         string InternalBatchNo   = text1;
         string SupplierBatchNo   = text2;
         if ((int)proceduresAdapter.ReceiveSupplyOrderLine(SupplyOrderLineID, Quantity, InternalBatchNo, SupplierBatchNo) == 1)
         {
             this.FailureText.Text = "Receptia nu s-a efectuat!";
         }
         else
         {
             this.FailureText.Text = "";
             this.SuccessText.Text = "Receptia s-a efectuat cu succes";
             this.Receive.Visible  = false;
         }
     }
 }
        protected void Save_Click(object sender, EventArgs e)
        {
            if (!this.IsValid)
            {
                return;
            }
            if (this.Session["UserID"] != null)
            {
                this.Warehouse.SelectedValue = "10";
                ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
                string            text1             = this.ProdOrderCode.Text;
                short             int16             = Convert.ToInt16(this.Warehouse.SelectedValue);
                string            text2             = this.Remarks.Text;
                string            text3             = this.InternalBatchNo.Text;
                double            num1 = this.MainQty.Text.Length > 0 ? Convert.ToDouble(this.MainQty.Text) : 0.0;
                double            num2 = this.SecondQty.Text.Length > 0 ? Convert.ToDouble(this.SecondQty.Text) : 0.0;
                int num3 = (int)this.Session["UserID"];
                this.FailureText.Text = "";
                this.SuccessText.Text = "";
                if (num1 == 0.0 && num2 == 0.0)
                {
                    this.FailureText.Text = "Cel putin o cantitate de consum trebuie specificata!";
                }
                else
                {
                    switch ((int)proceduresAdapter.ReportConsumption(text1, new short?(int16), text2, text3, new double?(num1), new double?(num2), new int?(num3)))
                    {
                    case 3:
                        this.FailureText.Text = "Sunt necesare ambele tipuri de cantitati de consum!";
                        break;

                    case 2:
                        this.FailureText.Text = "Comanda productie sau lot material gresit!";
                        break;

                    case 1:
                        this.FailureText.Text = "Consumul nu a fost raportat!";
                        break;

                    default:
                        this.Warehouse.SelectedValue = "10";
                        this.Remarks.Text            = "";
                        this.InternalBatchNo.Text    = "";
                        this.MainQty.Text            = "";
                        this.SecondQty.Text          = "";
                        this.SuccessText.Text        = "Cosumul a fost raportat cu succes";
                        break;
                    }
                }
            }
            else
            {
                this.Response.Redirect("Login");
            }
        }
Exemple #4
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;
        }
 protected void Start_Click(object sender, EventArgs e)
 {
     if (!this.IsValid)
     {
         this.FailureText.Text = "";
     }
     else if (this.Session["ProductionOrderId"] == null)
     {
         this.Response.Redirect("ProdOrder1");
     }
     else
     {
         ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
         long   num1     = (long)this.Session["ProductionOrderId"];
         int    int32    = Convert.ToInt32(this.ShiftName.SelectedValue);
         int?   WorkerID = new int?(0);
         string Name     = "";
         if ((int)proceduresAdapter.GetWorker(this.WorkerCode.Text, ref WorkerID, ref Name) == 1)
         {
             this.FailureText.Text = "Nu s-a gasit un operator cu acest cod!";
         }
         else
         {
             this.FailureText.Text = "";
             this.WorkerCode.Text  = Name;
             if (this.Session["UserID"] == null)
             {
                 this.Response.Redirect("Login");
             }
             else
             {
                 int num2 = (int)this.Session["UserID"];
                 if ((int)proceduresAdapter.StartProductionOrder(new long?(num1), new int?(int32), WorkerID, new int?(num2)) == 1)
                 {
                     this.FailureText.Text = "Comanda de productie nu a fost pornita!";
                 }
                 else
                 {
                     this.SuccessText.Text = "Comanda de productie a fost pornita cu succes";
                     this.Start.Visible    = false;
                 }
             }
         }
     }
 }
Exemple #6
0
        protected void Save_Click(object sender, EventArgs e)
        {
            if (this.Session["ItemCode"] == null)
            {
                base.Response.Redirect("Delivery1");
                return;
            }
            ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
            string            str  = this.Session["ItemCode"].ToString();
            double            num  = Convert.ToDouble(this.DocBatchQty.Text);
            double            num1 = Convert.ToDouble(this.WeighedQty.Text);

            if (Math.Abs(100 - num1 / num * 100) <= 5)
            {
                if ((int)proceduresAdapter.DeliverSaleOrderLine(str, new double?(num1), this.Session["BatchView"]) == 1)
                {
                    this.FailureText.Text = "Cantitatea nu a fost adaugata in livrare!";
                    return;
                }
                this.SuccessText.Text = "Cantitate adaugata cu succes";
                this.Save.Visible     = false;
                return;
            }
            if (this.Session["ConfirmOverflowQty"] == null)
            {
                this.Session["ConfirmOverflowQty"] = true;
                this.FailureText.Text = "Cantitatea nu se incadreaza in marja de 5% stabilita!";
                return;
            }
            if (this.Session["ConfirmOverflowQty"] == null)
            {
                return;
            }
            if ((int)proceduresAdapter.DeliverSaleOrderLine(str, new double?(num1), this.Session["BatchView"]) == 1)
            {
                this.FailureText.Text = "Cantitatea nu a fost adaugata in livrare!";
                return;
            }
            this.Session["ConfirmOverflowQty"] = null;
            this.SuccessText.Text = "Cantitate adaugata cu succes";
            this.Save.Visible     = false;
        }
Exemple #7
0
        protected void AddBatch_Click(object sender, EventArgs e)
        {
            if (this.Session["ItemCode"] == null)
            {
                base.Response.Redirect("Delivery1");
                return;
            }
            ProceduresAdapter proceduresAdapter = new ProceduresAdapter();

            WizLogisticsDataSet.BatchLinesDataTable batchLinesDataTable = (this.Session["BatchView"] == null ? new WizLogisticsDataSet.BatchLinesDataTable() : (WizLogisticsDataSet.BatchLinesDataTable) this.Session["BatchView"]);
            if (batchLinesDataTable.Any <WizLogisticsDataSet.BatchLinesRow>((WizLogisticsDataSet.BatchLinesRow row) => row.BatchNo == this.BatchNo.Text))
            {
                return;
            }
            string str           = this.Session["ItemCode"].ToString();
            long?  nullable      = new long?((long)0);
            double?nullable1     = new double?(0);
            int    saleOrderLine = (int)proceduresAdapter.GetSaleOrderLine(str, this.BatchNo.Text, (long)this.Session["SaleOrderId"], ref nullable, ref nullable1);

            if (saleOrderLine == 1)
            {
                this.FailureText.Text = "Nu exista nici un lot definit cu acest cod! ";
                return;
            }
            if (saleOrderLine == 2)
            {
                this.FailureText.Text = "Acest lot a fost deja livrat/scanat!";
                return;
            }
            batchLinesDataTable.AddBatchLinesRow(nullable.Value, this.BatchNo.Text, (double)nullable1.Value);
            this.Session["BatchView"] = batchLinesDataTable;
            this.BatchView.DataSource = batchLinesDataTable;
            this.BatchView.DataBind();
            this.BatchNo.Text = "";
            this.BatchNo.Focus();
            TextBox docBatchQty = this.DocBatchQty;
            double  num         = batchLinesDataTable.Sum <WizLogisticsDataSet.BatchLinesRow>((WizLogisticsDataSet.BatchLinesRow row) => row.Quantity);

            docBatchQty.Text = num.ToString();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack)
     {
         return;
     }
     if (this.Session["ProductionOrderId"] != null && this.Session["ItemCode"] != null && (this.Session["ActionName"] != null && this.Session["WorkCenterName"] != null) && this.Session["ProcessQty"] != null)
     {
         ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
         long     num               = (long)this.Session["ProductionOrderId"];
         string   str1              = "";
         string   str2              = "";
         DateTime?nullable          = new DateTime?(DateTime.Now);
         long?    ProductionOrderID = new long?(num);
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string ShiftName = @str1;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string WorkerName = @str2;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         DateTime?CreatedDate = @nullable;
         int      productionOrderStartInfo = (int)proceduresAdapter.GetProductionOrderStartInfo(ProductionOrderID, ref ShiftName, ref WorkerName, ref CreatedDate);
         this.ItemCode.Text       = (string)this.Session["ItemCode"];
         this.ActionName.Text     = (string)this.Session["ActionName"];
         this.WorkCenterName.Text = (string)this.Session["WorkCenterName"];
         this.ProcessQty.Text     = this.Session["ProcessQty"].ToString();
         this.WorkerName.Text     = WorkerName;
         this.ShiftName.Text      = ShiftName;
         this.CreatedDate.Text    = nullable.Value.ToString("dd/MM/yyyy hh:mm");
     }
     else
     {
         this.Response.Redirect("ProdOrder1");
     }
 }
        protected void Stop_Click(object sender, EventArgs e)
        {
            string text;
            double?nullable;
            string str;

            if (!base.IsValid)
            {
                this.FailureText.Text = "";
                return;
            }
            if (this.Session["ProductionOrderId"] == null)
            {
                base.Response.Redirect("ProdOrder1");
                return;
            }
            if (this.Stop.Text != "Stop")
            {
                this.Session["ProductionOrderFinishedQty"] = this.FinishedQty.Text;
                base.Response.Redirect("Consumption");
                return;
            }
            ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
            long   item = (long)this.Session["ProductionOrderId"];
            byte   num  = Convert.ToByte(this.MeasureUnit.SelectedValue);
            double num1 = Convert.ToDouble(this.FinishedQty.Text);

            if (this.Remarks.Text.Length <= 0)
            {
                text = null;
            }
            else
            {
                text = this.Remarks.Text;
            }
            string str1 = text;

            if (this.StoppedQty.Text.Length <= 0)
            {
                nullable = null;
            }
            else
            {
                nullable = new double?(Convert.ToDouble(this.StoppedQty.Text));
            }
            double?nullable1 = nullable;

            if (this.StoppedRemarks.Text.Length <= 0)
            {
                str = null;
            }
            else
            {
                str = this.StoppedRemarks.Text;
            }
            if ((int)proceduresAdapter.StopProductionOrder(new long?(item), new byte?(num), new double?(num1), str1, nullable1, str, this.Session["RejectedView"]) == 1)
            {
                this.FailureText.Text = "Comanda de productie nu a fost oprita!";
                return;
            }
            this.FailureText.Text = "";
            this.SuccessText.Text = "Comanda de productie a fost oprita cu succes";
            if (this.MeasureUnit.SelectedValue != "2")
            {
                return;
            }
            this.Stop.Text = "Raportare consum?";
        }
Exemple #10
0
 protected void Next_Click(object sender, EventArgs e)
 {
     if (!this.IsValid)
     {
         this.FailureText.Text = "";
     }
     else if (this.Session["UserID"] == null)
     {
         this.Response.Redirect("Login");
     }
     else
     {
         ProceduresAdapter proceduresAdapter = new ProceduresAdapter();
         long?  nullable1 = new long?(0L);
         string str1      = "";
         string str2      = "";
         string str3      = "";
         double?nullable2 = new double?(0.0);
         double?nullable3 = new double?(0.0);
         bool?  nullable4 = new bool?(false);
         string text1     = this.ProdOrderCode.Text;
         string text2     = this.ActionCode.Text;
         string text3     = this.WorkCenterCode.Text;
         int?   UserID    = new int?((int)this.Session["UserID"]);
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         long?ProductionOrderID = @nullable1;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string ItemCode = @str1;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string ActionName = @str2;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         string WorkCenterName = @str3;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         double?ProcessQty = @nullable2;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         double?ConvertedProcessQty = @nullable3;
         // ISSUE: explicit reference operation
         // ISSUE: variable of a reference type
         bool?Started = @nullable4;
         if ((int)proceduresAdapter.GetProductionOrder(text1, text2, text3, UserID, ref ProductionOrderID, ref ItemCode, ref ActionName, ref WorkCenterName, ref ProcessQty, ref ConvertedProcessQty, ref Started) == 1)
         {
             this.FailureText.Text = "Nu s-a gasit o comanda de productie cu acesti parametrii!";
         }
         else
         {
             this.FailureText.Text               = "";
             this.Session["ProductionOrderId"]   = (object)ProductionOrderID;
             this.Session["ProductionOrderCode"] = (object)this.ProdOrderCode.Text;
             this.Session["ItemCode"]            = (object)ItemCode;
             this.Session["ActionName"]          = (object)ActionName;
             this.Session["WorkCenterName"]      = (object)WorkCenterName;
             this.Session["ProcessQty"]          = (object)ProcessQty;
             this.Session["ConvertedProcessQty"] = (object)ConvertedProcessQty;
             if (Started.Value)
             {
                 this.Response.Redirect("ProdOrder3");
             }
             else
             {
                 this.Response.Redirect("ProdOrder2");
             }
         }
     }
 }