Ejemplo n.º 1
0
 private void btn_New_Monthlyinvoice_Click(object sender, EventArgs e)
 {
     Ordermanagement_01.Tax.Tax_Monthly_Invoice monthly_invoice = new Ordermanagement_01.Tax.Tax_Monthly_Invoice(userid, "Insert", "0000", 0, 0, 0, "", "", "");
     monthly_invoice.Show();
 }
Ejemplo n.º 2
0
        private void grd_Monthly_Invoice_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (e.ColumnIndex == 2)
                {
                    //viewing the information
                    string invoiceno    = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[2].Value.ToString();
                    int    invoiceid    = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[13].Value.ToString());
                    int    clientid     = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[14].Value.ToString());
                    int    subprocessid = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[15].Value.ToString());
                    string invoicedate  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[10].Value.ToString();
                    string invoice_cmt  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[16].Value.ToString();
                    string invoice_mon  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[17].Value.ToString();
                    Ordermanagement_01.Tax.Tax_Monthly_Invoice monthly = new Ordermanagement_01.Tax.Tax_Monthly_Invoice(userid, "VIEW", invoiceno, invoiceid, clientid, subprocessid, invoicedate, invoice_cmt, invoice_mon);
                    monthly.Show();
                }

                else if (e.ColumnIndex == 11)
                {
                    //view the reports
                    int invoiceid = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[13].Value.ToString());
                    int clientid  = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[14].Value.ToString());
                    Ordermanagement_01.Tax.Tax_Invoice_Reports.Tax_Monthly_Invoice_rpt monthly11 = new Ordermanagement_01.Tax.Tax_Invoice_Reports.Tax_Monthly_Invoice_rpt(invoiceid, clientid);
                    monthly11.Show();
                }
                else if (e.ColumnIndex == 12)
                {
                    //email sending
                    form_loader.Start_progres();
                    DialogResult dialog = MessageBox.Show("Do you want to send Tax Monthly Invoice", "Send mail Confirmation", MessageBoxButtons.YesNo);
                    if (dialog == DialogResult.Yes)
                    {
                        int    invoiceid    = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[13].Value.ToString());
                        int    clientid     = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[14].Value.ToString());
                        int    subprocessid = int.Parse(grd_Monthly_Invoice.Rows[e.RowIndex].Cells[15].Value.ToString());
                        string invoiceno    = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[2].Value.ToString();
                        string invoicedate  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[10].Value.ToString();
                        string invoice_cmt  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[16].Value.ToString();
                        string invoice_mon  = grd_Monthly_Invoice.Rows[e.RowIndex].Cells[17].Value.ToString();
                        //int USER_ID, string OPERATION, string INV_NUM,int INVOICE_ID,int CLIENT_ID,int SUB_PROCESS_ID,string INVOICE_DATE,string INVOICE_COMMENTS,string INVOICE_MONTH
                        Ordermanagement_01.Tax.Tax_Invoice_Send_Email email = new Ordermanagement_01.Tax.Tax_Invoice_Send_Email(invoiceid, clientid, subprocessid, userid, invoiceno, invoicedate, invoice_cmt, invoice_mon);
                        // email.Show();
                        Hashtable htck = new Hashtable();
                        DataTable dtck = new DataTable();
                        htck.Add("@Trans", "CHECK_TAX_INVOICE_EMAIL_STATUS");
                        htck.Add("@Tax_MonthlyInvoice_Id", invoiceid);
                        dtck = dataaccess.ExecuteSP("Sp_Tax_Monthly_Invoice_Entry", htck);
                        if (dtck.Rows.Count > 0)
                        {
                            if (dtck.Rows[0]["Email_Status"].ToString() == "True")
                            {
                                MessageBox.Show("Tax Monthly Invoice Sent successfully");
                            }
                            else
                            {
                                //MessageBox.Show("Tax Monthly Invoice ");
                            }
                        }
                    }
                    Bind_Monthly_Invoice_data();
                }
            }
        }