protected void BindDropTechnician()
    {
        objRole = objRole.Get_RoleInfo_By_RoleName("technician");
        int roleid = Convert.ToInt16(objRole.Roleid);

        coltechnician = ObjUserLogin.Get_All_By_Role(roleid);
        drpTechnician.DataTextField  = "username";
        drpTechnician.DataValueField = "userid";
        drpTechnician.DataSource     = coltechnician;
        drpTechnician.DataBind();
        ListItem item = new ListItem();

        item.Text  = "---Select Technician---";
        item.Value = "0";
        drpTechnician.Items.Add(item);
        drpTechnician.SelectedValue = "0";
    }
示例#2
0
    protected void BindDropTechnician()
    {
        objRole = objRole.Get_RoleInfo_By_RoleName("technician");
        if (objRole.Roleid != 0)
        {
            int siteid = 0;
            int roleid;
            // drpSite.SelectedIndex = 2;
            if (drpSite.SelectedValue != "")
            {
                siteid = Convert.ToInt16(drpSite.SelectedValue);
            }



            roleid = objRole.Roleid;
            if (siteid != 0 && roleid != 0)
            {
                colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
                drpTechnician.DataTextField  = "username";
                drpTechnician.DataValueField = "userid";
                drpTechnician.DataSource     = colUser;
                drpTechnician.DataBind();
                ListItem item = new ListItem();
                item.Text  = "-------------Select-------------";
                item.Value = "0";
                drpTechnician.Items.Add(item);
                drpTechnician.SelectedValue = "0";
            }
            //else
            //{

            //    colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
            //    drpTechnician.DataTextField = "username";
            //    drpTechnician.DataValueField = "userid";
            //    drpTechnician.DataSource = colUser;
            //    drpTechnician.DataBind();
            //    ListItem item = new ListItem();
            //    item.Text = "-------------Select-------------";
            //    item.Value = "0";
            //    drpTechnician.Items.Add(item);
            //    drpTechnician.SelectedValue = "0";


            //}
        }
    }
 protected void BindDropTechnician()
 {
     objRole = objRole.Get_RoleInfo_By_RoleName("technician");
     if (objRole.Roleid != 0)
     {
         int roleid;
         roleid = objRole.Roleid;
         if (roleid != 0)
         {
             colUser = objUser.Get_All_By_Role(roleid);
             drpUserList.DataTextField  = "username";
             drpUserList.DataValueField = "userid";
             drpUserList.DataSource     = colUser;
             drpUserList.DataBind();
             ListItem item = new ListItem();
             item.Text  = "-------------Select-------------";
             item.Value = "0";
             drpUserList.Items.Add(item);
             drpUserList.SelectedValue = "0";
         }
     }
 }
示例#4
0
    protected void BindDropTechnician()
    {
        objRole = objRole.Get_RoleInfo_By_RoleName("technician");
        if (objRole.Roleid != 0)
        {
            int siteid = 0;
            int roleid;
            if (drpSite.SelectedValue != "")
            {
                siteid = Convert.ToInt32(drpSite.SelectedValue);
            }

            roleid = objRole.Roleid;
            if (siteid != 0 && roleid != 0)
            {
                colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
                //meenakshi
                for (int i = 0; i < colUser.Count; i++)
                {
                    for (int j = i; j < colUser.Count; j++)
                    {
                        if (String.Compare(colUser[i].Username, colUser[j].Username) > 0)
                        {
                            UserLogin_mst obj = new UserLogin_mst();
                            obj        = colUser[i];
                            colUser[i] = colUser[j];
                            colUser[j] = obj;
                        }
                    }
                }
                //end
                drpTechnician.DataTextField  = "username";
                drpTechnician.DataValueField = "userid";
                drpTechnician.DataSource     = colUser;
                drpTechnician.DataBind();
                ListItem item = new ListItem();
                item.Text  = "All";
                item.Value = "0";
                drpTechnician.Items.Add(item);
                //item.Text = "-----------Select-----------";
                //item.Value = "0";
                //drpTechnician.Items.Add(item);
                drpTechnician.SelectedValue = "0";
            }
            else
            {
                colUser = objUser.Get_All_By_Role_Site(roleid, siteid);
                //meenakshi
                for (int i = 0; i < colUser.Count; i++)
                {
                    for (int j = i; j < colUser.Count; j++)
                    {
                        if (String.Compare(colUser[i].Username, colUser[j].Username) > 0)
                        {
                            UserLogin_mst obj = new UserLogin_mst();
                            obj        = colUser[i];
                            colUser[i] = colUser[j];
                            colUser[j] = obj;
                        }
                    }
                }
                //end
                drpTechnician.DataTextField  = "username";
                drpTechnician.DataValueField = "userid";
                drpTechnician.DataSource     = colUser;
                drpTechnician.DataBind();
                ListItem item = new ListItem();
                item.Text  = "All";
                item.Value = "0";
                drpTechnician.Items.Add(item);
                //item.Text = "-----------Select-----------";
                //item.Value = "0";
                //drpTechnician.Items.Add(item);
                drpTechnician.SelectedValue = "0";
            }
        }
    }