Exemplo n.º 1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                if (cmboReportOptions.SelectedValue != null)
                {
                    repOps.DO_OptionSelected = Int32.Parse(cmboReportOptions.SelectedValue.ToString());
                }
                else
                {
                    repOps.DO_OptionSelected = 0;
                }


                if (chkException.Checked)
                {
                    repOps.ExceptionOnly        = true;
                    repOps.Percentage_Exception = Convert.ToInt32(txtPercentage.Text);
                }

                repOps.fromDate = DateTime.Parse(dtpFromDate.Value.ToShortDateString());
                repOps.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                frmDyeViewReport vRep = new frmDyeViewReport(24, repOps);
                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
                repOps = new DyeReportOptions();

                chkException.Checked = false;
            }
        }
Exemplo n.º 2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null)
            {
                DateTime FDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                DateTime TDate = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                TDate = TDate.AddHours(23);

                DyeReportOptions repOps = new DyeReportOptions();
                repOps.fromDate = FDate;
                repOps.toDate   = TDate;

                if (chkProdResults.Checked)
                {
                    repOps.ProductionResults = true;
                }

                frmDyeViewReport vRep = new frmDyeViewReport(43, repOps);
                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Exemplo n.º 3
0
        private void frmStockTake_Load(object sender, EventArgs e)
        {
            formloaded = false;
            repOps     = new DyeReportOptions();

            using (var context = new TTI2Entities())
            {
                var Deptment = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Deptment != null)
                {
                    cmboStore.DataSource    = context.TLADM_WhseStore.Where(x => x.WhStore_DepartmentFK == Deptment.Dep_Id).ToList();
                    cmboStore.ValueMember   = "WhStore_Id";
                    cmboStore.DisplayMember = "WhStore_Description";
                    cmboStore.SelectedValue = -1;
                }

                cmboStockType.DataSource    = context.TLADM_StockTypes.Where(x => x.ST_ShortCode.Contains("DC")).ToList();
                cmboStockType.ValueMember   = "ST_Id";
                cmboStockType.DisplayMember = "ST_Description";
                cmboStockType.SelectedValue = -1;

                cmboStockTake.DataSource    = context.TLADM_StockTakeFreq.ToList();
                cmboStockTake.ValueMember   = "STF_Pk";
                cmboStockTake.DisplayMember = "STF_Description";
                cmboStockTake.SelectedValue = -1;
            }
            formloaded = true;
        }
Exemplo n.º 4
0
        private void frmReportOpts4_Load(object sender, EventArgs e)
        {
            repOps     = new DyeReportOptions();
            formloaded = false;
            using (var context = new TTI2Entities())
            {
                try
                {
                    cmboBatches.DataSource    = context.TLDYE_DyeTransactions.Where(x => x.TLDYET_SequenceNo != 0).ToList();
                    cmboBatches.DisplayMember = "TLDYET_BatchNo";
                    cmboBatches.ValueMember   = "TLDYET_Pk";
                    cmboBatches.SelectedValue = -1;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                var Dept = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Dept != null)
                {
                    cmboDyeMachine.DataSource    = context.TLADM_MachineDefinitions.Where(x => x.MD_Department_FK == Dept.Dep_Id).ToList();
                    cmboDyeMachine.ValueMember   = "MD_Pk";
                    cmboDyeMachine.DisplayMember = "MD_Description";
                    cmboDyeMachine.SelectedValue = -1;
                }

                cmboFaultCode.DataSource    = context.TLADM_DyeQDCodes.OrderBy(x => x.QDF_Description).ToList();
                cmboFaultCode.ValueMember   = "QDF_Pk";
                cmboFaultCode.DisplayMember = "QDF_Description";
                cmboFaultCode.SelectedValue = -1;

                cmboRemedy.DataSource    = context.TLADM_DyeRemendyCodes.OrderBy(x => x.QRC_Description).ToList();
                cmboRemedy.ValueMember   = "QRC_Pk";
                cmboRemedy.DisplayMember = "QRC_Description";
                cmboRemedy.SelectedValue = -1;

                cmboQuality.DataSource    = context.TLADM_Griege.OrderBy(x => x.TLGreige_Description).ToList();
                cmboQuality.ValueMember   = "TLGreige_Id";
                cmboQuality.DisplayMember = "TLGreige_Description";
                cmboQuality.SelectedValue = -1;

                cmboColour.DataSource    = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                cmboColour.DisplayMember = "Col_Display";
                cmboColour.ValueMember   = "Col_Id";
                cmboColour.SelectedValue = -1;

                var reportOptions = new BindingList <KeyValuePair <string, string> >();
                reportOptions.Add(new KeyValuePair <string, string>("0", "Batch Number"));
                reportOptions.Add(new KeyValuePair <string, string>("1", "Dye Machines"));
                reportOptions.Add(new KeyValuePair <string, string>("2", "Fault Code"));
                reportOptions.Add(new KeyValuePair <string, string>("3", "Remedy Code"));
                reportOptions.Add(new KeyValuePair <string, string>("4", "Quality"));
                reportOptions.Add(new KeyValuePair <string, string>("5", "Colour"));
                cmboReportOptions.DataSource    = reportOptions;
                cmboReportOptions.ValueMember   = "Key";
                cmboReportOptions.DisplayMember = "Value";
                cmboReportOptions.SelectedIndex = -1;
            }
            formloaded = true;
        }
