Пример #1
0
 private void grdList_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         InternalOrderDB iodb = new InternalOrderDB();
         if (e.RowIndex < 0)
         {
             return;
         }
         string columnName = grdList.Columns[e.ColumnIndex].Name;
         if (columnName.Equals("View"))
         {
             ioheader ioh = new ioheader();
             ioh.DocumentID    = "IOPRODUCT";
             ioh.TemporaryNo   = Convert.ToInt32(grdList.Rows[e.RowIndex].Cells["TemporaryNo"].Value.ToString());
             ioh.TemporaryDate = Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["TemporaryDate"].Value.ToString());
             showIODetailgridView(ioh);
         }
         else if (columnName.Equals("PlanDetails"))
         {
             int      ioNo   = Convert.ToInt32(grdList.Rows[e.RowIndex].Cells["InternalOrderNo"].Value.ToString());
             DateTime ioDate = Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["InternalOrderDate"].Value.ToString());
             //List<productionplanheader> planDetail = ProductionPlanHeaderDB.getProductionDetailsForPerticularIO(ioNo,ioDate);
             showProductionPlanDetailGrid(ioNo, ioDate);
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
     }
 }
Пример #2
0
        private void showIODetailgridView(ioheader ioh)
        {
            try
            {
                frmPopup = new Form();
                frmPopup.StartPosition = FormStartPosition.CenterScreen;
                frmPopup.BackColor     = Color.CadetBlue;

                frmPopup.MaximizeBox     = false;
                frmPopup.MinimizeBox     = false;
                frmPopup.ControlBox      = false;
                frmPopup.FormBorderStyle = FormBorderStyle.FixedSingle;

                frmPopup.Size = new Size(950, 350);

                InternalOrderDB iodb = new InternalOrderDB();
                grdIODetail = iodb.getGridViewOfIODetail(ioh);
                grdIODetail.Columns["WorkDesc"].Visible = false;
                //grdIODetail.Columns["Specification"].Visible = false;
                grdIODetail.Bounds = new Rectangle(new Point(0, 0), new Size(950, 300));
                frmPopup.Controls.Add(grdIODetail);

                Button lvCancel = new Button();
                lvCancel.Text      = "CANCEL";
                lvCancel.BackColor = Color.Tan;
                lvCancel.Location  = new System.Drawing.Point(30, 310);
                lvCancel.Click    += new System.EventHandler(this.grdCustCancel_Click1);
                frmPopup.Controls.Add(lvCancel);
                frmPopup.ShowDialog();
            }
            catch (Exception ex)
            {
            }
        }
Пример #3
0
 private void AddRowsInPOListGridView(string psfrefStr)
 {
     try
     {
         grdPOList.Rows.Clear();
         string type = cmbProdType.SelectedItem.ToString();
         //string POPIDocID = getPOPIDocID(type);
         //string customerID = ((Structures.ComboBoxItem)cmbCustomer.SelectedItem).HiddenValue;
         //POPIHeaderDB popihdb = new POPIHeaderDB();
         //List<popiheader> POPIHeaders = new List<popiheader>();
         //POPIHeaders = popihdb.getFilteredPAFTypeProductInward(POPIDocID, customerID);
         if (type == "Product")
         {
             List <ioheader> IOList = InternalOrderDB.IODetailListWRTRefPONos(PAFString);
             foreach (ioheader ioh in IOList)
             {
                 int c = grdPOList.Rows.Count;
                 grdPOList.Rows.Add();
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pDocumentID"].Value    = ioh.DocumentID;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pTemporaryNo"].Value   = ioh.TemporaryNo;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pTemporaryDate"].Value = ioh.TemporaryDate;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pCustomerID"].Value    = ioh.CustomerID;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pCustomerName"].Value  = ioh.CustomerName;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pReferenceNO"].Value   = ioh.ReferenceTrackingNos.Replace(Environment.NewLine, string.Empty);
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["RefPoOriginal"].Value  = ioh.ReferenceTrackingNos;
             }
         }
         else
         {
             List <indentserviceheader> INdList = IndentServiceDB.IndentDetailListWRTRefPONos(PAFString);
             foreach (indentserviceheader ish in INdList)
             {
                 int c = grdPOList.Rows.Count;
                 grdPOList.Rows.Add();
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pDocumentID"].Value    = ish.DocumentID;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pTemporaryNo"].Value   = ish.TemporaryNo;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pTemporaryDate"].Value = ish.TemporaryDate;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pCustomerID"].Value    = ish.CustomerID;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pCustomerName"].Value  = ish.CustomerName;
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["pReferenceNO"].Value   = ish.ReferenceInternalOrder.Replace("\n", ""); //For Refenernce PO Nos
                 grdPOList.Rows[grdPOList.RowCount - 1].Cells["RefPoOriginal"].Value  = ish.ReferenceInternalOrder;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error in POPI Listing");
     }
     grdPOList.Visible = true;
     btnClose.Visible  = true;
     btnCancel.Visible = true;
 }
