Ejemplo n.º 1
0
        private void btnprint_Click(object sender, EventArgs e)
        {
            Printing   prn  = new Printing();
            Connection conn = new Connection();

            try
            {
                DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1 and CompanyID='" + Master.companyId + "' ");
                prn.execute("delete from printing");
                int j           = 1;
                int ClientCount = 0;
                for (int i = 0; i < LVclient.Items.Count; i++)
                {
                    if (Convert.ToBoolean(LVclient.Items[i].Checked) == true)
                    {
                        string AccountName = "", PrintName = "", Group = "", Opbal = "", DrCr = "", Address = "", City = "", State = "", Phone = "", Mobile = "", Email = "", GstNo = "", AadharNo = "";
                        AccountName = LVclient.Items[i].SubItems[2].Text;
                        PrintName   = LVclient.Items[i].SubItems[3].Text;
                        Group       = LVclient.Items[i].SubItems[4].Text;
                        Opbal       = LVclient.Items[i].SubItems[5].Text;
                        DrCr        = LVclient.Items[i].SubItems[6].Text;
                        Address     = LVclient.Items[i].SubItems[7].Text;
                        City        = LVclient.Items[i].SubItems[8].Text;
                        State       = LVclient.Items[i].SubItems[9].Text;
                        Phone       = LVclient.Items[i].SubItems[10].Text;
                        Mobile      = LVclient.Items[i].SubItems[11].Text;
                        Email       = LVclient.Items[i].SubItems[12].Text;
                        GstNo       = LVclient.Items[i].SubItems[13].Text;
                        AadharNo    = LVclient.Items[i].SubItems[14].Text;
                        string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28)VALUES";
                        qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + AccountName + "','" + PrintName + "','" + Group + "','" + Opbal + "','" + DrCr + "','" + Address + "','" + City + "','" + State + "','" + Phone + "','" + Mobile + "','" + Email + "','" + GstNo + "','" + AadharNo + "')";
                        prn.execute(qry);
                        ClientCount++;
                    }
                    if (ClientCount == 0)
                    {
                        MessageBox.Show("Please Check Atlist One Account Name For Printing.");
                        return;
                    }
                }
                Print popup = new Print("AccountReport");
                popup.ShowDialog();
                popup.Dispose();
            }
            catch (Exception excp)
            {
            }
        }
Ejemplo n.º 2
0
        private void btnprint_Click(object sender, EventArgs e)
        {
            Printing prndata = new Printing();

            if (grdstock.Rows.Count > 0)
            {
                DialogResult dr1 = MessageBox.Show("Do you want to Print Stock Report?", "Stock Report", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr1 == DialogResult.Yes)
                {
                    DataTable dt  = new DataTable();
                    DataTable dt1 = cs.getdataset("select * from company WHERE isactive=1");
                    dt = (DataTable)grdstock.DataSource;
                    prndata.execute("delete from printing");
                    int j = 1;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        string Opstock = "", ClosingStock = "", Purchase = "", Sale = "", PurchaseReturn = "", SaleReturn = "", total = "", possale = "", production = "";
                        string ItemName = "", company = "", Itemcode = "";
                        Itemcode       = dt.Rows[i][0].ToString();
                        ItemName       = dt.Rows[i][1].ToString();
                        company        = dt.Rows[i][2].ToString();
                        Opstock        = dt.Rows[i][3].ToString();
                        Purchase       = dt.Rows[i][4].ToString();
                        Sale           = dt.Rows[i][5].ToString();
                        possale        = dt.Rows[i][6].ToString();
                        SaleReturn     = dt.Rows[i][7].ToString();
                        PurchaseReturn = dt.Rows[i][8].ToString();
                        production     = dt.Rows[i][9].ToString();
                        ClosingStock   = dt.Rows[i][10].ToString();
                        total          = dt.Rows[i][11].ToString();
                        string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36)VALUES";
                        qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + ItemName + "','" + company + "','" + Opstock + "','" + Purchase + "','" + Sale + "','" + SaleReturn + "','" + PurchaseReturn + "','" + ClosingStock + "','" + total + "','" + txt1.Text + "','" + txt2.Text + "','" + txt3.Text + "','" + txt4.Text + "','" + txt5.Text + "','" + txt6.Text + "','" + txt7.Text + "','" + txt8.Text + "','" + possale + "','" + production + "','" + txt9.Text + "','" + Itemcode + "')";
                        prndata.execute(qry);
                    }
                    string reportName = "StockEvaluation";
                    //  string reportName = "Sale";
                    Print popup = new Print(reportName);
                    popup.ShowDialog();
                    popup.Dispose();
                }
            }
            else
            {
                MessageBox.Show("No Records For Print..");
            }
        }