Exemplo n.º 5
0
        private void frmNCRDetails_Load(object sender, EventArgs e)
        {
            repOps = new DyeReportOptions();

            formloaded = false;
            using (var context = new TTI2Entities())
            {
                cmboCause.DataSource    = context.TLADM_DyeQDCodes.OrderBy(x => x.QDF_Code).ToList();
                cmboCause.DisplayMember = "QDF_Description";
                cmboCause.ValueMember   = "QDF_Pk";
                cmboCause.SelectedValue = -1;

                cmboRemedy.DataSource    = context.TLADM_DyeRemendyCodes.OrderBy(x => x.QRC_Code).ToList();
                cmboRemedy.DisplayMember = "QRC_Description";
                cmboRemedy.ValueMember   = "QRC_Pk";
                cmboRemedy.SelectedValue = -1;

                cmboColour.DataSource    = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                cmboColour.ValueMember   = "Col_Id";
                cmboColour.DisplayMember = "Col_Display";
                cmboColour.SelectedValue = -1;

                var Dept = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Dept != null)
                {
                    cmboDyeMachine.DataSource    = context.TLADM_MachineDefinitions.Where(x => x.MD_Department_FK == Dept.Dep_Id).OrderBy(x => x.MD_Description).ToList();
                    cmboDyeMachine.ValueMember   = "MD_Pk";
                    cmboDyeMachine.DisplayMember = "MD_Description";
                    cmboDyeMachine.SelectedValue = -1;

                    cmboDyeOperator.DataSource    = context.TLADM_MachineOperators.Where(x => x.MachOp_Department_FK == Dept.Dep_Id).ToList();
                    cmboDyeOperator.ValueMember   = "MachOp_Pk";
                    cmboDyeOperator.DisplayMember = "MachOp_Description";
                    cmboDyeOperator.SelectedValue = -1;
                }

                cmboQuality.DataSource    = context.TLADM_Griege.OrderBy(x => x.TLGreige_Description).ToList();
                cmboQuality.ValueMember   = "TLGreige_Id";
                cmboQuality.DisplayMember = "TLGreige_Description";
                cmboQuality.SelectedValue = -1;
            }

            var reportOptions = new BindingList <KeyValuePair <string, string> >();

            reportOptions.Add(new KeyValuePair <string, string>("0", "NCR number"));
            reportOptions.Add(new KeyValuePair <string, string>("1", "Batch Number"));
            reportOptions.Add(new KeyValuePair <string, string>("2", "Quality"));
            reportOptions.Add(new KeyValuePair <string, string>("3", "Colour"));
            reportOptions.Add(new KeyValuePair <string, string>("4", "Dye machine"));
            reportOptions.Add(new KeyValuePair <string, string>("5", "Dye operator"));
            reportOptions.Add(new KeyValuePair <string, string>("6", "Cause when not complying"));
            reportOptions.Add(new KeyValuePair <string, string>("7", "Remedy when not compliant"));
            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;

            formloaded = true;
        }
