/// <summary> /// get part backup server list /// </summary> /// <param name="conn"></param> /// <param name="groupId"></param> /// <returns></returns> public IList <BackupServer> GetPartBackupServerList(OdbcConnection conn, string groupId) { IList <BackupServer> bspList = new List <BackupServer>(); try { string sql = "select id,backupServerName,backupServerIP,memo,account,password,startFile from backupServer where deleteFlg=0" + " and id not in (" + "select backupServerID from backupServerGroupDetail where backupServerGroupID = " + groupId + " and deleteFlg=0" + ")"; DataTable dt = db.Squery(sql, conn); foreach (DataRow row in dt.Rows) { BackupServer bs = new BackupServer(); bs.id = row["id"].ToString(); bs.backupServerName = row["backupServerName"].ToString(); bs.backupServerIP = row["backupServerIP"].ToString(); bs.memo = row["memo"].ToString(); bs.account = row["account"].ToString(); bs.password = row["password"].ToString(); bs.startFile = row["startFile"].ToString(); bspList.Add(bs); } } catch (Exception e) { throw e; } return(bspList); }
/// <summary> /// user exist check /// </summary> /// <param name="conn"></param> /// <param name="userInfo"></param> /// <returns></returns> public UserInfo userExist(UserInfo userInfo, OdbcConnection conn) { string sql = "SELECT LoginID,password,name,mail,authorityFlg FROM userInfo where LoginID=?" + " AND password=?" + " AND deleteFlg=0"; OdbcParameter[] para = new OdbcParameter[] { new OdbcParameter("@LoginID", userInfo.loginID), new OdbcParameter("@password", userInfo.password) }; try { DataTable dt = db.Squery(sql, conn, para); if (dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { userInfo.authorityFlg = Int32.Parse(row["authorityFlg"].ToString()); } return(userInfo); } } catch (Exception e) { throw e; } return(null); }