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

            if (oBtn != null && formloaded)
            {
                CMTReportOptions repOpts = new CMTReportOptions();

                try
                {
                    repOpts.fromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                    repOpts.toDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                    repOpts.toDate   = repOpts.toDate.AddHours(23);

                    frmCMTViewRep vRep = new frmCMTViewRep(16, QueryParms, repOpts);
                    int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                    int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);
                }
                finally
                {
                    cmboMeasurement.Items.Clear();
                    cmboDepartment.Items.Clear();
                    cmboSize.Items.Clear();
                    cmboStyle.Items.Clear();
                    frmMPSel_Load(this, null);
                }

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

            if (oBtn != null && FormLoaded)
            {
                CMTReportOptions repOptions = new CMTReportOptions();

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

                try
                {
                    frmCMTViewRep vRep = new frmCMTViewRep(15, QueryParms, repOptions);
                    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);
                }
                finally
                {
                    cmboLine.Items.Clear();
                    cmboCMT.Items.Clear();
                    frmCMTWip_Load(this, null);
                }
            }
        }
Ejemplo n.º 3
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (!_Export)
            {
                var Depts = (TLADM_Departments)cmboDepartments.SelectedItem;
                if (Depts == null)
                {
                    using (DialogCenteringService svces = new DialogCenteringService(this))
                    {
                        MessageBox.Show("Please select a CMT to report on");
                        return;
                    }

                }
                CMTReportOptions repOps = new CMTReportOptions();
                repOps.SLFCmt = Depts.Dep_Id;

                DateTime dt = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                repOps.toDate = dt.AddHours(23);
                // repOps.toDate = (DateTimedtpToDate.Value;

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

            if (oBtn != null && FormLoaded)
            {
                if (QueryParms.Depts.Count == 0)
                {
                    MessageBox.Show("Please select a least one CMT to analyse");
                    return;
                }


                repOpts = new CMTReportOptions();

                frmCMTViewRep vRep = new frmCMTViewRep(19, QueryParms, repOpts);

                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboColours.Items.Clear();
                cmboSizes.Items.Clear();
                cmboStyles.Items.Clear();


                frmCostAnalysisValues_Load(this, null);
            }
        }
Ejemplo n.º 5
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                RepOpts.fromDate    = Convert.ToDateTime(dtpfromDate.Value.ToShortDateString());
                RepOpts.toDate      = Convert.ToDateTime(dtptoDate.Value.ToShortDateString());
                RepOpts.toDate      = RepOpts.toDate.AddHours(23);
                RepOpts.ReportTitle = "Line Feeder Quality CheckList";
                frmCMTViewRep vRep = new frmCMTViewRep(17, RepOpts);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                RepOpts    = new CMTReportOptions();
                formloaded = false;
                cmboReportOptions.SelectedIndex = -1;
                cmboCutSheet.SelectedValue      = -1;
                cmboSupervisor.SelectedValue    = -1;
                cmboLines.SelectedValue         = -1;
                cmboFacility.SelectedValue      = -1;
                cmboStyles.SelectedIndex        = -1;

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

            if (oBtn != null)
            {
                var FromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                var ToDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                ToDate = ToDate.AddHours(23);

                QueryParms.FromDate = FromDate;
                QueryParms.ToDate   = ToDate;

                frmCMTViewRep vRep = new frmCMTViewRep(31, QueryParms, false);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboColours.Items.Clear();
                cmboSizes.Items.Clear();
                cmboStyles.Items.Clear();

                frmPlanVsActUnits_Load(this, null);
            }
        }
Ejemplo n.º 7
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                if (QueryParms.Depts.Count == 0)
                {
                    MessageBox.Show("Please select at least one CMT to process");
                    return;
                }

                var FromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                var ToDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                ToDate = ToDate.AddHours(23);

                QueryParms.FromDate = FromDate;
                QueryParms.ToDate   = ToDate;

                frmCMTViewRep vRep = new frmCMTViewRep(25, QueryParms, false);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboCMTs.Items.Clear();
                cmboColour.Items.Clear();
                cmboSizes.Items.Clear();
                cmboStyle.Items.Clear();

                frmCostingProfitability_Load(this, null);
            }
        }