Пример #4
0
        private void listTemplates()
        {
            try
            {
                grdMainList.Rows.Clear();
                InternalOrderDB       IODb        = new InternalOrderDB();
                List <iorequirements> sefTempList = IODb.getTemplateListForProductType(sefid);

                int           i       = 1;
                List <string> strList = new List <string>();

                foreach (iorequirements req in sefTempList)
                {
                    grdMainList.Rows.Add();
                    grdMainList.Rows[grdMainList.RowCount - 1].Cells["SiNo"].Value        = i;
                    grdMainList.Rows[grdMainList.RowCount - 1].Cells["SEFID1"].Value      = req.SEFID;
                    grdMainList.Rows[grdMainList.RowCount - 1].Cells["SEFRefNo"].Value    = req.SEFReferenceNo;
                    grdMainList.Rows[grdMainList.RowCount - 1].Cells["SequenceNo"].Value  = req.SequenceNo;
                    grdMainList.Rows[grdMainList.RowCount - 1].Cells["Description"].Value = req.Description;

                    iorequirements ioreqTemp = reqList.FirstOrDefault(listItem => listItem.SEFReferenceNo == req.SEFReferenceNo);

                    if (ioreqTemp != null)
                    {
                        if (ioreqTemp.RequiredValue != null)
                        {
                            grdMainList.Rows[grdMainList.RowCount - 1].Cells["RequiredValue"].Value = ioreqTemp.RequiredValue;
                        }
                        else
                        {
                            grdMainList.Rows[grdMainList.RowCount - 1].Cells["RequiredValue"].Value = "";
                        }
                    }
                    else
                    {
                        grdMainList.Rows[grdMainList.RowCount - 1].Cells["RequiredValue"].Value = "";
                    }
                    i++;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Template  Listing");
            }
            try
            {
                pnlList.Visible = true;
            }
            catch (Exception ex)
            {
            }
        }
Пример #5
0
        private void ListQtyDetails()
        {
            try
            {
                pnlList.Visible = true;
                grdList.Visible = true;
                grdList.Rows.Clear();
                InternalOrderDB iodb   = new InternalOrderDB();
                List <ioheader> IOlist = iodb.getFilteredIOForReportIO();
                foreach (ioheader io in IOlist)
                {
                    try
                    {
                        grdList.Rows.Add();
                        grdList.Rows[grdList.RowCount - 1].Cells["TemporaryNo"].Value       = io.TemporaryNo;
                        grdList.Rows[grdList.RowCount - 1].Cells["TemporaryDate"].Value     = io.TemporaryDate;
                        grdList.Rows[grdList.RowCount - 1].Cells["InternalOrderNo"].Value   = io.InternalOrderNo;
                        grdList.Rows[grdList.RowCount - 1].Cells["InternalOrderDate"].Value = io.InternalOrderDate;
                        grdList.Rows[grdList.RowCount - 1].Cells["SEFID"].Value             = io.SEFID;
                        grdList.Rows[grdList.RowCount - 1].Cells["Customer"].Value          = io.CustomerName;
                        grdList.Rows[grdList.RowCount - 1].Cells["TargetDate"].Value        = io.TargetDate;
                        grdList.Rows[grdList.RowCount - 1].Cells["Remark"].Value            = io.Remarks;

                        double[] str = ProductionPlanHeaderDB.getNoOfProdPlanPreparedPerIO(io.InternalOrderNo, io.InternalOrderDate);
                        if (str[0] == 0)
                        {
                            grdList.Rows[grdList.RowCount - 1].Cells["ProductionStatus"].Value = "NotPrepared";
                        }
                        else
                        {
                            grdList.Rows[grdList.RowCount - 1].Cells["ProductionStatus"].Value = "Prepared";
                        }
                        grdList.Rows[grdList.RowCount - 1].Cells["Quantity"].Value = str[1];
                    }
                    catch (Exception ex)
                    {
                    }
                }
                if (grdList.RowCount > 0)
                {
                    txtSearch.Visible        = true;
                    lblSearch.Visible        = true;
                    btnExportToExcel.Visible = true;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error in Stock listing");
            }
        }