Пример #1
0
 private void textBox2_TextChanged(object sender, EventArgs e)
 {
     try
     {
         textBox5.Text = Vardhman.App_Code.number.num2text(Convert.ToInt32(Convert.ToDouble(textBox4.Text)));
     }
     catch { }
     try
     {
         double val        = Convert.ToDouble(textBox4.Text);
         double maxRecepit = VatGst.MaxRecepitAmount(dateTimePicker1.Value);
         if (val > maxRecepit)
         {
             MessageBox.Show(String.Format("Amount exceeded limit its above {0}", maxRecepit));
         }
     }
     catch { }
 }
Пример #2
0
        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();
            }
        }