Ejemplo n.º 8
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button        oBtn = sender as Button;
            frmCMTViewRep vRep;

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

                if (rbNoOfGarments.Checked)
                {
                    repOpts.NoOfGarments = true;
                }
                else
                {
                    repOpts.NoOfBoxes = true;
                }

                repOpts.SortSequence = ReportSort; // ReportSort;
                if (_Prod)
                {
                    vRep = new frmCMTViewRep(12, QueryParms, repOpts);
                }
                else
                {
                    vRep = new frmCMTViewRep(13, QueryParms, repOpts);
                }

                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                ReportSort = 0;

                formloaded = false;

                cmboSize.SelectedValue          = -1;
                cmboFactory.SelectedValue       = -1;
                cmboQuality.SelectedValue       = -1;
                cmboReportOptions.SelectedValue = -1;

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

            if (oBtn != null && FormLoaded)
            {
                frmCMTViewRep vRep = new frmCMTViewRep(28, QueryParms, false);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog();

                cmboStyles.Items.Clear();
                frmNCRByMonth_Load(this, null);
            }
        }
Ejemplo n.º 10
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                CMTReportOptions repOpts = new CMTReportOptions();
                var FDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                var TDate = Convert.ToDateTime(DtpToDate.Value.ToShortDateString());
                TDate = TDate.AddHours(23);

                repOpts.fromDate = FDate;
                repOpts.toDate   = TDate;

                if (rbGradeA.Checked)
                {
                    repOpts.GradeAOnly = true;
                }
                else if (rbGradeB.Checked)
                {
                    repOpts.GradeBOnly = true;
                }
                else
                {
                    repOpts.GradeBoth = true;
                }

                if (rbUnits.Checked)
                {
                    repOpts.Units = true;
                }
                else
                {
                    repOpts.Boxes = true;
                }

                CMTQueryParameters QueryParms = new CMTQueryParameters();

                frmCMTViewRep vRep = new frmCMTViewRep(26, QueryParms, repOpts);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Ejemplo n.º 11
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                var selected = (TLCMT_PanelIssue)cmboCurrentPI.SelectedItem;
                if (selected == null)
                {
                    MessageBox.Show("please select a panel issue from the drop down");
                    return;
                }

                frmCMTViewRep vRep = new frmCMTViewRep(1, selected.CMTPI_Pk);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog();

                DialogResult Res = MessageBox.Show("Do you wish to reprint the Cut Sheet Summary Report", "Option", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Res == DialogResult.Yes)
                {
                    Cutting.frmCutViewRep vRepx = new Cutting.frmCutViewRep(12, selected.CMTPI_Pk);
                    h = Screen.PrimaryScreen.WorkingArea.Height;
                    w = Screen.PrimaryScreen.WorkingArea.Width;
                    vRepx.ClientSize = new Size(w, h);
                    vRepx.ShowDialog();
                }

                /*
                 * Res = MessageBox.Show("Do you wish to reprint the CMT Panel Issue", "Option", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 * if (Res == DialogResult.Yes)
                 * {
                 *  Cutting.frmCutViewRep vRepx = new Cutting.frmCutViewRep(13, selected.CMTPI_Pk);
                 *  h = Screen.PrimaryScreen.WorkingArea.Height;
                 *  w = Screen.PrimaryScreen.WorkingArea.Width;
                 *  vRepx.ClientSize = new Size(w, h);
                 *  vRepx.ShowDialog();
                 * }*/


                frmTruckLoading_Load(this, null);
            }
        }
Ejemplo n.º 12
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && Formloaded)
            {
                CMTReportOptions repOpts = new CMTReportOptions();

                frmCMTViewRep vRep = new frmCMTViewRep(24, QueryParms, repOpts);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboDepartments.Items.Clear();

                frmSelCSOnHold_Load(this, null);
            }
        }
Ejemplo n.º 13
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                var selected = (TLCUT_CutSheet)cmboCutSheet.SelectedItem;
                if (selected == null)
                {
                    MessageBox.Show("Please select a cut sheet from the drop down list");
                    return;
                }

                frmCMTViewRep vRep = new frmCMTViewRep(5, selected.TLCutSH_Pk);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Ejemplo n.º 14
