// public void bindcustgroup() //{ // try // { // DataTable dtbtype = new DataTable(); // dtbtype = bal.getCustomerGroupNameBAL(lblloginid.Text); // if (dtbtype.Rows.Count > 0) // { // dpcustgroup.DataSource = dtbtype; // dpcustgroup.DataTextField = "Name"; // dpcustgroup.DataValueField = "Groupno"; // dpcustgroup.DataBind(); // } // dpcustgroup.Items.Insert(0, new ListItem("----Select Group----", "0")); // } // catch (Exception ex) // { // Getconnection.SiteErrorInsert(ex); // } //} public string getmaxcomno() { string s = string.Empty, id = string.Empty; Getconnection c = new Getconnection(); try { string s1 = "select Top (1) No from tbl_Customer_Noseries order By Id DESC"; SqlCommand cmd11 = new SqlCommand(s1, c.getconnection()); if (cmd11.ExecuteScalar() != null) { id = cmd11.ExecuteScalar().ToString(); } c.CloseConnection(); int fid = 0; if (id.Equals("")) { id = "1"; fid = Convert.ToInt32(id); } else { fid = Convert.ToInt32(id); fid = fid + 1; } s = fid.ToString(); lblcomno.Text = s.ToString(); //hfMaxEntryNo.Value = fid.ToString(); bal.tbl_Customer_Noseries_InsertBAL(s, "", ""); } catch (Exception ex) { //txtinqno.Text = "1"; } finally { c.CloseConnection(); } return(s); }
public string getInquiryNo() { string s = string.Empty, id = string.Empty; Getconnection c = new Getconnection(); try { string s1 = "select Top (1) QuotationNo from Quotation_Master order By Id DESC"; SqlCommand cmd11 = new SqlCommand(s1, c.getconnection()); if (cmd11.ExecuteScalar() != null) { id = cmd11.ExecuteScalar().ToString(); } c.CloseConnection(); int fid = 0; if (id.Equals("")) { id = "1"; fid = Convert.ToInt32(id); } else { fid = Convert.ToInt32(id); fid = fid + 1; } s = fid.ToString(); txtno.Text = s.ToString(); //hfMaxEntryNo.Value = fid.ToString(); } catch (Exception ex) { txtno.Text = "1"; } finally { c.CloseConnection(); } return(s); }