/// <summary> /// Fill Employee to select for those logged in user is a Manager /// </summary> protected void fillemployee() { if (ViewState["add"] == null && ViewState["approvetimesheet"] == null) { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); dropemployee.Items.Insert(0, li); dropemployee.SelectedIndex = 0; } else { //objuser.action = "select"; //objuser.companyid = Session["companyid"].ToString(); //objuser.id = Session["userid"].ToString(); ; objuser.action = "selectbymanagerwith"; objuser.companyid = Session["companyid"].ToString(); objuser.managerid = Session["userid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropemployee.DataSource = ds; //dropemployee.DataTextField = "username"; //dropemployee.DataValueField = "nid"; //dropemployee.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); // ListItem li = new ListItem("--All Employees--", ""); // dropemployee.Items.Insert(0, li); } dropemployee.Text = Session["userid"].ToString(); } }
/// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); } ListItem li = new ListItem("--All Employees--", ""); dropemployee.Items.Insert(0, li); dropemployee.Text = Session["userid"].ToString(); }
public void fillemp() { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropemployee.DataSource = ds; //dropemployee.DataTextField = "username"; //dropemployee.DataValueField = "nid"; //dropemployee.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); ListItem li = new ListItem("--All Employees--", ""); dropemployee.Items.Insert(0, li); } dropemployee.SelectedIndex = 0; }