Ejemplo n.º 3
0
        private void btnlabel_Click(object sender, EventArgs e)
        {
            Printing   prn  = new Printing();
            Connection conn = new Connection();

            try
            {
                DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1 and CompanyID='" + Master.companyId + "' ");
                prn.execute("delete from printing");
                int j = 1;
                if (LVclient.SelectedItems.Count > 0)
                {
                    string AccountName = "", PrintName = "", Group = "", Opbal = "", DrCr = "", Address = "", City = "", State = "", Phone = "", Mobile = "", Email = "", GstNo = "", AadharNo = "";
                    AccountName = LVclient.SelectedItems[0].SubItems[2].Text;
                    PrintName   = LVclient.SelectedItems[0].SubItems[3].Text;
                    Group       = LVclient.SelectedItems[0].SubItems[4].Text;
                    Opbal       = LVclient.SelectedItems[0].SubItems[5].Text;
                    DrCr        = LVclient.SelectedItems[0].SubItems[6].Text;
                    Address     = LVclient.SelectedItems[0].SubItems[7].Text;
                    City        = LVclient.SelectedItems[0].SubItems[8].Text;
                    State       = LVclient.SelectedItems[0].SubItems[9].Text;
                    Phone       = LVclient.SelectedItems[0].SubItems[10].Text;
                    Mobile      = LVclient.SelectedItems[0].SubItems[11].Text;
                    Email       = LVclient.SelectedItems[0].SubItems[12].Text;
                    GstNo       = LVclient.SelectedItems[0].SubItems[13].Text;
                    AadharNo    = LVclient.SelectedItems[0].SubItems[14].Text;
                    string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28)VALUES";
                    qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + AccountName + "','" + PrintName + "','" + Group + "','" + Opbal + "','" + DrCr + "','" + Address + "','" + City + "','" + State + "','" + Phone + "','" + Mobile + "','" + Email + "','" + GstNo + "','" + AadharNo + "')";
                    prn.execute(qry);

                    Print popup = new Print("AccountLabel");
                    popup.ShowDialog();
                    popup.Dispose();
                }
                else
                {
                    MessageBox.Show("Select Account First");
                }
            }
            catch (Exception excp)
            {
            }
        }
