Exemple #1
0
 private void AddUserButton_Click(object sender, RoutedEventArgs e)
 {
     hideMsg();
     tableUserAuth.CanUserAddRows = true;
     CJSITE_USER user = new CJSITE_USER();
     user.ID = DBManager.Guid();
     user.USERAUTH = "00000";
     user.ISVALID = true;
     user.ConvertFieldToAuth();
     user.isSaved = false;
     users.Add(user);
     tableUserAuth.CanUserAddRows = false;
 }
Exemple #2
0
 private void queryUsers()
 {
     string sql = "select * from CJSITE_USER order by USERNAME desc";
     DBManager.ConnectCGDB();
     DataTable data = DBManager.DBHelperCG.ExcuteSql(sql);
     listUsers = CJSITE_USER.ToClass(data);
     CJSITE_USER nolimit = new CJSITE_USER();
     nolimit.ID = "0";
     nolimit.USERNAME = "******";
     listUsers.Add(nolimit);
     listUsers.Reverse(0, listUsers.Count);
     cbUser.ItemsSource = listUsers;
 }
Exemple #3
0
 public static List<CJSITE_USER> ToClass(DataTable data)
 {
     List<CJSITE_USER> list = new List<CJSITE_USER>();
     for (int i = 0; i < data.Rows.Count; i++) {
         CJSITE_USER cjsite_user = new CJSITE_USER();
         cjsite_user.ID = data.Rows[i]["ID"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["ID"]);
         cjsite_user.USERID = data.Rows[i]["USERID"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["USERID"]);
         cjsite_user.USERNAME = data.Rows[i]["USERNAME"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["USERNAME"]);
         cjsite_user.PASSWORD = data.Rows[i]["PASSWORD"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["PASSWORD"]);
         cjsite_user.GROUPID = data.Rows[i]["GROUPID"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["GROUPID"]);
         cjsite_user.USERAUTH = data.Rows[i]["USERAUTH"] == DBNull.Value ? "" : Convert.ToString(data.Rows[i]["USERAUTH"]);
         cjsite_user.ISVALID = data.Rows[i]["ISVALID"] == DBNull.Value ? false : Convert.ToBoolean(data.Rows[i]["ISVALID"]);
         list.Add(cjsite_user);
     }
     return list;
 }