0
        private void button1_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null)
            {
                CMTReportOptions CMTRepOpts = new CMTReportOptions();

                DateTime FromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                DateTime ToDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                //  DateTime dt = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                CMTRepOpts.fromDate = FromDate;
                CMTRepOpts.toDate   = ToDate.AddHours(23);

                frmCMTViewRep vRep = new frmCMTViewRep(29, CMTRepOpts);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Ejemplo n.º 15
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                if (QueryParms.UseDatePicker)
                {
                    QueryParms.FromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                    QueryParms.ToDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());
                    QueryParms.ToDate   = QueryParms.ToDate.AddHours(23);
                }


                frmCMTViewRep vRep = new frmCMTViewRep(35, QueryParms, false);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Ejemplo n.º 16
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && formloaded)
            {
                CMTReportOptions repOps = new CMTReportOptions();
                var CMT = (TLADM_Departments)cmboDepartments.SelectedItem;
                if (CMT != null)
                {
                    repOps.CMT = CMT.Dep_Id;
                }

                repOps.SortSequence = ReportSeq;
                frmCMTViewRep vRep = new frmCMTViewRep(11, repOps);
                int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);
            }
        }
Ejemplo n.º 17
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null && FormLoaded)
            {
                repOpts             = new CMTReportOptions();
                QueryParms.FromDate = Convert.ToDateTime(FromDate.Value.ToShortDateString());
                QueryParms.ToDate   = Convert.ToDateTime(ToDate.Value.ToShortDateString()).AddHours(23);

                frmCMTViewRep vRep = new frmCMTViewRep(33, QueryParms, repOpts);

                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboColours.Items.Clear();
                cmboStyles.Items.Clear();

                frmCMTProdAnalysis_Load(this, null);
            }
        }
Ejemplo n.º 18
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && formloaded)
            {
                try
                {
                    frmCMTViewRep vRep = new frmCMTViewRep(6, parms, false);
                    int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                    int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);
                    cmboWarehouses.Items.Clear();

                    frmPanelStock_Load(this, null);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Ejemplo n.º 19
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                CMTReportOptions CMTRepOpts = new CMTReportOptions();
                Object           tst        = cmboReportOptions.SelectedItem;
                if (tst == null)
                {
                    MessageBox.Show("Please select a report option");
                    return;
                }

                foreach (PropertyInfo prop in tst.GetType().GetProperties())
                {
                    if (prop.Name == "Key")
                    {
                        CMTRepOpts.PanelStockSortOrder = Convert.ToInt32(prop.GetValue(tst));
                    }
                }

                frmCMTViewRep vRep = new frmCMTViewRep(7, QueryParms, CMTRepOpts);

                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                cmboDepartment.Items.Clear();
                comboColours.Items.Clear();
                comboSizes.Items.Clear();
                comboStyles.Items.Clear();

                frmCMTPanelStock_Load(this, null);
            }
        }
Ejemplo n.º 20
0
        private void button1_Click(object sender, EventArgs e)
        {
            var RepOpts = new CMTReportOptions();
            var CS      = (TLCUT_CutSheet)cmboCutSheet.SelectedItem;

            if (CS != null)
            {
                var oBtn = (Button)sender;
                if (oBtn != null && FormLoaded)
                {
                    RepOpts.ReportTitle   = CS.TLCutSH_No;
                    RepOpts.SLFCutSheetFK = CS.TLCutSH_Pk;
                    frmCMTViewRep vRep = new frmCMTViewRep(23, RepOpts);
                    int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                    int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);
                }
            }
            else
            {
                MessageBox.Show("Please select a custsheet from the drop down box");
            }
        }
Ejemplo n.º 21
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                var AllReadyTicked = (from Rows in dataGridView1.Rows.Cast <DataGridViewRow>()
                                      where (bool)Rows.Cells[1].Value == true
                                      select Rows).FirstOrDefault();

                if (AllReadyTicked != null)
                {
                    var Pk = (int)AllReadyTicked.Cells[0].Value;



                    frmCMTViewRep vRep = new frmCMTViewRep(2, Pk, true);
                    int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                    int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);
                }
            }
        }
