private void GetVendorClassAgainstSupplierANDBuyer() { int iBuyerCID = 0; // int iSupplierCID = 0; if (ddlCompany.Text != "Select Company Name")//Added by Mainak 2018-11-29 { iBuyerCID = Convert.ToInt32(ddlCompany.SelectedValue); Approval oApproval = new Approval(); DataSet ds = new DataSet(); string Fields = "DISTINCT New_VendorClass AS VendorClass"; string Table = "TradingRelation"; string Criteria = "BuyerCompanyID = " + iBuyerCID + " AND New_VendorClass IS NOT NULL"; ds = oApproval.GetGlobalDropDowns(Fields, Table, Criteria); ddlVendor.DataSource = ds; ddlVendor.DataBind(); ddlVendor.Items.Insert(0, "Select"); } }
private void GetVendorClassAgainstSupplierANDBuyer() { int iBuyerCID = 0; int iSupplierCID = 0; iBuyerCID = Convert.ToInt32(ddlCompany.SelectedValue); //if(Convert.ToString(ddlSupplier.SelectedValue)!="Select" ) // iSupplierCID = Convert.ToInt32(ddlSupplier.SelectedValue); if (Convert.ToString(HdSupplierId.Value) != "") { iSupplierCID = Convert.ToInt32(HdSupplierId.Value); } else { iSupplierCID = 0; } Approval oApproval = new Approval(); DataSet ds = new DataSet(); try { string Fields = "DISTINCT New_VendorClass AS VendorClass"; string Table = "TradingRelation"; // string Criteria = "BuyerCompanyID = "+iBuyerCID+ " AND New_VendorClass IS NOT NULL AND SupplierCompanyID="+iSupplierCID; string Criteria = "BuyerCompanyID = " + iBuyerCID + " AND New_VendorClass IS NOT NULL";// AND SupplierCompanyID=" + HdSupplierId; ds = oApproval.GetGlobalDropDowns(Fields, Table, Criteria); if (ds.Tables[0].Rows.Count > 0) { ddlVendor.DataSource = ds; ddlVendor.DataBind(); } ddlVendor.Items.Insert(0, "Select"); } catch { } finally { ds = null; } }