// Event handler btnSearch_Click , To find user exist or not //protected void btnSearch_Click(object sender, EventArgs e) //{ // // Declare Local Variable Username to get username from textbox // string Username = txtUserName.Text.ToString().Trim(); // // Find User Exist in Database by Calling objUser.Get_UserLogin_By_UserName_Like() Function // objUser = objUser.Get_UserLogin_By_UserName_Like(Username); // // If UserId is Not Zero than User Exist // if (objUser.Userid != 0) // { // txtUserName.Text = objUser.Username.ToString().Trim(); // } // else // { // txtUserName.Text = ""; // } //} // Bind Grid of grdvwSite , on the basis of drop down value Selection protected void BindGrid() { // Declare Local Variable regionid to get regionid from drpRegion DropDown int custid; // Assign regionid to localvariable regionid from selected value of drop down custid = Convert.ToInt16(drpRegion.SelectedValue); // If region is Zero , ie All has been selected ,and bind all Sites Information to Grid if (custid == 0) { colSites = objSites.Get_All(); grdvwSite.DataSource = colSites; grdvwSite.DataBind(); } else { // Grid will bind only those sites ,which come under selected region BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>(); colSites = objSites.Get_All(); foreach (Site_mst obj in colSites) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } grdvwSite.DataSource = colSite1; grdvwSite.DataBind(); } }
public void BindDrpSite() { // Declare col as Collection of Site_mst Object to get all records from table BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>(); int custid = Convert.ToInt16(drpCustomer.SelectedValue); // declare object objOrganization of Site_mst_mst Class to call function Get_All() to fetch all records from database // Assign all records to variable col col = objSite.Get_All(); foreach (Site_mst obj in col) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } drpSite.DataTextField = "SiteName"; drpSite.DataValueField = "siteid"; drpSite.DataSource = colSite1; drpSite.DataBind(); // Declare item as listItem to assign default value to drop down ListItem item = new ListItem(); item.Text = "--------------Select--------------"; item.Value = "0"; drpSite.Items.Add(item); drpSite.SelectedValue = "0"; }
// Definition of BindDropDown() protected void BindDropDown() { colSite = objSite.Get_All(); for (int i = 0; i < colSite.Count; i++) { for (int j = i; j < colSite.Count; j++) { if (String.Compare(colSite[i].Sitename, colSite[j].Sitename) > 0) { Site_mst obj = new Site_mst(); obj = colSite[i]; colSite[i] = colSite[j]; colSite[j] = obj; } } } drpSites.DataTextField = "sitename"; drpSites.DataValueField = "siteid"; drpSites.DataSource = colSite; drpSites.DataBind(); ListItem item = new ListItem(); item.Text = "--------Select----------"; item.Value = "0"; drpSites.Items.Add(item); drpSites.SelectedValue = "0"; }
public void BindGrid() { // Declare collection col as Site_mst to get all Sites from database // By Calling Function objSite.Get_All() assign to col object col = objSite.Get_All(); // Bind GridView by using Datasource and Databind Properties grdvwSite.DataSource = col; grdvwSite.DataBind(); }
protected void BindDropDown() { colSite = objSite.Get_All(); drpSites.DataTextField = "sitename"; drpSites.DataValueField = "siteid"; drpSites.DataSource = colSite; drpSites.DataBind(); ListItem item = new ListItem(); item.Text = "-------------Select---------------"; item.Value = "0"; drpSites.Items.Add(item); drpSites.SelectedValue = "0"; }
protected void BindDropDown() { BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>(); int custid; custid = Convert.ToInt16(drpCustomer.SelectedValue); colSite = objSite.Get_All(); foreach (Site_mst obj in colSite) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } drpSites.DataTextField = "sitename"; drpSites.DataValueField = "siteid"; drpSites.DataSource = colSite1; drpSites.DataBind(); ListItem item = new ListItem(); item.Text = "------------Select-------------"; item.Value = "0"; drpSites.Items.Add(item); drpSites.SelectedValue = "0"; //btnReset_Click(); }
public void BindDrpsite() { BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>(); int custid = Convert.ToInt32(drpCustomer.SelectedValue); Site_mst ObjSite = new Site_mst(); col = ObjSite.Get_All(); foreach (Site_mst obj in col) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } DrpSite.DataTextField = "sitename"; DrpSite.DataValueField = "siteid"; DrpSite.DataSource = colSite1; DrpSite.DataBind(); ListItem item = new ListItem(); item.Text = Resources.MessageResource.errselectste.ToString(); item.Value = "0"; DrpSite.Items.Add(item); //DrpSite.SelectedValue = "0"; }
public void BindDrpSite() { BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); BLLCollection <Site_mst> colSite1 = new BLLCollection <Site_mst>(); int custid = Convert.ToInt32(drpCustomer.SelectedValue); col = objsite.Get_All(); foreach (Site_mst obj in col) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } drpsite.DataTextField = "SiteName"; drpsite.DataValueField = "siteid"; drpsite.DataSource = colSite1; drpsite.DataBind(); ListItem item = new ListItem(); item.Text = "-------------Select-------------"; item.Value = "0"; drpsite.Items.Add(item); drpsite.SelectedValue = "0"; }
protected void BindSite() { //change done by meenakshi int hubid = 0; if (drpHub.SelectedValue != "") { hubid = Convert.ToInt32(drpHub.SelectedValue); } if (hubid != 0) { colSite = objSite.Get_By_hubid_site(hubid); drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; //drpsite.DataSource = colSite; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); //item.Selected = true; item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); drpsite.SelectedValue = "0"; } else { colSite = objSite.Get_All(); //colSite = objSite.Get_By_hubid_site(hubid); for (int i = 0; i < colSite.Count; i++) { for (int j = i; j < colSite.Count; j++) { if (String.Compare(colSite[i].Sitename, colSite[j].Sitename) > 0) { Site_mst obj = new Site_mst(); obj = colSite[i]; colSite[i] = colSite[j]; colSite[j] = obj; } } } drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; //drpsite.DataSource = colSite; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); //item.Selected = true; item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); drpsite.SelectedValue = "0"; } }
protected void BindDropSite() { foreach (UserToSiteMapping obj in colUserToSite) { int siteid; Site_mst objSite1 = new Site_mst(); siteid = obj.Siteid; objSite1 = objSite.Get_By_id(siteid); if (objSite1.Siteid != 0) { int custid = Convert.ToInt32(drpCustomer.SelectedValue); int flag = objCustToSite.Get_By_Id(custid, objSite1.Siteid); if (flag == 1) { colSite.Add(objSite1); } } } //} //drpSite.DataTextField = "sitename"; //drpSite.DataValueField = "siteid"; //drpSite.DataSource = colSite ; //drpSite.DataBind(); // if (colSite.Count == 0) // { // ListItem item = new ListItem(); // item.Text = "-------------Select-------------"; // item.Value = "0"; // drpSite.Items.Add(item); // } // } //} //protected void BindDropSite() //{ colSite = objSite.Get_All(); drpSite.DataTextField = "sitename"; drpSite.DataValueField = "siteid"; drpSite.DataSource = colSite; drpSite.DataBind(); ListItem item = new ListItem(); item.Text = "-------------Select-------------"; item.Value = "0"; drpSite.Items.Add(item); drpSite.SelectedValue = "0"; }
public void BindDropRegion() { colSites = objSites.Get_All(); drpRegion.DataTextField = "siteName"; drpRegion.DataValueField = "siteid"; drpRegion.DataSource = colSites; drpRegion.DataBind(); ListItem item = new ListItem(); item.Text = "------------Select------------"; item.Value = "0"; drpRegion.Items.Add(item); drpRegion.SelectedValue = "0"; }
public void BindSite() { BLLCollection <Site_mst> col = new BLLCollection <Site_mst>(); col = objSite.Get_All(); drpSite.DataTextField = "SiteName"; drpSite.DataValueField = "Siteid"; drpSite.DataSource = col; drpSite.DataBind(); ListItem item = new ListItem(); item.Text = "--------------Select--------------"; item.Value = "0"; drpSite.Items.Add(item); drpSite.SelectedValue = "0"; }
protected void BindSite() { colSite = objSite.Get_All(); drpsite.DataTextField = "sitename"; drpsite.DataValueField = "siteid"; drpsite.DataSource = colSite; drpsite.DataBind(); ListItem item = new ListItem(); item.Text = "All"; item.Value = "0"; drpsite.Items.Add(item); //item.Text = "---Select Site---"; //item.Value = "0"; //drpsite.Items.Add(item); drpsite.SelectedValue = "0"; }
public void BindDrpsite() { BLLCollection<Site_mst> col = new BLLCollection<Site_mst>(); BLLCollection<Site_mst> colSite1 = new BLLCollection<Site_mst>(); int custid = Convert.ToInt16(drpCustomer.SelectedValue); Site_mst ObjSite = new Site_mst(); col = ObjSite.Get_All(); foreach (Site_mst obj in col) { int flag; flag = objCustToSite.Get_By_Id(custid, obj.Siteid); if (flag == 1) { colSite1.Add(obj); } } DrpSite.DataTextField = "sitename"; DrpSite.DataValueField = "siteid"; DrpSite.DataSource = colSite1; DrpSite.DataBind(); ListItem item = new ListItem(); item.Text = "--------------Select---------------"; item.Value = "0"; DrpSite.Items.Add(item); DrpSite.SelectedValue = "0"; }