Esempio n. 1
0
        public void Addsku_Clicks(object sender, RoutedEventArgs e)
        {
            ProductionBLL productionBLL = new ProductionBLL();

            if (productionBLL.AddOrderProdutioncustom(this.GetData()) > 0)
            {
                this.ClearForm();
                MessageBox.Show("Add Order Production Custom successfully added !");
                this.newproduct.LoadDataSku();
            }
            else
            {
                MessageBox.Show("Add Order Production Custom failed to add !");
            }
            this.Close();
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string code = Master.TextBoxCode.Text.Trim();

            Master.TextBoxCode.Text = "";

            if (code.Length == 0)
            {
                return;
            }


            if (rdbProductCodeIn.Checked)
            {
                if (BarcodeBLL.IsValidProductCode(code))
                {
                    ProductCodeInList = productionBLL.AddProductCodeIn4Divide(BarcodeBLL.ParseProductCode(code));
                    DataListProductIn.DataBind();

                    GridViewVolume.DataSource = ProductionBLL.GetDivideList(code).Select(r => new
                    {
                        Division = r,
                        Volume   = "",
                    });
                    GridViewVolume.DataBind();
                }
            }
            else if (rdbDINIn.Checked)
            {
                if (BarcodeBLL.IsValidDINCode(code))
                {
                    DINInList = productionBLL.AddDIN4Divide(BarcodeBLL.ParseDIN(code));
                    DataListDINIn.DataBind();
                }
            }
        }
Esempio n. 3
0
        private void SaveProduction_Click(object sender, RoutedEventArgs e)
        {
            if (txtProductionNumber.Text == "")
            {
                MessageBox.Show("please fill in the blank fields", ("Form Validation"), MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            ProductionBLL productionBLL = new ProductionBLL();
            ProductionBLL ProductionBLL = new ProductionBLL();
            production    production    = new production();

            production.IdKodeTransaksi = 28;
            if (this.dokumenSelected != null)
            {
                production.IdDocumentReference = this.dokumenSelected.Id;
                production.DokumenReference    = this.dokumenSelected.NoReferensiDokumen;
            }
            production.Tanggal = DateTime.Parse(tanggal.Text);
            if (this.lokasiSelected != null)
            {
                production.IdLokasi = this.lokasiSelected.Id;
                production.Location = this.lokasiSelected.NamaTempatLokasi;
            }
            if (this.kontakSelected != null)
            {
                production.IdKontak    = this.kontakSelected.Id;
                production.NamaPetugas = this.kontakSelected.NamaA;
            }
            production.Note             = txtNote.Text;
            production.ProductionNumber = double.Parse(txtProductionNumber.Text);
            production.TotalDebitAkunPersediaanProduk  = double.Parse(txtTotal.Text);
            production.TotalKreditAkunPersediaanProduk = double.Parse(txtTotalinput.Text);
            if (this.dataDepartemenSelected != null)
            {
                production.IdDepartmen = this.dataDepartemenSelected.Id;
            }
            if (this.dataProyekSelected != null)
            {
                production.IdProyek = this.dataProyekSelected.Id;
            }
            if (ProductionBLL.AddProduction(production) > 0)
            {
                //  this.ClearForm();
                MessageBox.Show("Productions successfully added !");
            }
            else
            {
                MessageBox.Show("Productions failed to add !");
            }
            if (DGSKUProduction.Items.Count > 0)
            {
                foreach (var item in DGSKUProduction.Items)
                {
                    if (item is ListOrderProduction)
                    {
                        ListOrderProduction oNewData1 = (ListOrderProduction)item;
                        if (this.lokasiSelected != null)
                        {
                            oNewData1.IdLokasi   = this.lokasiSelected.Id;
                            oNewData1.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
                        }
                        oNewData1.Tanggal       = DateTime.Parse(tanggal.Text);
                        oNewData1.CheckboxAktif = false;
                        oNewData1.IdTransaksi   = production.Id;
                        if (this.dataDepartemenSelected != null)
                        {
                            oNewData1.IdDepartemen = this.dataDepartemenSelected.Id;
                        }
                        if (this.dataProyekSelected != null)
                        {
                            oNewData1.IdProyek = this.dataProyekSelected.Id;
                        }
                        if (productionBLL.EditProductioninput(oNewData1, production) == true)
                        {
                        }
                    }
                }
            }
            if (DGSKUFinishedProduction.Items.Count > 0)
            {
                foreach (var item in DGSKUFinishedProduction.Items)
                {
                    if (item is OrderFinishedproduk)
                    {
                        OrderFinishedproduk oNewData1 = (OrderFinishedproduk)item;
                        if (this.lokasiSelected != null)
                        {
                            oNewData1.IdLokasi   = this.lokasiSelected.Id;
                            oNewData1.NamaLokasi = this.lokasiSelected.NamaTempatLokasi;
                        }
                        oNewData1.Tanggal       = DateTime.Parse(tanggal.Text);
                        oNewData1.CheckboxAktif = false;
                        if (this.dataDepartemenSelected != null)
                        {
                            oNewData1.IdDepartemen = this.dataDepartemenSelected.Id;
                        }
                        if (this.dataProyekSelected != null)
                        {
                            oNewData1.IdProyek = this.dataProyekSelected.Id;
                        }
                        if (productionBLL.EditFinishedproduk(oNewData1, production) == true)
                        {
                        }
                    }
                }
                Production v = new Production();
                Switcher.SwitchNewProduction(v);
            }
        }