Ejemplo n.º 1
0
 private void cmbPurpose_SelectedIndexChanged(object sender, EventArgs e)
 {
     grdList.Rows.Clear();
     grdList.Visible = false;
     PAFString       = "";
     Selectedpopih   = new popiheader();
 }
Ejemplo n.º 2
0
        private void grdList_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex < 0)
                {
                    return;
                }
                string colname = grdList.Columns[e.ColumnIndex].Name;
                if (colname == "Change")
                {
                    PAFString = "";
                    string type     = cmbProdType.SelectedItem.ToString();
                    string pafDocID = getPAFDocID(type);

                    PAFString = pafDocID + ";" + grdList.Rows[e.RowIndex].Cells["gTrackingNo"].Value.ToString() + "("
                                + Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["gTrackingDate"].Value).ToString("yyyy-MM-dd") + ")" + Main.delimiter1;

                    Selectedpopih               = new popiheader();
                    Selectedpopih.DocumentID    = grdList.Rows[e.RowIndex].Cells["gDocumentID"].Value.ToString();
                    Selectedpopih.TrackingNo    = Convert.ToInt32(grdList.Rows[e.RowIndex].Cells["gTrackingNo"].Value.ToString());
                    Selectedpopih.TrackingDate  = Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["gTrackingDate"].Value);
                    Selectedpopih.TemporaryNo   = Convert.ToInt32(grdList.Rows[e.RowIndex].Cells["gTemporaryNo"].Value.ToString());
                    Selectedpopih.TemporaryDate = Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["gTemporaryDate"].Value);

                    AddRowsInPOListGridView(PAFString);
                    //showPOPIGridview();
                    pnlUserInput.Visible = true;
                }
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 3
0
 private void cmbDocStatus_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         grdList.Rows.Clear();
         grdList.Visible = false;
         PAFString       = "";
         Selectedpopih   = new popiheader();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 4