Exemplo n.º 6
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                DyeReportOptions repOptions = new DyeReportOptions();
                repOptions.fromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                repOptions.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                repOptions.toDate   = repOptions.toDate.AddHours(23);

                var selected = (TLADM_MachineDefinitions)cmboMachines.SelectedItem;
                if (selected != null)
                {
                    repOptions.DYEMPMachineSelected = selected.MD_Pk;
                }

                if (rbFirstTime.Checked)
                {
                    repOptions.DYEMPProdType = 1;
                }
                else if (rbOwnReprocessing.Checked)
                {
                    repOptions.DYEMPProdType = 2;
                }
                else
                {
                    repOptions.DYEMPProdType = 3;
                }


                if (rbModeSummary.Checked)
                {
                    repOptions.DYEMPReportType = 1;
                }
                else
                {
                    repOptions.DYEMPReportType = 2;
                }

                if (cmboReportOptions.SelectedValue != null)
                {
                    repOptions.DYEMPSortOptions = int.Parse(cmboReportOptions.SelectedValue.ToString());
                }
                else
                {
                    repOptions.DYEMPSortOptions = 1;
                };

                frmDyeViewReport vRep = new frmDyeViewReport(34, repOptions);
                vRep.ShowDialog(this);

                cmboMachines.SelectedIndex      = -1;
                cmboReportOptions.SelectedIndex = -1;
            }
        }
Exemplo n.º 7
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Util             core = new Util();
            DyeReportOptions dro  = new DyeReportOptions();

            //------------------------------------------------------------
            //
            if (rbGarmentsOnly.Checked)
            {
                dro.SelGarments = true;
            }
            else if (rbFabricOnly.Checked)
            {
                dro.SelFabric = true;
            }
            else if (rbBoth.Checked)
            {
                dro.SelBoth = true;
            }

            if (rbAdditionalBoth.Checked)
            {
                dro.DO_Both = true;
            }
            else if (rbOrderOpen.Checked)
            {
                dro.DO_Open = true;
            }
            else if (rbOrderClosed.Checked)
            {
                dro.DO_Closed = true;
            }

            if (cmboReportOptions.SelectedValue != null)
            {
                dro.DO_OptionSelected = int.Parse(cmboReportOptions.SelectedValue.ToString());
                if (dro.DO_OptionSelected == 0)
                {
                    dro.DO_ByOrderNo = true;
                }
            }
            else
            {
                dro.DO_ByOrderNo = true;
            }


            frmDyeViewReport vRep = new frmDyeViewReport(14, dro);
            int h = Screen.PrimaryScreen.WorkingArea.Height;
            int w = Screen.PrimaryScreen.WorkingArea.Width;

            vRep.ClientSize = new Size(w, h);
            vRep.ShowDialog(this);
        }
Exemplo n.º 8
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                DyeReportOptions repOpts = new DyeReportOptions();
                repOpts.fromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                repOpts.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                repOpts.toDate   = repOpts.toDate.AddHours(23);
                frmDyeViewReport vRep = new frmDyeViewReport(36, repOpts);
                vRep.ShowDialog(this);
            }
        }
Exemplo n.º 9
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                if (groupBox2.Visible)
                {
                    repOps.FabricToQ = true;

                    if (radFirstTime.Checked)
                    {
                        repOps.FirstTime = true;
                    }
                    else
                    {
                        repOps.FirstTime = false;
                    }
                }
                else
                {
                    repOps.FirstTime     = false;
                    repOps.FabricToStore = true;

                    if (_RepNumber == 3)
                    {
                        repOps.FabricToStore     = false;
                        repOps.FabricNotFinished = true;
                    }
                }

                if (chkQASummary.Checked)
                {
                    repOps.QASummary = true;
                }


                repOps.fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
                repOps.toDate   = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
                repOps.toDate   = repOps.toDate.AddHours(23.00);

                frmDyeViewReport vRep = new frmDyeViewReport(31, repOps);
                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
                repOps = new DyeReportOptions();
            }
        }
