Exemple #1
0
    private void gridViewBind()
    {
        string    condition = " order by ID desc";
        DataTable dt        = oUserInfoDAO.GetUserInfo(condition);

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
    private void loadDropDownList()
    {
        string    condition = " where tblUserInfo.UserType<>'Admin' and tblUserInfo.Active='true'";
        DataTable dt        = oUserInfoDAO.GetUserInfo(condition);

        if (dt.Rows.Count > 0)
        {
            userDropDownList.DataSource     = dt;
            userDropDownList.DataTextField  = "UserID";
            userDropDownList.DataValueField = "UserID";
            userDropDownList.DataBind();
        }
    }
Exemple #3
0
    private void loadDropDownList()
    {
        string    condition = " where tblUserInfo.UserType<>'Admin' and tblUserInfo.Active='true'";
        DataTable dt        = oUserInfoDAO.GetUserInfo(condition);

        if (dt.Rows.Count > 0)
        {
            userDropDownList.DataSource     = dt;
            userDropDownList.DataTextField  = "UserID";
            userDropDownList.DataValueField = "UserID";
            userDropDownList.DataBind();
        }
        condition = " where MenuName<>'Admin'";
        dt        = new DataTable();
        dt        = oMenuAndSubMenuDAO.GetMenu(condition);
        if (dt.Rows.Count > 0)
        {
            menuItemDropDownList.DataSource     = dt;
            menuItemDropDownList.DataTextField  = "MenuName";
            menuItemDropDownList.DataValueField = "MenuNo";
            menuItemDropDownList.DataBind();
        }
    }
Exemple #4
0
  protected void Page_Load(object sender, EventArgs e)
  {
      if (Session["user"] != null)
      {
          ReturnVal oRtnValue    = new ReturnVal();
          string    BranchName   = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "BranchName");
          string    EmployeeName = oRtnValue.ReturnValue("View_BranchInfo", "userid", "'" + Session["userID"] + "'", "EmployeeName");



          Label1.Text = "Branch/Division: " + BranchName;
          //Label1.Text =  BranchName;
          Label2.Text = "User Name: " + EmployeeName;


          Label1.Font.Bold      = true;
          Label1.Font.Italic    = false;
          Label1.Font.Name      = "verdana";
          Label1.Font.Overline  = false;
          Label1.Font.Size      = 10;
          Label1.Font.Strikeout = false;
          Label1.Font.Underline = false;


          Label2.Font.Name = "verdana";
      }



      if (Session["user"] == null)
      {
          Server.Transfer("WebLogin.aspx");
      }

      if (!IsPostBack)
      {
          string    condition = " where userID='" + Session["user"].ToString() + "'";
          DataTable dt        = oUserInfoDAO.GetUserInfo(condition);
          string    userType  = "";
          if (dt.Rows.Count > 0)
          {
              userType = dt.Rows[0]["UserType"].ToString();
              if (userType != "Admin")
              {
                  condition = " where userID='" + Session["user"].ToString() + "'";
                  DataTable     dt1   = oUserAssignRightDAO.GetUserAssignRight(condition);
                  SubMenuEntity oMenu = new SubMenuEntity();
                  for (int k = 0; k < NavigationMenu.Items.Count; k++)
                  {
                      if (NavigationMenu.Items[k].Text == "Admin")
                      {
                          NavigationMenu.Items[k].Enabled = false;
                      }
                      foreach (MenuItem item in NavigationMenu.Items[k].ChildItems)
                      {
                          // Display the menu items.
                          DisplayChildMenuText(item, dt1);
                      }
                  }
              }
          }
      }
  }