private void button1_Click(object sender, EventArgs e) { Report_Viewercs rp = new Report_Viewercs(); rp.open = "0.00"; rp.close = textBox2.Text; rp.name = comboBox1.Text; rp.city = comboBox2.Text; rp.loadrpt("Ledger"); rp.ShowDialog(); }
private void btn_summary_Click(object sender, EventArgs e) { dateselection frm = new dateselection(); if (frm.ShowDialog() == DialogResult.OK) { Report_Viewercs rp = new Report_Viewercs(); rp.datefrom = frm.datefrom; rp.dateto = frm.dateto; rp.loadrpt("Summary"); rp.ShowDialog(); } }
private void button2_Click(object sender, EventArgs e) { int x = save(); if (company == 0 && x == 1) { Report_Viewercs rpt = new Report_Viewercs(); //if (checkBox1.Checked == false) rpt.loadrpt("recepit"); //else //rpt.loadrpt("recepitbank"); rpt.Show(); } company = 1; }
private void button2_Click(object sender, EventArgs e) { con.exeNonQurey("delete from groupbalance"); string name, balance; string place = "Pending Reciveables"; for (int i = 0; i < dataGridView1.Rows.Count; i++) { name = dataGridView1.Rows[i].Cells[0].Value.ToString(); balance = dataGridView1.Rows[i].Cells[1].Value.ToString(); if (balance == "") { balance = "NULL"; } con.exeNonQurey(string.Format("insert into groupbalance values('{0}',{1},'{2}')", name, balance, place)); } Report_Viewercs rv = new Report_Viewercs(); rv.loadrpt("groupbalance"); rv.ShowDialog(); }
private void save(int button) { if (level != 3) { con.exeNonQurey("delete from groupbalance"); for (int i = 0; i < dataGridView1.Rows.Count; i++) { string name, bal, place; if (level == 1) { name = dataGridView1.Rows[i].Cells[0].Value.ToString(); bal = dataGridView1.Rows[i].Cells[1].Value.ToString(); place = "City Wise Debtors List"; } else { name = dataGridView1.Rows[i].Cells[0].Value.ToString() + " " + dataGridView1.Rows[i].Cells[1].Value.ToString(); bal = dataGridView1.Rows[i].Cells[2].Value.ToString(); place = comboBox3.Text + " Debtors List"; } if (bal == "") { bal = "NULL"; } con.exeNonQurey(string.Format("insert into groupbalance values('{0}',{1},'{2}')", name, bal, place)); } Report_Viewercs rv = new Report_Viewercs(); rv.loadrpt("groupbalance"); rv.ShowDialog(); } else { con.exeNonQurey("delete from printledger"); con.exeNonQurey("delete from ledgerdetail"); string name, city, datefrom, dateto, caldays, intper, caldate, openbal, openint, payment; string recepit, intrest, closingbal, closeint; name = comboBox1.Text + " " + comboBox3.Text; city = comboBox3.Text; datefrom = dateTimePicker1.Text.ToString().Split(Convert.ToChar(" "))[0]; dateto = dateTimePicker2.Text.ToString().Split(Convert.ToChar(" "))[0]; caldays = textBox2.Text; int x; if (caldays == "") { caldays = "60"; } if (!int.TryParse(caldays, out x)) { caldays = "60"; } intper = validatedouble(textBox3.Text); caldate = dateTimePicker3.Text.ToString().Split(Convert.ToChar(" "))[0]; openbal = validatedouble(textBox4.Text); openint = validatedouble(textBox5.Text); payment = textBox6.Text; recepit = validatedouble(textBox7.Text); intrest = textBox8.Text; closeint = validatedouble(textBox9.Text); closingbal = validatedouble(textBox10.Text); con.exeNonQurey(string.Format("insert into ledgerdetail values('{0}','{1}','{2}','{3}',{4},{5},'{6}',{7},{8},{9},{10},{11},{12},{13})", name, city, datefrom, dateto, caldays, intper, caldate, openbal, openint, payment, recepit, intrest, closingbal, closeint)); string nam = comboBox1.Text + " " + comboBox3.Text; if (button == 1 && textBox5.Text != "0.00") { con.exeNonQurey(string.Format("insert into printledger(date,detail,exp,payment,recepit,days,intrest,name) values('{0}','{1}',{2},{3},{4},{5},{6},'{7}')", dateTimePicker1.Text.ToString().Split(Convert.ToChar(" "))[0], "Due Int. upto " + dateTimePicker3.Text.ToString().Split(Convert.ToChar(" "))[0], "NULL", "NULL", "NULL", "NULL", openint, nam)); } for (int i = 0; i < dataGridView1.Rows.Count; i++) { string ldate = dataGridView1.Rows[i].Cells[0].Value.ToString(); string ldetail = transtype(dataGridView1.Rows[i].Cells[1].Value.ToString()) + " " + dataGridView1.Rows[i].Cells[2].Value.ToString(); string lexp = getdatagridvalue(i, 3); string lpayment = getdatagridvalue(i, 4); string lrecepit = getdatagridvalue(i, 5); string ldays = getdatagridvalue(i, 6); string lintrest = getdatagridvalue(i, 7); con.exeNonQurey(string.Format("insert into printledger(date,detail,exp,payment,recepit,days,intrest,name) values('{0}','{1}',{2},{3},{4},{5},{6},'{7}')", ldate, ldetail, lexp, lpayment, lrecepit, ldays, lintrest, nam)); } if (button == 0) { Report_Viewercs rv = new Report_Viewercs(); rv.loadrpt("newledger"); rv.ShowDialog(); } else { Report_Viewercs rv = new Report_Viewercs(); rv.loadrpt("intrestledger"); rv.ShowDialog(); } } }
private void dataGridView1_DoubleClick(object sender, EventArgs e) { Report_Viewercs rv; string x = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["transtype"].Value.ToString(); string y = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["id"].Value.ToString(); if (x == "Bill") { string billno = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["Detail"].Value.ToString(); string date = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["date of trans"].Value.ToString(); DateTime datevar = DateTime.ParseExact(date, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture); if (billno[0] == 'M') { billno = billno.Substring(1); con.exeNonQurey(string.Format("exec temp_manual_bill_allocate {0} , '{1}', '{2}'", billno, date, VatGst.CurrentTaxStr(datevar))); } else { con.exeNonQurey(string.Format("exec temp_bill_allocate {0}, '{1}'", billno, VatGst.CurrentTaxStr(datevar))); } rv = new Report_Viewercs(); rv.loadrpt("worg1"); rv.ShowDialog(); } if (x == "Recepit") { string recepitno = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["detail"].Value.ToString(); DataTable dt; if (recepitno[0] == 'M') { recepitno = recepitno.Substring(1); string date = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["date of trans"].Value.ToString(); string query = "select recepitno , dbo.inddatevar(date) as date , name , city , amount , cd , total , billno , through , '' as manualrecepit , note from view_manual_recepit where recepitno = {0} and date = dbo.indvardate('{1}')"; query += " union select manualrecepit as recepitno , dbo.inddatevar(date) as date , name , city , amount , cd , total , billno , through , '' as manualrecepit , note from view_recepit where manualrecepit like('%{0}%')"; dt = con.getTable(string.Format(query, recepitno, date)); } else { dt = con.getTable(string.Format("select recepitno , dbo.inddatevar(date) as date , name , city , amount , cd , total , billno , through , manualrecepit , note from view_recepit where recepitno = {0}", recepitno)); } string rupeeword = ""; Vardhman.App_Code.number.num2text(Convert.ToInt32(Convert.ToDouble(dt.Rows[0][6].ToString()))); con.exeNonQurey("delete from temp_recepit"); if (dt.Rows[0][9].ToString() == "0") { dt.Rows[0][9] = ""; } if (dt.Rows[0][7].ToString() == "0" || dt.Rows[0][7].ToString().Trim() == "" || dt.Rows[0][7].ToString().ToLower() == "null") { dt.Rows[0][7] = " -----"; } rupeeword = Vardhman.App_Code.number.num2text(Convert.ToInt32(Convert.ToDouble(dt.Rows[0][6].ToString()))); con.exeNonQurey(string.Format("insert into temp_recepit(recepitno , date , customername , city , amount , cd , total , rupeeword , billno , through , manualrecepit , note) values({0} ,dbo.inddatevar(dbo.indvardate('{1}')) ,'{2}' ,'{3}' , {4},{5},{6},'{7}','{8}' , '{9}' , '{10}' , '{11}' )", dt.Rows[0][0], dt.Rows[0][1], dt.Rows[0][2] + " " + dt.Rows[0][3], dt.Rows[0][3], dt.Rows[0][4], dt.Rows[0][5], dt.Rows[0][6], rupeeword, dt.Rows[0][7], dt.Rows[0][8], dt.Rows[0][9], dt.Rows[0][10])); rv = new Report_Viewercs(); rv.loadrpt("recepit"); rv.ShowDialog(); } if (x == "Chk Bounse") { } if (x == "Chk Bounse Panelty") { } if (x == "RecepitBank") { string recepitno = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex].Cells["id"].Value.ToString(); DataTable dt = con.getTable(string.Format("select recepitno , dbo.inddatevar(date) as date , name , city , amount , cd , total , billno , through , bank , checknumber from view_recepit where id = {0} ", recepitno)); string rupeeword = ""; Vardhman.App_Code.number.num2text(Convert.ToInt32(Convert.ToDouble(dt.Rows[0][6].ToString()))); con.exeNonQurey("delete from temp_recepit"); con.exeNonQurey(string.Format("insert into temp_recepit(recepitno , date , customername , city , amount , cd , total , rupeeword , billno , through , bankname , checknumber ) values({0} ,dbo.inddatevar(dbo.indvardate('{1}')) ,'{2}' ,'{3}' , {4},{5},{6},'{7}',{8} , '{9}' , '{10}' , '{11}')", dt.Rows[0][0], dt.Rows[0][1], dt.Rows[0][2], dt.Rows[0][3], dt.Rows[0][4], dt.Rows[0][5], dt.Rows[0][6], rupeeword, dt.Rows[0][7], dt.Rows[0][8], dt.Rows[0][9], dt.Rows[0][10])); rv = new Report_Viewercs(); rv.loadrpt("recepitbank"); rv.ShowDialog(); } }