private void textBox18_KeyPress(object sender, KeyPressEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("PriceList", typeof(string)); dtcombo.Rows.Add(); dtcombo.Rows[0][0] = Feature.Available("Name of PriceList1"); dtcombo.Rows.Add(); dtcombo.Rows[1][0] = Feature.Available("Name of PriceList2"); dtcombo.Rows.Add(); dtcombo.Rows[2][0] = Feature.Available("Name of PriceList3"); dtcombo.Rows.Add(); dtcombo.Rows[3][0] = Feature.Available("Name of PriceList4"); dtcombo.Rows.Add(); dtcombo.Rows[4][0] = Feature.Available("Name of PriceList5"); dtcombo.Rows.Add(); dtcombo.Rows[5][0] = Feature.Available("Name of PriceList6"); textBox18.Text = SelectCombo.ComboDt(this, dtcombo, 0); SendKeys.Send("{tab}"); }
private void textBox2_KeyDown(object sender, KeyEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("PriceList", typeof(string)); dtcombo.Rows.Add(); dtcombo.Rows[0][0] = Feature.Available("Name of PriceList1"); dtcombo.Rows.Add(); dtcombo.Rows[1][0] = Feature.Available("Name of PriceList2"); dtcombo.Rows.Add(); dtcombo.Rows[2][0] = Feature.Available("Name of PriceList3"); dtcombo.Rows.Add(); dtcombo.Rows[3][0] = Feature.Available("Name of PriceList4"); dtcombo.Rows.Add(); dtcombo.Rows[4][0] = Feature.Available("Name of PriceList5"); dtcombo.Rows.Add(); dtcombo.Rows[5][0] = Feature.Available("Name of PriceList6"); dtcombo.Rows.Add(); dtcombo.Rows[6][0] = "MRP"; textBox2.Text = SelectCombo.ComboDt(this, dtcombo, 0); SelectCombo.IsEnter(this, e.KeyCode); }
private void textBox3_KeyPress_1(object sender, KeyPressEventArgs e) { DataTable dt1 = Master.DtRates.Select().CopyToDataTable(); textBox3.Text = SelectCombo.ComboDt(this, dt1, 0); SendKeys.Send("{tab}"); }
private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e) { if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ') { if (ansGridView1.CurrentCell.OwningColumn.Name == "status") { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("Status", typeof(string)); dtcombo.Rows.Add(); dtcombo.Rows[0][0] = "Inside"; dtcombo.Rows.Add(); dtcombo.Rows[1][0] = "Outside"; dtcombo.Rows.Add(); dtcombo.Rows[2][0] = "Not Visible"; string selected = SelectCombo.ComboDt(this, dtcombo, 0); if (selected == "" || selected == null) { selected = "Not Visible"; } ansGridView1.CurrentCell.Value = selected; } } }
private void textBox18_KeyDown(object sender, KeyEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("Value", typeof(string)); dtcombo.Rows.Add(); dtcombo.Rows[0][0] = "Weight"; dtcombo.Rows.Add(); dtcombo.Rows[1][0] = "Pvalue"; textBox18.Text = SelectCombo.ComboDt(this, dtcombo, 0); SendKeys.Send("{tab}"); }
private void textBox19_KeyDown(object sender, KeyEventArgs e) { dtcal = new DataTable(); dtcal.Columns.Add("Options", typeof(string)); dtcal.Rows.Add(); dtcal.Rows[0][0] = "Allowed"; dtcal.Rows.Add(); dtcal.Rows[1][0] = "Not Allowed"; textBox19.Text = SelectCombo.ComboDt(this, dtcal, 0); }
private void textBox13_KeyDown(object sender, KeyEventArgs e) { dtcash = new DataTable(); dtcash.Columns.Add("Cash Transaction", typeof(string)); dtcash.Rows.Add(); dtcash.Rows[0][0] = "Allowed"; dtcash.Rows.Add(); dtcash.Rows[1][0] = "Not Allowed"; dtcash.Rows.Add(); dtcash.Rows[2][0] = "Only Allowed"; textBox13.Text = SelectCombo.ComboDt(this, dtcash, 0); }
private void textBox3_KeyPress(object sender, KeyPressEventArgs e) { // DataTable dt1 = Master.DtRates.Select().CopyToDataTable(); DataTable DtRates = new DataTable(); DtRates.Columns.Add("RateValue", typeof(string)); DtRates.Columns.Add("RateId", typeof(string)); DtRates.Rows.Add(); DtRates.Rows[0][0] = faspi.Feature.Available("Name of PriceList1"); DtRates.Rows[0][1] = "Purchase_rate"; DtRates.Rows.Add(); DtRates.Rows[1][0] = faspi.Feature.Available("Name of PriceList2"); DtRates.Rows[1][1] = "Retail"; DtRates.Rows.Add(); DtRates.Rows[2][0] = faspi.Feature.Available("Name of PriceList3"); DtRates.Rows[2][1] = "Wholesale"; DtRates.Rows.Add(); DtRates.Rows[3][0] = faspi.Feature.Available("Name of PriceList4"); DtRates.Rows[3][1] = "Rate_X"; DtRates.Rows.Add(); DtRates.Rows[4][0] = faspi.Feature.Available("Name of PriceList5"); DtRates.Rows[4][1] = "Rate_Y"; DtRates.Rows.Add(); DtRates.Rows[5][0] = faspi.Feature.Available("Name of PriceList6"); DtRates.Rows[5][1] = "Rate_Z"; DtRates.Rows.Add(); DtRates.Rows[6][0] = "MRP"; DtRates.Rows[6][1] = "MRP"; DtRates.Rows.Add(); DtRates.Rows[7][0] = "Rebate"; DtRates.Rows[7][1] = "Rebate"; textBox3.Text = SelectCombo.ComboDt(this, DtRates, 0); SendKeys.Send("{tab}"); }
private void textBox10_KeyPress(object sender, KeyPressEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("Options", typeof(string)); String[] strtemp = textBox4.Text.Split(';'); if (strtemp.Length != 1) { for (int j = 0; j < strtemp.Length; j++) { if (strtemp[j] != "") { dtcombo.Rows.Add(); dtcombo.Rows[j][0] = strtemp[j].ToString(); } } textBox10.Text = SelectCombo.ComboDt(this, dtcombo, 0); } else { strtemp = textBox4.Text.Split('|'); for (int j = 0; j < strtemp.Length; j++) { if (strtemp[j] != "") { dtcombo.Rows.Add(); dtcombo.Rows[j][0] = strtemp[j].ToString(); } } textBox10.Text = SelectCombo.ComboDt(this, dtcombo, 0); if (textBox10.Text != "No") { groupBox2.Visible = true; textBox10.Text = dateTimePicker1.Value.Date.ToString(Database.dformat); } else { groupBox2.Visible = false; } } }
private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("Type", typeof(string)); dtcombo.Rows.Add(); dtcombo.Rows[0][0] = "Quantity*PackValue"; dtcombo.Rows.Add(); dtcombo.Rows[1][0] = "Percentage"; dtcombo.Rows.Add(); dtcombo.Rows[2][0] = "Quantity"; dtcombo.Rows.Add(); dtcombo.Rows[3][0] = "Flat"; textBox2.Text = SelectCombo.ComboDt(this, dtcombo, 0); SendKeys.Send("{tab}"); }
private void textBox12_KeyDown(object sender, KeyEventArgs e) { dtcal = new DataTable(); dtcal.Columns.Add("CalculationType", typeof(string)); dtcal.Rows.Add(); dtcal.Rows[0][0] = "Not Applicable"; dtcal.Rows.Add(); dtcal.Rows[1][0] = "Including Tax Only"; dtcal.Rows.Add(); dtcal.Rows[2][0] = "Excluding Tax Only"; dtcal.Rows.Add(); dtcal.Rows[3][0] = "Default Including Tax"; dtcal.Rows.Add(); dtcal.Rows[4][0] = "Default Excluding Tax"; textBox12.Text = SelectCombo.ComboDt(this, dtcal, 0); }
private void textBox8_KeyPress(object sender, KeyPressEventArgs e) { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("PriceList", typeof(string)); if (Feature.Available("Name of PriceList1") != "Purchase Rate") { dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList1"); } dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList2"); dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList3"); dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList4"); dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList5"); dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = Feature.Available("Name of PriceList6"); dtcombo.Rows.Add(); dtcombo.Rows[dtcombo.Rows.Count - 1][0] = "MRP"; textBox8.Text = SelectCombo.ComboDt(this, dtcombo, 0); }
private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == ' ') { if (ansGridView1.CurrentCell.OwningColumn.Name == "Rate_Unit") { DataTable dtcombo = new DataTable(); dtcombo.Columns.Add("Unit", typeof(string)); dtcombo.Columns["Unit"].ColumnName = "Unit"; dtcombo.Rows.Add(); dtcombo.Rows[0][0] = "Pis"; dtcombo.Rows.Add(); dtcombo.Rows[1][0] = "Kg."; dtcombo.Rows.Add(); dtcombo.Rows[2][0] = "Lt."; dtcombo.Rows.Add(); dtcombo.Rows[3][0] = "Unit"; dtcombo.Rows.Add(); dtcombo.Rows[4][0] = "Meter"; dtcombo.Rows.Add(); dtcombo.Rows[5][0] = "Sq. Meter"; dtcombo.Rows.Add(); dtcombo.Rows[6][0] = "Quintal"; ansGridView1.CurrentCell.Value = SelectCombo.ComboDt(this, dtcombo, 0); } if (ansGridView1.CurrentCell.OwningColumn.Name == "Company") { strCombo = "select [name] from other where Type='SER14' order by [name]"; ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0); ansGridView1.Rows[ansGridView1.CurrentRow.Index].Cells["Company_id"].Value = funs.Select_oth_id(ansGridView1.CurrentCell.Value.ToString()); } if (ansGridView1.CurrentCell.OwningColumn.Name == "Item") { strCombo = "select [name] from other where Type='SER15' order by [name]"; ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0); ansGridView1.Rows[ansGridView1.CurrentRow.Index].Cells["Item_id"].Value = funs.Select_oth_id(ansGridView1.CurrentCell.Value.ToString()); } if (ansGridView1.CurrentCell.OwningColumn.Name == "Color") { strCombo = "select [name] from other where Type='SER18' order by [name]"; ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0); ansGridView1.Rows[ansGridView1.CurrentRow.Index].Cells["Col_id"].Value = funs.Select_oth_id(ansGridView1.CurrentCell.Value.ToString()); } if (ansGridView1.CurrentCell.OwningColumn.Name == "GroupName") { strCombo = "select [name] from other where Type='SER16' order by [name]"; ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0); ansGridView1.Rows[ansGridView1.CurrentRow.Index].Cells["Group_id"].Value = funs.Select_oth_id(ansGridView1.CurrentCell.Value.ToString()); } if (ansGridView1.CurrentCell.OwningColumn.Name == "Tax Category") { strCombo = "select category_name from taxcategory"; ansGridView1.CurrentCell.Value = SelectCombo.ComboKeypress(this, e.KeyChar, strCombo, e.KeyChar.ToString(), 0); ansGridView1.Rows[ansGridView1.CurrentRow.Index].Cells["Tax_Cat_id"].Value = funs.Select_tax_cat_id(ansGridView1.CurrentCell.Value.ToString()); } } }
private void ansGridView1_KeyPress(object sender, KeyPressEventArgs e) { if (char.IsLetter(e.KeyChar) || char.IsNumber(e.KeyChar) || e.KeyChar == ' ' || Convert.ToInt32(e.KeyChar) == 13) { if (ansGridView1.CurrentCell.OwningColumn.Name == "reffno") { DataTable dtcombo = new DataTable(); if (gvid != "") { strCombo = "select distinct '<New Refference>' as ReffNo, CAST(0.00 AS nvarchar(10)) as Amt from Account union all select case when DocNumber is null then 'Opening' Else DocNumber End as ReffNo,CAST(Amt AS nvarchar(10)) as Amt from(SELECT VOUCHERTYPE.Short + ' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) AS DocNumber, Sum(BILLADJEST.Amount) AS amt FROM (BILLADJEST LEFT JOIN VOUCHERINFO ON BILLADJEST.Reff_id = VOUCHERINFO.Vi_id) LEFT JOIN VOUCHERTYPE ON VOUCHERINFO.Vt_id = VOUCHERTYPE.Vt_id WHERE BILLADJEST.Ac_id ='" + acid + "' AND BILLADJEST.Vi_id <>'" + gvid + "' GROUP BY VOUCHERTYPE.Short +' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) HAVING (((Sum(BILLADJEST.Amount))<>0))) as res"; } else { strCombo = "select distinct '<New Refference>' as ReffNo,CAST(0.00 AS nvarchar(10)) as Amt from Account union all select Case when DocNumber is null then 'Opening' Else DocNumber End as ReffNo,CAST(Amt AS nvarchar(10)) as Amt from(SELECT VOUCHERTYPE.Short + ' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) AS DocNumber, Sum(BILLADJEST.Amount) AS amt FROM (BILLADJEST LEFT JOIN VOUCHERINFO ON BILLADJEST.Reff_id = VOUCHERINFO.Vi_id) LEFT JOIN VOUCHERTYPE ON VOUCHERINFO.Vt_id = VOUCHERTYPE.Vt_id WHERE BILLADJEST.Ac_id ='" + acid + "' GROUP BY VOUCHERTYPE.Short +' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) HAVING (((Sum(BILLADJEST.Amount))<>0))) as res"; } Database.GetSqlData(strCombo, dtcombo); ansGridView1.CurrentCell.Value = SelectCombo.ComboDt(this, dtcombo, 1); //if (ansGridView1.CurrentCell.Value != "") //{ // SendKeys.Send("{Enter}"); //} if (ansGridView1.CurrentRow.Cells["reffno"].Value == null || ansGridView1.CurrentRow.Cells["reffno"].Value.ToString() == "<New Refference>") { ansGridView1.CurrentRow.Cells["Reff_id"].Value = gvid; } else { ansGridView1.CurrentRow.Cells["Reff_id"].Value = IsDocumentNumber(ansGridView1.CurrentRow.Cells["reffno"].Value.ToString()); } dtcombo = new DataTable(); strCombo = "select distinct '<New Refference>' as ReffNo, 0 as Amt from Account union all select case when DocNumber='' then 'Opening' Else DocNumber End as ReffNo,amt from(SELECT VOUCHERTYPE.Short + ' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) AS DocNumber, Sum(BILLADJEST.Amount) AS amt FROM (BILLADJEST LEFT JOIN VOUCHERINFO ON BILLADJEST.Reff_id = VOUCHERINFO.Vi_id) LEFT JOIN VOUCHERTYPE ON VOUCHERINFO.Vt_id = VOUCHERTYPE.Vt_id WHERE (((BILLADJEST.Ac_id)='" + acid + "' )) GROUP BY VOUCHERTYPE.Short + ' ' + CONVERT(nvarchar, VOUCHERINFO.Vdate, 112) + ' ' + CAST(VOUCHERINFO.Vnumber AS nvarchar(10)) HAVING (((Sum(BILLADJEST.Amount))<>0))) as res"; Database.GetSqlData(strCombo, dtcombo); double amount = 0; if (dtcombo.Select("ReffNo='" + ansGridView1.CurrentCell.Value + "'").Length > 0) { amount = double.Parse(dtcombo.Compute("sum(amt)", " ReffNo='" + ansGridView1.CurrentCell.Value + "'").ToString()); } //if (gtype == "Receipt") //{ // if (curbal <= amount) // { // ansGridView1.CurrentRow.Cells["amount"].Value = curbal; // calcTot(); // } //} //else //{ // if (curbal <= amount) // { // ansGridView1.CurrentRow.Cells["amount"].Value = curbal; // calcTot(); // } //} ansGridView1.CurrentRow.Cells["amount"].Value = curbal; SendKeys.Send("{Enter}"); ansGridView1.Columns["amount"].ReadOnly = false; //if (gtype == "Payment") //{ // curbal = -1 * curbal; //} SendKeys.Send(curbal.ToString()); // SendKeys.Send("{Enter}"); } } }
private void textBox3_KeyPress(object sender, KeyPressEventArgs e) { DataTable DtRates = new DataTable(); DtRates.Columns.Add("RateValue", typeof(string)); DtRates.Columns.Add("RateId", typeof(string)); DtRates.Rows.Add(); DtRates.Rows[0][0] = faspi.Feature.Available("Name of PriceList1"); DtRates.Rows[0][1] = "Purchase_rate"; DtRates.Rows.Add(); DtRates.Rows[1][0] = faspi.Feature.Available("Name of PriceList2"); DtRates.Rows[1][1] = "Retail"; DtRates.Rows.Add(); DtRates.Rows[2][0] = faspi.Feature.Available("Name of PriceList3"); DtRates.Rows[2][1] = "Wholesale"; DtRates.Rows.Add(); DtRates.Rows[3][0] = faspi.Feature.Available("Name of PriceList4"); DtRates.Rows[3][1] = "Rate_X"; DtRates.Rows.Add(); DtRates.Rows[4][0] = faspi.Feature.Available("Name of PriceList5"); DtRates.Rows[4][1] = "Rate_Y"; DtRates.Rows.Add(); DtRates.Rows[5][0] = faspi.Feature.Available("Name of PriceList6"); DtRates.Rows[5][1] = "Rate_Z"; DtRates.Rows.Add(); DtRates.Rows[6][0] = "MRP"; DtRates.Rows[6][1] = "MRP"; DtRates.Rows.Add(); DtRates.Rows[7][0] = "Last Purchase Rate"; DtRates.Rows[7][1] = "Last Purchase Rate"; string rate = ""; rate = SelectCombo.ComboDt(this, DtRates, 0); textBox3.Text = rate; if (rate == "MRP") { grate = "MRP"; } else if (rate == "Last Purchase Rate") { grate = "Last Purchase Rate"; } else { grate = funs.Select_Rates_Id(rate); } }