Ejemplo n.º 22
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                if (_Mode)
                {
                    if (chkProductionResults.Checked)
                    {
                        QueryParms.ProductionResults = true;
                    }

                    repOptions = new CMTReportOptions();

                    DateTime FromDate = Convert.ToDateTime(dtpFromDate.Value.ToShortDateString());
                    DateTime ToDate   = Convert.ToDateTime(dtpToDate.Value.ToShortDateString());

                    ToDate = ToDate.AddHours(23);

                    repOptions.fromDate = FromDate;
                    repOptions.toDate   = ToDate;

                    frmCMTViewRep vRep = new frmCMTViewRep(30, QueryParms, repOptions);
                    int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                    int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);

                    frmDateRequired_Load(this, null);
                }
                else
                {
                    using (var context = new TTI2Entities())
                    {
                        foreach (DataGridViewRow Row in dataGridView1.Rows)
                        {
                            if (!(bool)Row.Cells[1].Value)
                            {
                                continue;
                            }

                            var Pk        = (int)Row.Cells[0].Value;
                            var LineIssue = context.TLCMT_LineIssue.Find(Pk);
                            if (LineIssue != null)
                            {
                                LineIssue.TLCMTLI_Required_Date = dtpFromDate.Value;
                            }
                        }

                        try
                        {
                            context.SaveChanges();
                            MessageBox.Show("Data successfully saved to the database");

                            this.frmDateRequired_Load(this, null);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
        }
Ejemplo n.º 23
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;

            if (oBtn != null && FormLoaded)
            {
                var selected = (TLCUT_CutSheet)cmboCutSheets.SelectedItem;
                if (selected == null)
                {
                    MessageBox.Show("Please select a cut sheet from the drop down list");
                    return;
                }

                using (var context = new TTI2Entities())
                {
                    foreach (DataRow Row in dt.Rows)
                    {
                        if (!Row.Field <bool>(1))
                        {
                            continue;
                        }

                        var ComWork_FK    = Row.Field <int>(0);
                        var CompletedWork = context.TLCMT_CompletedWork.Find(ComWork_FK);
                        if (CompletedWork != null)
                        {
                            TLCMT_HistoryBoxedQty History = new TLCMT_HistoryBoxedQty();
                            History.BoxHist_CompletedWork_FK = CompletedWork.TLCMTWC_Pk;
                            History.BoxHist_DateTime         = DateTime.Now;
                            History.BoxHist_New_Qty          = Row.Field <int>(4);
                            History.BoxHist_Orignal_Qty      = CompletedWork.TLCMTWC_Qty;
                            History.BoxHist_Size_FK          = CompletedWork.TLCMTWC_Size_FK;
                            History.BoxHist_CutSheet_FK      = selected.TLCutSH_Pk;
                            History.BoxHist_No = CompletedWork.TLCMTWC_BoxNumber;

                            context.TLCMT_HistoryBoxedQty.Add(History);

                            CompletedWork.TLCMTWC_Qty = Row.Field <int>(4);
                        }
                    }

                    try
                    {
                        context.SaveChanges();
                        MessageBox.Show("Data saved successfully to database");

                        frmCMTViewRep vRep = new frmCMTViewRep(34, selected.TLCutSH_Pk);
                        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.InnerException.ToString());
                    }
                    finally
                    {
                        this.frmCMTBoxedQtyAdjustment_Load(this, null);
                    }
                }
            }
        }