Exemplo n.º 10
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                DyeReportOptions DOpts = new DyeReportOptions();
                DOpts.fromDate = DateTime.Parse(dtpFromDate.Value.ToShortDateString());
                DOpts.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                frmDyeViewReport vRep = new frmDyeViewReport(23, DOpts);
                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Exemplo n.º 11
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                if (repOps.stkWhseSelected == false &&
                    repOps.stkTakeCategorySelected == false &&
                    repOps.stkTypeSelected == false)
                {
                    MessageBox.Show("Please select one option from the drop down box");
                    return;
                }

                frmDyeViewReport vRep = new frmDyeViewReport(25, repOps);
                vRep.ShowDialog(this);
                repOps = new DyeReportOptions();
            }
        }
Exemplo n.º 12
0
        private void frmDyeProductionSel_Load(object sender, EventArgs e)
        {
            core   = new Util();
            repOps = new DyeReportOptions();

            using (var context = new TTI2Entities())
            {
                formloaded = false;
                if (_RepNumber == 1)
                {
                    this.Text = "Fabric Production to Quarantine Store";
                }
                else if (_RepNumber == 2)
                {
                    this.Text         = "Fabric Production to Fabric Store";
                    groupBox2.Visible = false;
                }
                else
                {
                    this.Text         = "Fabric Dyed Not Finished";
                    groupBox2.Visible = false;
                }

                radFirstTime.Checked = true;

                cmboCustomers.DataSource    = context.TLADM_CustomerFile.OrderBy(x => x.Cust_Description).ToList();
                cmboCustomers.ValueMember   = "Cust_Pk";
                cmboCustomers.DisplayMember = "Cust_Description";
                cmboCustomers.SelectedValue = -1;

                var reportOptions = new BindingList <KeyValuePair <int, string> >();
                reportOptions.Add(new KeyValuePair <int, string>(0, "Machine , Shade, Dye Machine "));
                reportOptions.Add(new KeyValuePair <int, string>(1, "Dye Machines, Shade, Colour"));
                reportOptions.Add(new KeyValuePair <int, string>(2, "Dye Machines, Quality , Colour"));
                reportOptions.Add(new KeyValuePair <int, string>(3, "Quality, Colour, Shade"));

                cmboReportOptions.DataSource    = reportOptions;
                cmboReportOptions.ValueMember   = "Key";
                cmboReportOptions.DisplayMember = "Value";
                cmboReportOptions.SelectedIndex = -1;
                formloaded = true;
            }
        }
Exemplo n.º 13
0
        private void ReprocessDetails_Load(object sender, EventArgs e)
        {
            repOps = new DyeReportOptions();

            formloaded = false;
            using (var context = new TTI2Entities())
            {
                cmboCause.DataSource    = context.TLADM_DyeQDCodes.OrderBy(x => x.QDF_Code).ToList();
                cmboCause.DisplayMember = "QDF_Description";
                cmboCause.ValueMember   = "QDF_Pk";
                cmboCause.SelectedValue = -1;

                cmboRemedy.DataSource    = context.TLADM_DyeRemendyCodes.OrderBy(x => x.QRC_Code).ToList();
                cmboRemedy.DisplayMember = "QRC_Description";
                cmboRemedy.ValueMember   = "QRC_Pk";
                cmboRemedy.SelectedValue = -1;

                cmboColour.DataSource    = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                cmboColour.ValueMember   = "Col_Id";
                cmboColour.DisplayMember = "Col_Display";
                cmboColour.SelectedValue = -1;

                var Dept = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Dept != null)
                {
                    cmboDyeMachine.DataSource    = context.TLADM_MachineDefinitions.Where(x => x.MD_Department_FK == Dept.Dep_Id).OrderBy(x => x.MD_Description).ToList();
                    cmboDyeMachine.ValueMember   = "MD_Pk";
                    cmboDyeMachine.DisplayMember = "MD_Description";
                    cmboDyeMachine.SelectedValue = -1;

                    cmboDyeOperator.DataSource    = context.TLADM_MachineOperators.Where(x => x.MachOp_Department_FK == Dept.Dep_Id).ToList();
                    cmboDyeOperator.ValueMember   = "MachOp_Pk";
                    cmboDyeOperator.DisplayMember = "MachOp_Description";
                    cmboDyeOperator.SelectedValue = -1;
                }

                cmboQuality.DataSource    = context.TLADM_Griege.OrderBy(x => x.TLGreige_Description).ToList();
                cmboQuality.ValueMember   = "TLGreige_Id";
                cmboQuality.DisplayMember = "TLGreige_Description";
                cmboQuality.SelectedValue = -1;
            }
        }