0
 //called when new,cancel buttons are clicked.
 //called at the end of event processing for forward, approve,reverse and save
 public void clearData()
 {
     try
     {
         dgvComments.Rows.Clear();
         dgvpt.Rows.Clear();
         clearTabPageControls();
         pnlCmtr.Visible      = false;
         pnlForwarder.Visible = false;
         prevpopi             = new popiheader();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 5
0
 private void btnClear_Click(object sender, EventArgs e)
 {
     try
     {
         grdList.Rows.Clear();
         cmbCustomer.SelectedIndex = -1;
         cmbProdType.SelectedIndex = -1;
         PAFString       = "";
         Selectedpopih   = new popiheader();
         grdList.Visible = false;
         pnllv.Visible   = false;
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 6
0
        private Boolean updateDashBoard(popiheader popih, int stat)
        {
            Boolean status = true;

            try
            {
                dashboardalarm dsb   = new dashboardalarm();
                DashboardDB    ddsDB = new DashboardDB();
                dsb.DocumentID    = popih.DocumentID;
                dsb.TemporaryNo   = popih.TemporaryNo;
                dsb.TemporaryDate = popih.TemporaryDate;
                dsb.DocumentNo    = popih.TrackingNo;
                dsb.DocumentDate  = popih.TrackingDate;
                dsb.FromUser      = Login.userLoggedIn;
                if (stat == 1)
                {
                    dsb.ActivityType = 2;
                    dsb.ToUser       = popih.ForwardUser;
                    if (!ddsDB.insertDashboardAlarm(dsb))
                    {
                        MessageBox.Show("DashBoard Fail to update");
                        status = false;
                    }
                }
                else if (stat == 2)
                {
                    dsb.ActivityType = 3;
                    List <documentreceiver> docList = DocumentReceiverDB.getDocumentWiseReceiver(MatDel.DocumentID);
                    foreach (documentreceiver docRec in docList)
                    {
                        dsb.ToUser       = docRec.EmployeeID;
                        dsb.DocumentDate = UpdateTable.getSQLDateTime();
                        if (!ddsDB.insertDashboardAlarm(dsb))
                        {
                            MessageBox.Show("DashBoard Fail to update");
                            status = false;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                status = false;
            }
            return(status);
        }
Ejemplo n.º 7
0
 private void ShowAllDetails()
 {
     if (docID == "POPRODUCTINWARD" || docID == "POPRODUCTINWARD")
     {
         try
         {
             POPIHeaderDB popihdb = new POPIHeaderDB();
             popiheader   vd      = popihdb.getPOPIHeader(tempno, tempdate, docID).FirstOrDefault();
             if (vd != null)
             {
                 txtDocID.Text             = vd.DocumentID;
                 txtTrackingNo.Text        = vd.TrackingNo.ToString();
                 dtTrackingDate.Value      = vd.TrackingDate;
                 txtrefno.Text             = vd.ReferenceNo;
                 cmbCustomer.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbCustomer, vd.CustomerID);
                 txtPONo.Text                  = vd.CustomerPONO;
                 dtPODate.Value                = vd.CustomerPODate;
                 dtDeliveryDate.Value          = vd.DeliveryDate;
                 cmbOfficeID.SelectedIndex     = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, vd.OfficeID);
                 cmbProjectID.SelectedIndex    = cmbProjectID.FindString(vd.ProjectID);
                 cmbPaymentMode.SelectedIndex  = Structures.ComboFUnctions.getComboIndex(cmbPaymentMode, vd.PaymentMode);
                 cmbFreightTerms.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbFreightTerms, vd.FreightTerms);
                 cmbCurrency.SelectedIndex     = Structures.ComboFUnctions.getComboIndex(cmbCurrency, vd.CurrencyID);
                 txtFreightCharge.Text         = vd.FreightCharge.ToString();
                 dtValidateDate.Value          = vd.ValidityDate;
                 txtpaymentTerms.Text          = getPaymentTermsExplained(vd.PaymentTerms);
                 txtproductValue.Text          = vd.ProductValueINR.ToString();
                 txtTaxvalue.Text              = vd.TaxAmountINR.ToString();
                 txtPOvalue.Text               = vd.POValueINR.ToString();
             }
             popiheader popih = new popiheader();
             popih.DocumentID    = docID;
             popih.TemporaryNo   = tempno;
             popih.TemporaryDate = tempdate;
             List <popidetail> POPIDetail = POPIHeaderDB.getPOPIDetail(popih);
             grdPRDetail.Rows.Clear();
             int    i     = 0;
             double count = 0;
             foreach (popidetail pop in POPIDetail)
             {
                 grdPRDetail.Rows.Add();
                 grdPRDetail.Rows[i].Cells["LineNo"].Value   = grdPRDetail.Rows.Count;
                 grdPRDetail.Rows[i].Cells["Item"].Value     = pop.StockItemID;
                 grdPRDetail.Rows[i].Cells["ItemDesc"].Value = pop.StockItemName;
                 grdPRDetail.Rows[i].Cells["TaxCode"].Value  = pop.TaxCode;
                 grdPRDetail.Rows[i].Cells["Quantity"].Value = pop.Quantity;
                 grdPRDetail.Rows[i].Cells["Price"].Value    = pop.Price;
                 grdPRDetail.Rows[i].Cells["Tax"].Value      = pop.Tax;
                 double valu = pop.Price * pop.Quantity + pop.Tax;
                 grdPRDetail.Rows[i].Cells["Value"].Value = valu;
                 count += valu;
                 i++;
             }
             txtTotalValue.Text = count.ToString();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in POInward");
         }
     }
     else if (docID == "PURCHASEORDER")
     {
         try
         {
             PurchaseOrderDB pdb = new PurchaseOrderDB();
             poheader        poh = pdb.getFilteredPurchaseOrderHeaderlist(docID, tempno, tempdate).FirstOrDefault();
             if (poh != null)
             {
                 txtDocID.Text = poh.DocumentID;
                 //txtTrackingNo.Text = poh.TrackingNo.ToString();
                 //dtTrackingDate.Value = poh.TrackingDate;
                 //txtrefno.Text = poh.ReferenceNo;
                 cmbCustomer.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbCustomer, poh.CustomerID);
                 //txtPONo.Text = poh.CustomerPONO;
                 //dtPODate.Value = poh.CustomerPODate;
                 //dtDeliveryDate.Value = poh.DeliveryDate;
                 //cmbOfficeID.SelectedIndex = Structures.ComboFUnctions.getComboIndex(cmbOfficeID, poh.OfficeID);
                 //cmbProjectID.SelectedIndex = cmbProjectID.FindString(poh.ProjectID);
                 //dtValidateDate.Value = poh.ValidityDate;
                 txtpaymentTerms.Text = getPaymentTermsExplained(poh.PaymentTerms);
                 txtproductValue.Text = poh.ProductValueINR.ToString();
                 txtTaxvalue.Text     = poh.TaxAmountINR.ToString();
                 txtPOvalue.Text      = poh.POValueINR.ToString();
             }
             poheader popd = new poheader();
             popd.DocumentID    = docID;
             popd.TemporaryNo   = tempno;
             popd.TemporaryDate = tempdate;
             List <podetail> pod = PurchaseOrderDB.getPurchaseOrderDetails(popd);
             grdPRDetail.Rows.Clear();
             int    i     = 0;
             double count = 0;
             foreach (podetail po in pod)
             {
                 grdPRDetail.Rows.Add();
                 grdPRDetail.Rows[i].Cells["LineNo"].Value   = grdPRDetail.Rows.Count;
                 grdPRDetail.Rows[i].Cells["Item"].Value     = po.StockItemID;
                 grdPRDetail.Rows[i].Cells["ItemDesc"].Value = po.StockItemName;
                 grdPRDetail.Rows[i].Cells["TaxCode"].Value  = po.TaxCode;
                 grdPRDetail.Rows[i].Cells["Quantity"].Value = po.Quantity;
                 grdPRDetail.Rows[i].Cells["Price"].Value    = po.Price;
                 grdPRDetail.Rows[i].Cells["Tax"].Value      = po.Tax;
                 double valu = po.Price * po.Quantity + po.Tax;
                 grdPRDetail.Rows[i].Cells["Value"].Value = valu;
                 count += valu;
                 i++;
             }
             txtTotalValue.Text = count.ToString();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in POOut");
         }
     }
     else if (docID == "WORKORDER")
     {
         try
         {
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in WorkOrder");
         }
     }
     else if (docID == "POGENERAL")
     {
         try
         {
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in POgeneral");
         }
     }
     else if (docID == "POINVOICEIN" || docID == "WOINVOICEIN" || docID == "POGENERALINVOICEIN")
     {
         try
         {
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in InvoiceIn");
         }
     }
     else if (docID == "PRODUCTINVOICEOUT" || docID == "SERVICEINVOICEOUT")
     {
         try
         {
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error in InvoiceOut");
         }
     }
 }
Ejemplo n.º 8
0
 private void grdList_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.RowIndex < 0)
         {
             return;
         }
         string colname = grdList.Columns[e.ColumnIndex].Name;
         if (colname == "Select")
         {
             foreach (DataGridViewRow row in grdList.Rows)
             {
                 if (Convert.ToBoolean(row.Cells["Select"].Value) == true && row.Index != e.RowIndex)
                 {
                     row.Cells["Select"].Value = false;
                 }
             }
         }
         if (colname == "Change")
         {
             try
             {
                 if (Convert.ToBoolean(grdList.Rows[e.RowIndex].Cells["Select"].Value) != true)
                 {
                     MessageBox.Show("Current Row Not Selected.\nPlease check before Closing PO");
                     return;
                 }
                 DialogResult dialog = MessageBox.Show("Are you sure to CLose PAF document ?", "Yes", MessageBoxButtons.YesNo);
                 if (dialog == DialogResult.No)
                 {
                     return;
                 }
                 var checkedRows = from DataGridViewRow r in grdList.Rows
                                   where Convert.ToBoolean(r.Cells["Select"].Value) == true
                                   select r;
                 int selectedRowCount = checkedRows.Count();
                 if (selectedRowCount != 1)
                 {
                     MessageBox.Show("Select one PO");
                     return;
                 }
                 Selectedpopih               = new popiheader();
                 Selectedpopih.DocumentID    = grdList.Rows[e.RowIndex].Cells["gDocumentID"].Value.ToString();
                 Selectedpopih.TemporaryNo   = Convert.ToInt32(grdList.Rows[e.RowIndex].Cells["gTemporaryNo"].Value.ToString());
                 Selectedpopih.TemporaryDate = Convert.ToDateTime(grdList.Rows[e.RowIndex].Cells["gTemporaryDate"].Value);
                 string       type      = cmbProdType.SelectedItem.ToString();
                 string       POPIDocID = getPOPIDocID(type);
                 POPIHeaderDB popidb    = new POPIHeaderDB();
                 if (popidb.updatePAFPOInwardCLosingNew(Selectedpopih, POPIDocID))
                 {
                     MessageBox.Show("PAF ProductInward Document Closed Sucessfully");
                     ListFilteredApprovePAFTracks();
                     grdList.Visible = true;
                 }
                 else
                 {
                     MessageBox.Show("Failed to close PAF Product Inward Document");
                     ListFilteredApprovePAFTracks();
                     grdList.Visible = true;
                 }
             }
             catch (Exception ex)
             {
             }
         }
     }
     catch (Exception ex)
     {
     }
 }