示例#1
0
    public string GetCollege(string UserCode)
    {
        DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter();
        DSUser.UserDataTable table = new DSUser.UserDataTable();
        helper.FillCollege(table, UserCode);
        string college = string.Empty;

        if (table.Rows.Count != 0)
        {
            college = table.Rows[0]["College"].ToString();
        }
        return(college);
    }
示例#2
0
    public string GetName(string UserCode)
    {
        DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter();
        DSUser.UserDataTable table = new DSUser.UserDataTable();
        helper.FillPsw(table, UserCode);
        string name = string.Empty;

        if (table.Rows.Count != 0)
        {
            name = table.Rows[0]["Name"].ToString();
        }
        return(name);
    }
示例#3
0
    public int GetBranchID(string UserCode)
    {
        DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter();
        DSUser.UserDataTable table = new DSUser.UserDataTable();
        helper.FillPsw(table, UserCode);
        int i = 0;

        if (table.Rows.Count != 0)
        {
            i = Convert.ToInt32(table.Rows[0]["BranchID"].ToString());
        }
        return(i);
    }
示例#4
0
 public bool AuthenticateUser(string username, string password, out string userId)
 {
     DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter();
     DSUser.UserDataTable table = new DSUser.UserDataTable();
     helper.Fill(table, username, password);
     if (table.Rows.Count == 0)
     {
         userId = "";
         return(false);
     }
     else
     {
         userId = table.Rows[0]["UserCode"].ToString();
         return(true);
     }
 }
示例#5
0
    public bool ChangePasword(string UserCode, string OldePassword, string NewPassword)
    {
        DSUserTableAdapters.UserTableAdapter helper = new DSUserTableAdapters.UserTableAdapter();
        DSUser.UserDataTable table = new DSUser.UserDataTable();
        helper.FillPsw(table, UserCode);

        string Psw = table.Rows[0]["Password"].ToString();

        if (Psw.Equals(OldePassword))
        {
            helper.UpdatePasword(NewPassword, UserCode);
            return(true);
        }
        else
        {
            return(false);
        }
    }