Exemplo n.º 14
0
        private void frmDyeingProcessLoss_Load(object sender, EventArgs e)
        {
            repOps     = new DyeReportOptions();
            formloaded = false;
            using (var context = new TTI2Entities())
            {
                cmboBatchNo.DataSource    = context.TLDYE_DyeBatch.OrderBy(x => x.DYEB_BatchNo).ToList();
                cmboBatchNo.DisplayMember = "DYEB_BatchNo";
                cmboBatchNo.ValueMember   = "DYEB_Pk";
                cmboBatchNo.SelectedValue = -1;

                cmboShade.DataSource    = context.TLADM_FabricProduct.OrderBy(x => x.FP_Description).ToList();
                cmboShade.DisplayMember = "FP_Description";
                cmboShade.ValueMember   = "FP_Id";
                cmboShade.SelectedValue = -1;

                cmboColour.DataSource    = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                cmboColour.ValueMember   = "Col_Id";
                cmboColour.DisplayMember = "Col_Display";
                cmboColour.SelectedValue = -1;

                var Department = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Department != null)
                {
                    cmboMachines.DataSource    = context.TLADM_MachineDefinitions.Where(x => x.MD_Department_FK == Department.Dep_Id).OrderBy(x => x.MD_Description).ToList();
                    cmboMachines.ValueMember   = "MD_Pk";
                    cmboMachines.DisplayMember = "MD_Description";
                    cmboMachines.SelectedValue = -1;
                }

                var reportOptions = new BindingList <KeyValuePair <string, string> >();
                reportOptions.Add(new KeyValuePair <string, string>("0", "Machine , Shade, Dye Machine "));
                reportOptions.Add(new KeyValuePair <string, string>("1", "Dye Machines, Shade, Colour"));
                reportOptions.Add(new KeyValuePair <string, string>("2", "Dye Machines, Quality , Colour"));
                reportOptions.Add(new KeyValuePair <string, string>("3", "Quality, Colour, Shade"));
                cmboReportOptions.DataSource    = reportOptions;
                cmboReportOptions.ValueMember   = "Key";
                cmboReportOptions.DisplayMember = "Value";
                cmboReportOptions.SelectedIndex = -1;
            }
            formloaded = true;
        }
Exemplo n.º 15
0
        private void frmFabricSOHSel_Load(object sender, EventArgs e)
        {
            FormLoad = false;
            repOps   = new DyeReportOptions();

            var reportOptions = new BindingList <KeyValuePair <string, string> >();

            reportOptions.Add(new KeyValuePair <string, string>("0", "Customer , Quality , Batch Number"));
            reportOptions.Add(new KeyValuePair <string, string>("1", "Store, Customer, Quality"));
            reportOptions.Add(new KeyValuePair <string, string>("2", "Store, Colour, Quality"));
            reportOptions.Add(new KeyValuePair <string, string>("3", "Quality, Colour, Customer"));
            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;

            rbFabFS.Checked    = true;
            rbStandard.Checked = true;

            FormLoad = true;
        }
Exemplo n.º 16
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && FormLoad)
            {
                if (cmboReportOptions.SelectedValue != null)
                {
                    repOps.DO_OptionSelected = Int32.Parse(cmboReportOptions.SelectedValue.ToString());
                }
                else
                {
                    repOps.DO_OptionSelected = 0;
                }

                if (rbFabFS.Checked)
                {
                    repOps.FabricStore = true;
                }
                if (rbFabQS.Checked)
                {
                    repOps.FabricQSStore = true;
                }
                if (rbFabRS.Checked)
                {
                    repOps.FabricRejectStore = true;
                }
                if (rbStandard.Checked)
                {
                    repOps.FabricType = true;
                }

                repOps.ShowIndvidualNo = false;

                frmDyeViewReport vRep = new frmDyeViewReport(22, repOps);
                vRep.ShowDialog(this);

                repOps = new DyeReportOptions();
            }
        }