Ejemplo n.º 24
0
        private void Submit_Click(object sender, EventArgs e)
        {
            Button oBtn = sender as Button;

            if (oBtn != null)
            {
                CMTReportOptions CMTRepOpts = new CMTReportOptions();

                Object tst = cmboReportOptions.SelectedItem;
                if (tst == null)
                {
                    MessageBox.Show("Please select a report option");
                    return;
                }

                foreach (PropertyInfo prop in tst.GetType().GetProperties())
                {
                    if (prop.Name == "Key")
                    {
                        CMTRepOpts.WorkAnalysis = Convert.ToInt32(prop.GetValue(tst));
                    }
                }


                try
                {
                    if (chkQaSummary.Checked)
                    {
                        CMTRepOpts.QAReport = true;
                    }

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

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

                    frmCMTViewRep vRep = new frmCMTViewRep(20, QueryParms, CMTRepOpts);

                    int h = Screen.PrimaryScreen.WorkingArea.Height;
                    int w = Screen.PrimaryScreen.WorkingArea.Width;
                    vRep.ClientSize = new Size(w, h);
                    vRep.ShowDialog(this);

                    if (chkException.Checked)
                    {
                        chkException.Checked = false;
                        txtPercentage.Text   = "0";
                    }
                }
                finally
                {
                    cmboFactory.Items.Clear();
                    cmboSize.Items.Clear();
                    cmboStyle.Items.Clear();
                    cmboColour.Items.Clear();

                    frmCMTFinishedWAnalysis_Load(this, null);
                }
            }
        }
Ejemplo n.º 25
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Button oBtn = (Button)sender;
            TLCMT_NonCompliance NonC = null;

            if (oBtn != null && FormLoaded)
            {
                var Selected = (TLCMT_LineIssue)cmboCutSheets.SelectedItem;
                if (Selected == null)
                {
                    MessageBox.Show("Please select a CutSheet from the list available");
                    return;
                }

                DataGridView oDgv = dataGridView1;

                using (var context = new TTI2Entities())
                {
                    foreach (DataGridViewRow Row in oDgv.Rows)
                    {
                        if ((bool)Row.Cells[2].Value == true)
                        {
                            if (Row.Cells[1].Value == null)
                            {
                                NonC = new TLCMT_NonCompliance();
                                NonC.CMTNCD_TransDate        = dtpTransDate.Value;
                                NonC.CMTNCD_CutSheet_Fk      = Selected.TLCMTLI_CutSheet_FK;
                                NonC.CMTNCD_Applicable       = (bool)Row.Cells[2].Value;
                                NonC.CMTNCD_NonCompliance_Fk = (int)Row.Cells[0].Value;
                                NonC.CMTNCD_Year             = dtpTransDate.Value.Year;
                                NonC.CMTNCD_WeekNumber       = core.GetIso8601WeekOfYear(dtpTransDate.Value);
                                NonC.CMTNCD_Line_FK          = (int)Selected.TLCMTLI_LineNo_FK;

                                var CutSheet = context.TLCUT_CutSheet.Find(Selected.TLCMTLI_CutSheet_FK);
                                if (CutSheet != null)
                                {
                                    NonC.CMTNCD_Style_FK = CutSheet.TLCutSH_Styles_FK;
                                }

                                context.TLCMT_NonCompliance.Add(NonC);
                            }
                        }
                        else
                        {
                            if (Row.Cells[1].Value != null)
                            {
                                var Pk = (int)Row.Cells[1].Value;

                                var CurrentEntry = context.TLCMT_NonCompliance.Find(Pk);
                                if (CurrentEntry != null)
                                {
                                    context.TLCMT_NonCompliance.Remove(CurrentEntry);
                                }
                            }
                        }
                    }

                    try
                    {
                        context.SaveChanges();
                        MessageBox.Show("Data successfully saved to database");

                        frmCMTViewRep vRep = new frmCMTViewRep(27, NonC.CMTNCD_CutSheet_Fk);
                        int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                        int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                        vRep.ClientSize = new Size(w, h);
                        vRep.ShowDialog();

                        cmboCutSheets.DataSource = null;
                        cmboCutSheets.Items.Clear();
                        dataGridView1.Rows.Clear();

                        frmCMTNonCompliance_Load(this, null);
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                }
            }
        }