Ejemplo n.º 4
0
        private void btnCalculator_Click(object sender, EventArgs e)
        {
            try
            {
                Printing prndata = new Printing();
                if (LVcs.Items.Count > 0)
                {
                    prndata.execute("delete from printing");
                    DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1");
                    int       j   = 1;
                    for (int i = 0; i < LVcs.Items.Count; i++)
                    {
                        string Customername = "", opstock = "", Address = "", City = "", State = "", StateCode = "", PhNo = "", MobileNo = "", Email = "", Gstno = "", FromDateToDate = "";
                        Customername = LVcs.Items[i].SubItems[0].Text;
                        opstock      = LVcs.Items[i].SubItems[1].Text;
                        Address      = LVcs.Items[i].SubItems[2].Text;
                        City         = LVcs.Items[i].SubItems[3].Text;
                        State        = LVcs.Items[i].SubItems[4].Text;
                        StateCode    = LVcs.Items[i].SubItems[5].Text;
                        PhNo         = LVcs.Items[i].SubItems[6].Text;
                        MobileNo     = LVcs.Items[i].SubItems[7].Text;
                        Email        = LVcs.Items[i].SubItems[8].Text;
                        Gstno        = LVcs.Items[i].SubItems[9].Text;

                        FromDateToDate = cmbcors.Text + " List ";
                        string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23)VALUES";
                        qry += "('" + j++ + "','" + dt1.Rows[0]["SubName"].ToString() + "','" + dt1.Rows[0]["Address"].ToString() + "','" + dt1.Rows[0]["Address2"].ToString() + "','" + dt1.Rows[0]["City"].ToString() + "','" + dt1.Rows[0]["State"].ToString() + "','" + dt1.Rows[0]["Country"].ToString() + "','" + dt1.Rows[0]["Phone"].ToString() + "','" + dt1.Rows[0]["Mobile"].ToString() + "','" + dt1.Rows[0]["Email"].ToString() + "','" + dt1.Rows[0]["Website"].ToString() + "','" + FromDateToDate + "','" + dt1.Rows[0]["CSTNO"].ToString() + "','" + Customername + "','" + opstock + "','" + Address + "','" + City + "','" + State + "','" + StateCode + "','" + PhNo + "','" + MobileNo + "','" + Email + "','" + Gstno + "')";
                        prndata.execute(qry);
                    }
                    Print popup = new Print("CustomerSupplier");
                    popup.ShowDialog();
                    popup.Dispose();
                }
                else
                {
                    MessageBox.Show("No Records For Printing..");
                }
            }
            catch (Exception excp)
            {
            }
        }
Ejemplo n.º 5
0
        private void btnCalculator_Click(object sender, EventArgs e)
        {
            try
            {
                Printing prndata = new Printing();
                if (lvqp.Items.Count > 0)
                {
                    prndata.execute("delete from printing");
                    DataTable dt1 = conn.getdataset("select * from company WHERE isactive=1");
                    int       j   = 1;
                    for (int i = 0; i < lvqp.Items.Count; i++)
                    {
                        string date = "", Reciptno = "", PaymentMode = "", AccountName = "", Remarks = "", TotalAmount = "", FromDateToDate = "";
                        date        = lvqp.Items[i].SubItems[0].Text;
                        Reciptno    = lvqp.Items[i].SubItems[1].Text;
                        PaymentMode = lvqp.Items[i].SubItems[2].Text;
                        AccountName = lvqp.Items[i].SubItems[3].Text;
                        Remarks     = lvqp.Items[i].SubItems[4].Text;
                        TotalAmount = lvqp.Items[i].SubItems[5].Text;
                        // batch = lvqp.Items[i].SubItems[6].Text;
                        //  Qty = lvqp.Items[i].SubItems[7].Text;
                        //  AltQty = lvqp.Items[i].SubItems[8].Text;

                        FromDateToDate = "QUICK PAYMENT REGISTER FROM " + DTPFrom.Text + " TO " + DTPTo.Text;
                        string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18)VALUES";
                        qry += "('" + dt1.Rows[0]["SubName"].ToString() + "','" + dt1.Rows[0]["Address"].ToString() + "','" + dt1.Rows[0]["Address2"].ToString() + "','" + dt1.Rows[0]["City"].ToString() + "','" + dt1.Rows[0]["State"].ToString() + "','" + dt1.Rows[0]["Country"].ToString() + "','" + dt1.Rows[0]["Phone"].ToString() + "','" + dt1.Rows[0]["Mobile"].ToString() + "','" + dt1.Rows[0]["Email"].ToString() + "','" + dt1.Rows[0]["Website"].ToString() + "','" + FromDateToDate + "','" + dt1.Rows[0]["CSTNO"].ToString() + "','" + date + "','" + Reciptno + "','" + PaymentMode + "','" + AccountName + "','" + Remarks + "','" + TotalAmount + "')";
                        prndata.execute(qry);
                    }
                    Print popup = new Print("QuickPaymentRegister");
                    popup.ShowDialog();
                    popup.Dispose();
                }
                else
                {
                    MessageBox.Show("No Records For Printing..");
                }
            }
            catch (Exception excp)
            {
            }
        }