Exemplo n.º 17
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                DyeReportOptions RepOptions = new DyeReportOptions();

                RepOptions.fromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                RepOptions.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                RepOptions.toDate   = RepOptions.toDate.AddHours(23);

                var selected = (TLADM_MachineDefinitions)cmboMachines.SelectedItem;
                if (selected != null)
                {
                    RepOptions.ResEficMachine = selected.MD_Pk;
                }

                if (rbDyeFirstTime.Checked)
                {
                    RepOptions.ResEfficTrans = true;
                }

                var FTSelected = (TLADM_FabricProduct)cmboFabricType.SelectedItem;
                if (FTSelected != null)
                {
                    RepOptions.ResFabType = FTSelected.FP_Id;
                }

                frmDyeViewReport ViewRep = new frmDyeViewReport(35, RepOptions);
                ViewRep.ShowDialog(this);
                formloaded = false;
                cmboFabricType.SelectedIndex = -1;
                cmboMachines.SelectedIndex   = -1;
                formloaded = true;
            }
        }
Exemplo n.º 18
0
        private void frmDyeProdSel_Load(object sender, EventArgs e)
        {
            formloaded = false;
            repOpts    = new DyeReportOptions();
            using (var context = new TTI2Entities())
            {
                cmboCustomers.DataSource    = context.TLADM_CustomerFile.OrderBy(x => x.Cust_Description).ToList();
                cmboCustomers.DisplayMember = "Cust_Description";
                cmboCustomers.ValueMember   = "Cust_Pk";
                cmboCustomers.SelectedValue = -1;
            }

            var reportOptions = new BindingList <KeyValuePair <string, string> >();

            reportOptions.Add(new KeyValuePair <string, string>("0", "Machines , Shade, Quality "));
            reportOptions.Add(new KeyValuePair <string, string>("1", "Machines, Shade, Colour"));
            reportOptions.Add(new KeyValuePair <string, string>("2", "Machines, Quality , Colour"));
            reportOptions.Add(new KeyValuePair <string, string>("3", "Quality, Colour, Shade"));
            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;
            formloaded = true;
        }
