protected void rbtnTax_CheckedChanged(object sender, EventArgs e) { if (rbtnTax.Checked == true) { rbtnSale.Checked = false; enablecontrols(); lblSaleTax.Text = "TAX INVOICE"; FillBookInvoiceNoTax(); } } //...this is the method............... public void FillBookInvoiceNoTax() { DataSet dsBook = new DataSet(); int BookNo = 0; int InvoiceNo = 0; dsBook = oAdmin.GetBookNoInvoiceNoTax1(); string BNo = dsBook.Tables[0].Rows[0][1].ToString(); string INo = dsBook.Tables[0].Rows[0][0].ToString(); if (BNo == "" && INo == "") { DataSet DsBI = new DataSet(); DsBI = oAdmin.GetBookNoInvoiceNoTax(); BookNo = Convert.ToInt32(DsBI.Tables[0].Rows[1]["BookNo"].ToString()); InvoiceNo = Convert.ToInt32(DsBI.Tables[0].Rows[1]["InvoiceNo"].ToString()); InvoiceNo = InvoiceNo - 1; } else { BookNo = Convert.ToInt32(BNo); InvoiceNo = Convert.ToInt32(INo); } if (BookNo == 0 && InvoiceNo == 0) { BookNo = 1; InvoiceNo = 1; lblBookNoS.Text = BookNo.ToString(); lblInvoiceNoS.Text = InvoiceNo.ToString(); } else if (InvoiceNo % 50 == 0) { BookNo = BookNo + 1; InvoiceNo = InvoiceNo + 1; lblBookNoS.Text = BookNo.ToString(); lblInvoiceNoS.Text = InvoiceNo.ToString(); } else { InvoiceNo = InvoiceNo + 1; lblBookNoS.Text = BookNo.ToString(); lblInvoiceNoS.Text = InvoiceNo.ToString(); } } //...............this is the claas which i am using.............. public DataSet GetBookNoInvoiceNoTax() { DataSet oDs = null; SqlDataReader oDR; string strSPName; try { strSPName = "GetBookInvoice "; oDs = oDU.GetDataSetProc(strSPName); return oDs; } catch { return oDs; } } //..............this is the second class.............. public DataSet GetBookNoInvoiceNoTax1() { DataSet oDs = null; SqlDataReader oDR; string strSPName; try { strSPName = "GetInvoceTaxpurchase "; oDs = oDU.GetDataSetProc(strSPName); return oDs; } catch { return oDs; } } //.............this is the stotr procedure first.................. ALTER PROCEDURE [dbo].[GetInvoceTaxpurchase] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT max(InvoiceNo), max(BookNo) FROM [Inventry].[dbo].[BookInvoiceTax] END //....this is the second procedure............. ALTER PROCEDURE [dbo].[GetBookInvoice] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT * from SetBookInvoice END
ALTER PROCEDURE [dbo].[GetInvoceTaxpurchase] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT max(InvoiceNo), max(BookNo) FROM BookInvoiceTax END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)