Ejemplo n.º 26
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Button          oBtn        = sender as Button;
            int             Col3        = 0;
            TLCMT_LineIssue LineIssue   = null;
            int             Pk          = 0;
            string          Description = string.Empty;
            var             RepOpts     = new CMTReportOptions();

            if (oBtn != null && formloaded)
            {
                if (!InternalTransfer)
                {
                    var DeptSelected = (TLADM_Departments)cmboDepartment.SelectedItem;
                    if (DeptSelected == null)
                    {
                        MessageBox.Show("Please select an location from the drop down box");
                        return;
                    }

                    using (var context = new TTI2Entities())
                    {
                        Object tst = cmboCutSheet.SelectedItem;
                        if (tst != null)
                        {
                            foreach (PropertyInfo prop in tst.GetType().GetProperties())
                            {
                                if (prop.Name == "Key")
                                {
                                    Pk = Convert.ToInt32(prop.GetValue(tst));
                                }
                                else if (prop.Name == "Value")
                                {
                                    Description = Convert.ToString(prop.GetValue(tst));
                                }
                            }
                        }

                        if (Pk == 0)
                        {
                            MessageBox.Show("Please select a cut sheet from the drop down box");
                            return;
                        }

                        var LineDetails = (TLCMT_FactConfig)cmboLineDetails.SelectedItem;

                        if (LineDetails == null)
                        {
                            MessageBox.Show("Please select a line to assign this cut sheet too");
                            return;
                        }

                        LineIssue = new TLCMT_LineIssue();
                        LineIssue = context.TLCMT_LineIssue.Find(Pk);
                        if (LineIssue != null)
                        {
                            LineIssue.TLCMTLI_TransactionNo   = Col3;
                            LineIssue.TLCMTLI_TransferDate    = DateTime.Now;
                            LineIssue.TLCMTLI_CutSheetDetails = "SI" + Description.Remove(0, 2);
                            LineIssue.TLCMTLI_OnHold          = false;
                            var LNU = context.TLADM_LastNumberUsed.Where(x => x.LUN_Department_FK == LineIssue.TLCMTLI_CmtFacility_FK).FirstOrDefault();
                            if (LNU != null)
                            {
                                LineIssue.TLCMTLI_TransactionNo = LNU.col3;
                            }

                            LineIssue.TLCMTLI_Required_Date = dtpRequiredDate.Value;
                            LineIssue.TLCMTLI_LineNo_FK     = LineDetails.TLCMTCFG_Pk;
                            LineIssue.TLCMTLI_IssuedToLine  = true;
                        }

                        Col3 += 1;

                        try
                        {
                            context.SaveChanges();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                        finally
                        {
                            MessageBox.Show("Data successfully saved to database");
                            //--------------Cut Sheet document
                            frmCMTViewRep vRep = new frmCMTViewRep(8, LineIssue.TLCMTLI_Pk);
                            int           h    = Screen.PrimaryScreen.WorkingArea.Height;
                            int           w    = Screen.PrimaryScreen.WorkingArea.Width;
                            vRep.ClientSize = new Size(w, h);
                            vRep.ShowDialog(this);

                            RepOpts.ReportTitle   = context.TLCUT_CutSheet.Find(LineIssue.TLCMTLI_CutSheet_FK).TLCutSH_No;
                            RepOpts.SLFCutSheetFK = LineIssue.TLCMTLI_CutSheet_FK;

                            /*//------------------Line Feeder Document
                             * No longer required as they copy this onto the back of cutsheet to conserve
                             * vRep = new frmCMTViewRep(23, RepOpts);
                             * h = Screen.PrimaryScreen.WorkingArea.Height;
                             * w = Screen.PrimaryScreen.WorkingArea.Width;
                             * vRep.ClientSize = new Size(w, h);
                             * vRep.ShowDialog(this);*////

                            vRep            = new frmCMTViewRep(5, LineIssue.TLCMTLI_CutSheet_FK);
                            h               = Screen.PrimaryScreen.WorkingArea.Height;
                            w               = Screen.PrimaryScreen.WorkingArea.Width;
                            vRep.ClientSize = new Size(w, h);
                            vRep.ShowDialog(this);

                            formloaded = false;
                            cmboCutSheet.SelectedValue    = -1;
                            cmboDepartment.SelectedValue  = -1;
                            cmboLineDetails.SelectedValue = -1;
                            formloaded = true;

                            txtColours.Text = string.Empty;
                            txtPanels.Text  = string.Empty;
                            txtSizes.Text   = string.Empty;
                            txtStyle.Text   = string.Empty;
                        }
                    }
                }
                else
                {
                    using (var context = new TTI2Entities())
                    {
                        foreach (DataGridViewRow row in dataGridView1.Rows)
                        {
                            if (row.Cells[0].Value == null)
                            {
                                continue;
                            }

                            var OnHold = (bool)row.Cells[5].Value;
                            if (OnHold)
                            {
                                var Reason = row.Cells[2].Value.ToString();
                                if (Reason.Length == 0)
                                {
                                    MessageBox.Show("Please provide a reason as to why this Cutsheet is placed on hold");
                                    return;
                                }
                            }


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

                            LineIssue = context.TLCMT_LineIssue.Find(Pk);
                            if (LineIssue != null)
                            {
                                LineIssue.TLCMTLI_Reason           = row.Cells[2].Value.ToString();
                                LineIssue.TLCMTLI_TransferApproved = row.Cells[3].Value.ToString();
                                LineIssue.TLCMTLI_TransferDate     = DateTime.Now;
                                LineIssue.TLCMTLI_OnHold           = OnHold;

                                if (NewLineAssigned != 0)
                                {
                                    LineIssue.TLCMTLI_LineNo_FK = NewLineAssigned;
                                }
                            }
                        }

                        try
                        {
                            context.SaveChanges();
                            MessageBox.Show("Data successfully saved to database");

                            dataGridView1.Rows.Clear();
                            dataGridView1.Rows.Add();

                            cmboCutSheet.SelectedValue    = -1;
                            cmboDepartment.SelectedValue  = -1;
                            cmboLineDetails.SelectedValue = -1;

                            txtColours.Text = string.Empty;
                            txtPanels.Text  = string.Empty;
                            txtSizes.Text   = string.Empty;
                            txtStyle.Text   = string.Empty;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
        }
Ejemplo n.º 27
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Button oBtn         = sender as Button;
            bool   UpDateHeader = true;

            if (oBtn != null && formloaded)
            {
                var LNSelected = (TLADM_WhseStore)cmboStoreFacilities.SelectedItem;
                if (LNSelected == null)
                {
                    MessageBox.Show("Please select a store");
                    return;
                }

                TLCMT_PanelIssue PIselected = (TLCMT_PanelIssue)cmboDelivery.SelectedItem;

                using (var context = new TTI2Entities())
                {
                    foreach (DataGridViewRow row in dataGridView1.Rows)
                    {
                        var CutSheetPk = (int)row.Cells[0].Value;

                        if ((bool)row.Cells[2].Value == false)
                        {
                            DialogResult Res = MessageBox.Show("Warning . This cutsheet not selected. Will be sent back to originating Panel Store", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                            if (Res == DialogResult.Yes)
                            {
                                var CutSheetReceipt = context.TLCUT_CutSheetReceipt.Where(x => x.TLCUTSHR_CutSheet_FK == CutSheetPk).FirstOrDefault();
                                if (CutSheetReceipt != null)
                                {
                                    CutSheetReceipt.TLCUTSHR_InPanelStore  = true;
                                    CutSheetReceipt.TLCUTSHR_Issued        = false;
                                    CutSheetReceipt.TLCUTSHR_InReceiptCage = false;
                                }
                                UpDateHeader = false;
                                continue;
                            }
                        }

                        TLCMT_LineIssue li = new TLCMT_LineIssue();
                        li.TLCMTLI_Date           = dtpTransDate.Value;
                        li.TLCMTLI_CutSheet_FK    = CutSheetPk;
                        li.TLCMTLI_CmtFacility_FK = PIselected.CMTPI_Department_FK;
                        li.TLCMTLI_PanelIssue_FK  = PIselected.CMTPI_Pk;
                        li.TLCMTLI_WhStore_FK     = LNSelected.WhStore_Id;
                        li.TLCMTLI_Required_Date  = dtpTransDate.Value.AddDays(7);
                        li.TLCMTLI_PanelIssue_FK  = PIselected.CMTPI_Pk;
                        try
                        {
                            li.TLCMTLI_IssueQty = int.Parse(row.Cells[5].Value.ToString());
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }

                        //---------------------------------------
                        // this is to ensure that the record is only added once to the table
                        //-------------------------------------------------------------------------------
                        var AlreadyIssued = context.TLCMT_LineIssue.Where(x => x.TLCMTLI_CutSheet_FK == CutSheetPk).FirstOrDefault();
                        if (AlreadyIssued == null)
                        {
                            context.TLCMT_LineIssue.Add(li);
                        }

                        var CSR = context.TLCUT_CutSheetReceipt.Where(x => x.TLCUTSHR_CutSheet_FK == CutSheetPk).FirstOrDefault();
                        if (CSR != null)
                        {
                            CSR.TLCUTSHR_InReceiptCage = true;

                            var PanIssueDetail = context.TLCMT_PanelIssueDetail.Where(X => X.CMTPID_CutSheet_FK == CSR.TLCUTSHR_Pk).FirstOrDefault();
                            if (PanIssueDetail != null)
                            {
                                PanIssueDetail.CMTPID_Receipted = true;
                            }
                        }
                    }

                    if (UpDateHeader)
                    {
                        PIselected = context.TLCMT_PanelIssue.Find(PIselected.CMTPI_Pk);
                        if (PIselected != null)
                        {
                            PIselected.CMTPI_Receipted = true;
                        }
                    }

                    try
                    {
                        context.SaveChanges();
                        dataGridView1.Rows.Clear();

                        cmboStoreFacilities.SelectedIndex = -1;
                        cmboCMT.SelectedIndex             = -1;
                        TxtStoreFacilities.Text           = string.Empty;

                        MessageBox.Show("Data saved successfully to database");

                        DialogResult res = MessageBox.Show("Do you wish to print a full report", "All transactions", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                        if (res == DialogResult.OK)
                        {
                            frmCMTViewRep vRep = new frmCMTViewRep(3, PIselected.CMTPI_Pk);
                            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);
                    }
                }
            }
        }
Ejemplo n.º 28
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            Button        oBtn = sender as Button;
            frmCMTViewRep vRep = null;

            if (oBtn != null && formloaded)
            {
                bool Reprint = false;

                if (QueryParms.PanelIssue.Count == 0)
                {
                    MessageBox.Show("Please select a Delivery from the drop down list");
                    return;
                }

                int Dept_Fk        = 0;
                int DeliveryNumber = Convert.ToInt32(label2.Text);

                if (chkPrevious.Checked)
                {
                    Reprint = true;
                }

                vRep = new frmCMTViewRep(2, QueryParms, Reprint);
                int h = Screen.PrimaryScreen.WorkingArea.Height;
                int w = Screen.PrimaryScreen.WorkingArea.Width;
                vRep.ClientSize = new Size(w, h);
                vRep.ShowDialog(this);

                if (!chkPrevious.Checked)
                {
                    using (var context = new TTI2Entities())
                    {
                        foreach (var Query in QueryParms.PanelIssue)
                        {
                            var Existing = context.TLCMT_PanelIssue.Find(Query.CMTPI_Pk);
                            if (Existing != null)
                            {
                                Existing.CMTPI_Closed         = true;
                                Existing.CMTPI_DeliveryNumber = DeliveryNumber;
                                Existing.CMTPI_Display        = "DN -" + DeliveryNumber.ToString() + " - TL " + Existing.CMTPI_Number.ToString();

                                var Dept = context.TLADM_Departments.Find(Query.CMTPI_Department_FK);
                                if (Dept != null)
                                {
                                    Dept_Fk = Dept.Dep_Id;

                                    var TransType = context.TLADM_TranactionType.Where(x => x.TrxT_Number == 200 && x.TrxT_Department_FK == Dept.Dep_Id).FirstOrDefault();
                                    if (TransType != null)
                                    {
                                        Existing.CMTPI_TranType_FK = TransType.TrxT_Pk;
                                    }
                                }
                            }
                        }

                        var LNU = context.TLADM_LastNumberUsed.Where(x => x.LUN_Department_FK == Dept_Fk).FirstOrDefault();
                        if (LNU != null)
                        {
                            LNU.col2 += 1;;
                        }

                        try
                        {
                            context.SaveChanges();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                }
            }
        }