Exemplo n.º 19
0
        private void button1_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                var WhseIssue = (TLADM_WhseStore)cmboIssueDepartment.SelectedItem;
                if (WhseIssue == null)
                {
                    MessageBox.Show("Please select a Chemical Store from the list provided");
                    return;
                }

                var WhseReceiving = (TLADM_WhseStore)cmboReceivingDepartment.SelectedItem;
                if (WhseReceiving == null)
                {
                    MessageBox.Show("Please select a Dye Kitchen from the list provided");
                    return;
                }

                using (var context = new TTI2Entities())
                {
                    var LNU = context.TLADM_LastNumberUsed.Find(3);
                    LNU.col12 += 1;

                    foreach (DataGridViewRow row in dataGridView1.Rows)
                    {
                        if (!(bool)row.Cells[1].Value)
                        {
                            continue;
                        }

                        var index = (int)row.Cells[0].Value;

                        //---------------------------------------
                        // 1st decision
                        //-------------------------------------------------------
                        TLDYE_ConsumableSOH newSOH = new TLDYE_ConsumableSOH();

                        newSOH = context.TLDYE_ConsumableSOH.Where(x => x.DYCSH_WhseStore_FK == WhseReceiving.WhStore_Id && x.DYCSH_Consumable_FK == index).FirstOrDefault();
                        if (newSOH == null)
                        {
                            newSOH = new TLDYE_ConsumableSOH();
                            newSOH.DYCSH_StockOnHand   = (decimal)row.Cells[4].Value;
                            newSOH.DYCSH_TransNumber   = -1 + LNU.col12;
                            newSOH.DYCSH_Consumable_FK = (int)row.Cells[5].Value;
                            newSOH.DYCSH_WhseStore_FK  = WhseReceiving.WhStore_Id;
                            newSOH.DYCSH_DyeKitchen    = WhseReceiving.WhStore_DyeKitchen;

                            context.TLDYE_ConsumableSOH.Add(newSOH);
                        }
                        else
                        {
                            newSOH.DYCSH_StockOnHand += (decimal)row.Cells[4].Value;
                        }

                        TLDYE_ConsumableSOH oldSOH = new TLDYE_ConsumableSOH();
                        oldSOH = context.TLDYE_ConsumableSOH.Find(index);
                        if (oldSOH != null)
                        {
                            oldSOH.DYCSH_StockOnHand -= (Decimal)row.Cells[4].Value;
                        }
                    }
                    try
                    {
                        context.SaveChanges();
                        MessageBox.Show("Data successfully saved to database");

                        DyeReportOptions opts = new DyeReportOptions();
                        opts.fromDate = DateTime.Now;
                        opts.LNU      = -1 + LNU.col12;
                        opts.toStore  = WhseReceiving.WhStore_Id;

                        TLADM_WhseStore FromWhse = context.TLADM_WhseStore.Where(x => x.WhStore_Code.Contains("CS")).FirstOrDefault();
                        opts.fromStore = FromWhse.WhStore_Id;

                        frmDyeViewReport vRep = new frmDyeViewReport(30, opts);
                        int h = Screen.PrimaryScreen.WorkingArea.Height;
                        int w = Screen.PrimaryScreen.WorkingArea.Width;
                        vRep.ClientSize = new Size(w, h);
                        vRep.ShowDialog(this);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
Exemplo n.º 20
0
        private void frmShadeAfterDyeing_Load(object sender, EventArgs e)
        {
            repOps     = new DyeReportOptions();
            QueryParms = new DyeQueryParameters();

            formloaded = false;
            using (var context = new TTI2Entities())
            {
                var DyeQDCodes = context.TLADM_DyeQDCodes.OrderBy(x => x.QDF_Code).ToList();
                foreach (var DyeCode in DyeQDCodes)
                {
                    cmboCause.Items.Add(new DyeHouse.CheckComboBoxItem(DyeCode.QDF_Pk, DyeCode.QDF_Description, false));
                }

                var Remedies = context.TLADM_DyeRemendyCodes.OrderBy(x => x.QRC_Code).ToList();
                foreach (var Remedy in Remedies)
                {
                    cmboRemedy.Items.Add(new DyeHouse.CheckComboBoxItem(Remedy.QRC_Pk, Remedy.QRC_Description, false));
                }

                var Colours = context.TLADM_Colours.OrderBy(x => x.Col_Display).ToList();
                foreach (var Colour in Colours)
                {
                    cmboColour.Items.Add(new DyeHouse.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                }

                var Dept = context.TLADM_Departments.Where(x => x.Dep_ShortCode.Contains("DYE")).FirstOrDefault();
                if (Dept != null)
                {
                    var MachineDefinitions = context.TLADM_MachineDefinitions.Where(x => x.MD_Department_FK == Dept.Dep_Id).OrderBy(x => x.MD_Description).ToList();
                    foreach (var MachineDefinition in MachineDefinitions)
                    {
                        cmboDyeMachine.Items.Add(new DyeHouse.CheckComboBoxItem(MachineDefinition.MD_Pk, MachineDefinition.MD_AlternateDesc, false));
                    }


                    var Operators = context.TLADM_MachineOperators.Where(x => x.MachOp_Department_FK == Dept.Dep_Id && !x.MachOp_Discontinued).ToList();
                    foreach (var Operator in Operators)
                    {
                        cmboDyeOperator.Items.Add(new DyeHouse.CheckComboBoxItem(Operator.MachOp_Pk, Operator.MachOp_Description, false));
                    }
                }

                var Qualities = context.TLADM_Griege.OrderBy(x => x.TLGreige_Description).ToList();
                foreach (var Quality in Qualities)
                {
                    cmboQuality.Items.Add(new DyeHouse.CheckComboBoxItem(Quality.TLGreige_Id, Quality.TLGreige_Description, false));
                }
            }

            var reportOptions = new BindingList <KeyValuePair <string, string> >();

            reportOptions.Add(new KeyValuePair <string, string>("1", "Quality"));
            reportOptions.Add(new KeyValuePair <string, string>("2", "Dye Machine"));
            reportOptions.Add(new KeyValuePair <string, string>("3", "Dye Operator"));
            reportOptions.Add(new KeyValuePair <string, string>("4", "Colour"));
            if (_Stage == 3)
            {
                reportOptions.Add(new KeyValuePair <string, string>("5", "Remedy"));
                reportOptions.Add(new KeyValuePair <string, string>("6", "Fault"));
                reportOptions.Add(new KeyValuePair <string, string>("7", "Result"));
            }
            cmboReportOptions.DataSource    = reportOptions;
            cmboReportOptions.ValueMember   = "Key";
            cmboReportOptions.DisplayMember = "Value";
            cmboReportOptions.SelectedIndex = -1;

            formloaded = true;
        }
Exemplo n.º 21
0
        private void button1_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                if (!rbAllCustomers.Checked)
                {
                    var selected = (TLADM_CustomerFile)cmboCustomer.SelectedItem;
                    if (selected == null)
                    {
                        MessageBox.Show("Please select a customer record");
                        return;
                    }
                }



                DyeReportOptions opts = new DyeReportOptions();
                opts.fromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                opts.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                opts.toDate   = opts.toDate.AddHours(23.00);

                if (rbAllCustomers.Checked)
                {
                    opts.AllCustomersSelected = true;
                }
                else
                {
                    var select = (TLADM_CustomerFile)cmboCustomer.SelectedItem;
                    opts.CustomerNumberSelected = select.Cust_Pk;
                    opts.CustomerSelected       = true;
                }

                if (rbDyeBatchPending.Checked)
                {
                    opts.DBPending = true;
                }
                else
                {
                    opts.DBWIP = true;
                }

                if (rbBatchNumber.Checked)
                {
                    opts.SortByBatchNumber = true;
                }
                if (rbByQuality.Checked)
                {
                    opts.SortByQuality = true;
                }
                if (rbSortByDate.Checked)
                {
                    opts.SortByDate = true;
                }

                frmDyeViewReport vRep = new frmDyeViewReport(12, opts);
                vRep.ShowDialog(this);

                rbAllCustomers.Checked = false;
            }
        }
Exemplo n.º 22
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                DyeReportOptions repOps = new DyeReportOptions();
                if (!rbAllCustomers.Checked)
                {
                    var selected = (TLADM_CustomerFile)cmboCustomers.SelectedItem;
                    if (selected == null)
                    {
                        MessageBox.Show("Please select a customer from the drop down box");
                        return;
                    }
                    else
                    {
                        repOps.CustomerSelected       = true;
                        repOps.CustomerNumberSelected = ((TLADM_CustomerFile)cmboCustomers.SelectedItem).Cust_Pk;
                    }
                }
                else
                {
                    repOps.AllCustomersSelected = true;
                }

                //---------------------------------------------------------
                if (rbWIPDBPending.Checked)
                {
                    repOps.DBPending = true;
                }
                if (rbWIPDyeing.Checked)
                {
                    repOps.DBWIP = true;
                }
                if (rbAll.Checked)
                {
                    repOps.DBAll = true;
                }
                if (rbReprocess.Checked)
                {
                    repOps.DBReprocess = true;
                }
                //------------------------------------------------------------

                if (cmboReportOptions.SelectedValue != null)
                {
                    repOps.DO_OptionSelected = Int32.Parse(cmboReportOptions.SelectedValue.ToString());
                }
                else
                {
                    repOps.DO_OptionSelected = 0;
                }


                frmDyeViewReport vRep = new frmDyeViewReport(19, repOps);
                vRep.ShowDialog(this);
                rbAllCustomers.Checked      = false;
                cmboCustomers.SelectedIndex = -1;
            }
        }