Ejemplo n.º 6
0
        private void btnPrint_Click(object sender, EventArgs e)
        {
            DataTable dt = (DataTable)grdData.DataSource;

            try
            {
                Printing prndata = new Printing();
                if (dt.Rows.Count > 0)
                {
                    prndata.execute("delete from printing");
                    DataTable dt1 = cs.getdataset("select * from company WHERE isactive=1");
                    int       j   = 1;
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        string Billdate = "", billno = "", AccountName = "", ProductName = "", Batch = "", Rate = "";
                        Billdate    = dt.Rows[i]["Bill_Date"].ToString();
                        billno      = dt.Rows[i]["billno"].ToString();
                        AccountName = dt.Rows[i]["AccountName"].ToString();
                        ProductName = dt.Rows[i]["Productname"].ToString();
                        Batch       = dt.Rows[i]["batch"].ToString();
                        Rate        = dt.Rows[i]["Rate"].ToString();
                        string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24)VALUES";
                        qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + Billdate + "','" + billno + "','" + AccountName + "','" + ProductName + "','" + Batch + "','" + Rate + "','" + txtTotalRate.Text + "','" + txtTotalQty.Text + "','" + txtTotalAmount.Text + "')";
                        prndata.execute(qry);
                    }
                    Print popup = new Print("SalePurchaseDetailsReport");
                    popup.ShowDialog();
                    popup.Dispose();
                }
                else
                {
                    MessageBox.Show("No Records For Printing..");
                }
            }
            catch (Exception excp)
            {
            }
        }
Ejemplo n.º 7
0
 private void btnprint_Click(object sender, EventArgs e)
 {
     try
     {
         Printing prndata = new Printing();
         if (LVclient.Items.Count > 0)
         {
             prndata.execute("delete from printing");
             DataTable dt1 = con1.getdataset("select * from company WHERE isactive=1");
             int       j   = 1;
             for (int i = 0; i < LVclient.Items.Count; i++)
             {
                 string itemname = "", CompanyName = "", GroupName = "", Unit = "", SalePrice = "", MRP = "", PurchasePrice = "";
                 itemname      = LVclient.Items[i].SubItems[1].Text;
                 CompanyName   = LVclient.Items[i].SubItems[2].Text;
                 GroupName     = LVclient.Items[i].SubItems[3].Text;
                 Unit          = LVclient.Items[i].SubItems[4].Text;
                 SalePrice     = LVclient.Items[i].SubItems[5].Text;
                 MRP           = LVclient.Items[i].SubItems[6].Text;
                 PurchasePrice = LVclient.Items[i].SubItems[7].Text;
                 string qry = "INSERT INTO Printing(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22)VALUES";
                 qry += "('" + j++ + "','" + dt1.Rows[0][0].ToString() + "','" + dt1.Rows[0][1].ToString() + "','" + dt1.Rows[0][2].ToString() + "','" + dt1.Rows[0][3].ToString() + "','" + dt1.Rows[0][4].ToString() + "','" + dt1.Rows[0][5].ToString() + "','" + dt1.Rows[0][6].ToString() + "','" + dt1.Rows[0][7].ToString() + "','" + dt1.Rows[0][8].ToString() + "','" + dt1.Rows[0][9].ToString() + "','" + dt1.Rows[0][10].ToString() + "','" + dt1.Rows[0][11].ToString() + "','" + dt1.Rows[0][12].ToString() + "','" + dt1.Rows[0][13].ToString() + "','" + itemname + "','" + CompanyName + "','" + GroupName + "','" + Unit + "','" + SalePrice + "','" + MRP + "','" + PurchasePrice + "')";
                 prndata.execute(qry);
             }
             Print popup = new Print("ItemReport");
             popup.ShowDialog();
             popup.Dispose();
         }
         else
         {
             MessageBox.Show("No Records For Printing..");
         }
     }
     catch (Exception excp)
     {
     }
 }