public bool filterStudent() { SqlConnection con = DbConnect.GetConnection(); con.Open(); string sql = "SELECT TOP 10 studentID FROM Rank ORDER BY rankName DESC"; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); StatusCheck stc = null; while (dr.Read()) { stc = new StatusCheck(); stc.studentID = dr["studentID"].ToString(); SqlConnection con2 = DbConnect.GetConnection(); con2.Open(); string sql2 = "UPDATE Student SET caution=0 Where studentID=@studentID"; SqlCommand cmd2 = new SqlCommand(sql2, con2); cmd2.Parameters.Add("studentID", SqlDbType.NVarChar); cmd2.Parameters["studentID"].Value = stc.studentID; cmd2.ExecuteNonQuery(); con2.Close(); } con.Close(); return(true); }
public ClusterVNodeStartup( ISubsystem[] subsystems, IPublisher mainQueue, ISubscriber mainBus, MultiQueuedHandler httpMessageHandler, IReadOnlyList <IHttpAuthenticationProvider> httpAuthenticationProviders, IAuthorizationProvider authorizationProvider, IReadIndex readIndex, int maxAppendSize, KestrelHttpService httpService) { if (subsystems == null) { throw new ArgumentNullException(nameof(subsystems)); } if (mainQueue == null) { throw new ArgumentNullException(nameof(mainQueue)); } if (httpAuthenticationProviders == null) { throw new ArgumentNullException(nameof(httpAuthenticationProviders)); } if (authorizationProvider == null) { throw new ArgumentNullException(nameof(authorizationProvider)); } if (readIndex == null) { throw new ArgumentNullException(nameof(readIndex)); } Ensure.Positive(maxAppendSize, nameof(maxAppendSize)); if (httpService == null) { throw new ArgumentNullException(nameof(httpService)); } if (mainBus == null) { throw new ArgumentNullException(nameof(mainBus)); } _subsystems = subsystems; _mainQueue = mainQueue; _mainBus = mainBus; _httpMessageHandler = httpMessageHandler; _httpAuthenticationProviders = httpAuthenticationProviders; _authorizationProvider = authorizationProvider; _readIndex = readIndex; _maxAppendSize = maxAppendSize; _httpService = httpService; _statusCheck = new StatusCheck(this); }
private async Task CheckDerivationStatus(PullRequest pullRequest, DateTime now, string buildUrl) { Console.WriteLine($"Checking status for pull request \"{pullRequest.Title}\""); var commit = await _git.GetCommonAncestorWithDevelop(pullRequest.Head.Commit); if (string.IsNullOrEmpty(commit)) { Console.WriteLine("Could not retrieve ancestor commit"); return; } pullRequest.LastDevelopCommit = commit; Console.WriteLine($"Common ancestor is commit {commit}"); var commitDate = await _git.GetCommitDate(commit); if (!commitDate.HasValue) { Console.WriteLine("Could not retrieve commit date"); return; } pullRequest.LastDevelopMerge = commitDate; Console.WriteLine($"This commit dates from {commitDate.Value:f}"); var isUpToDate = commitDate.Value >= GetTimeLimit(now); var status = new StatusCheck { TargetUrl = buildUrl, Context = "Recent merge from develop" }; if (isUpToDate) { Console.WriteLine($" \"{pullRequest.Title}\" is up to date"); status.State = StatusCheckType.success; status.Description = "The branch contains a recent version of develop"; } else { var span = now - commitDate.Value; Console.WriteLine($" \"{pullRequest.Title}\" derived for more than {span.Days} days"); status.State = StatusCheckType.failure; status.Description = $"The branch derived from develop for more than {span.Days} days"; } if (!_dryRun) { await _github.SetStatusCheckAsync(pullRequest.Head.Commit, status); } }
protected void Page_Load(object sender, EventArgs e) { StatusCheck.loginStatusCheck(Session, Response, "student"); if (Request["id"] != null) { if (Request["cancel"] != null && Request["cancel"].Equals("1")) { //取消报名 SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); String sql = "UPDATE dotnetexp.dbo.seminar_student SET is_deleted=1 WHERE is_deleted=0 AND seminar_id=" + Request["id"] + " AND student_id=" + Session["cur_id"] + ";"; if (connection.State == ConnectionState.Closed) { connection.Open(); } SqlCommand cmd = new SqlCommand(sql, connection); object obj = cmd.ExecuteNonQuery(); if (obj != null) { //Success } else { //Fail } Response.Redirect("seminar.aspx"); } else { SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); String sql = "INSERT INTO dotnetexp.dbo.seminar_student(seminar_id, student_id, enroll_time, is_deleted) VALUES('" + Request["id"] + "'," + Session["cur_id"] + ", GETDATE(), 0);"; if (connection.State == ConnectionState.Closed) { connection.Open(); } SqlCommand cmd = new SqlCommand(sql, connection); object obj = cmd.ExecuteNonQuery(); if (obj != null) { //Success } else { //Fail } Response.Redirect("seminar.aspx"); } } }
private void checkServerStatus_Click(object sender, EventArgs e) { Label[] labels = { this.Label001, this.Label002, this.Label003, this.Label004, this.Label005, this.Label006, this.Label007, this.Label008 }; string[] serverAry = { "lol.garena.com", "216.52.241.254", "203.117.155.133", "www.leagueoflegends.co.kr", "95.172.70.254", "190.93.254.13", "lq.oc1.lol.riotgames.com", "66.150.148.64" }; for (int i = 0; i <= 7; i++) { //if (StatusCheck.pingCheck(serverAry[i])) //{ string tmp = StatusCheck.pingCheck(serverAry[i]); if (tmp != "請求逾時" & tmp != "不明") { labels[i].ForeColor = System.Drawing.Color.Green; } else if (tmp == "不明") { labels[i].ForeColor = System.Drawing.Color.Red; } else { labels[i].ForeColor = System.Drawing.Color.Red; } labels[i].Text = tmp; Logger.log("Server Status Check:", Logger.LogType.Info); Logger.log(serverAry[i] + " : 正常", Logger.LogType.Info); } //else //{ //labels[i].Text = "請求逾時"; //labels[i].ForeColor = System.Drawing.Color.Red; // Logger.log("Server Status Check:", Logger.LogType.Info); //Logger.log(serverAry[i] + " : 請求逾時", Logger.LogType.Info); //} }
protected void Page_Load(object sender, EventArgs e) { StatusCheck.loginStatusCheck(Session, Response, "student"); if (Session["cur_id"] == null || Session["cur_type"] == null) { Response.Redirect("/login.aspx"); } else if (!Session["cur_type"].Equals("student")) { Response.Status = "404 Not Found"; Response.End(); } else if (Session["cur_activate"] != null) { Response.Redirect("/activateAccount.aspx"); } List <String[]> seminarList = new List <string[]>(); SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); string sql = "SELECT seminar.id, seminar.name sname, course.[name] cname, CONVERT(varchar, seminar.time, 120 ) " + "FROM dotnetexp.dbo.seminar, dotnetexp.dbo.course WHERE course.[no]=seminar.[course_no] AND seminar.is_deleted=0;"; SqlDataAdapter adapter = new SqlDataAdapter(sql, connection); DataSet dataSet = new DataSet(); adapter.Fill(dataSet, "seminar"); for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++) { string[] seminarRow = new string[dataSet.Tables[0].Rows[i].ItemArray.Length + 1]; for (int j = 0; j < dataSet.Tables[0].Rows[i].ItemArray.Length; j++) { seminarRow[j] = (dataSet.Tables[0].Rows[i].ItemArray[j].ToString()); } connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); sql = "SELECT * from dotnetexp.dbo.seminar_student WHERE seminar_id=" + seminarRow[0] + " AND student_id=" + Session["cur_id"] + " AND is_deleted=0;"; adapter = new SqlDataAdapter(sql, connection); DataSet enrollDataSet = new DataSet(); adapter.Fill(enrollDataSet, "seminarEnroll"); if (enrollDataSet.Tables[0].Rows.Count > 0) { seminarRow[dataSet.Tables[0].Rows[i].ItemArray.Length] = "1"; } else { seminarRow[dataSet.Tables[0].Rows[i].ItemArray.Length] = "0"; } seminarList.Add(seminarRow); } Session["seminarList"] = seminarList; }
public ClusterVNodeStartup( ISubsystem[] subsystems, IQueuedHandler mainQueue, IAuthenticationProvider internalAuthenticationProvider, IReadIndex readIndex, ClusterVNodeSettings vNodeSettings, KestrelHttpService externalHttpService, KestrelHttpService internalHttpService = null) { if (subsystems == null) { throw new ArgumentNullException(nameof(subsystems)); } if (mainQueue == null) { throw new ArgumentNullException(nameof(mainQueue)); } if (internalAuthenticationProvider == null) { throw new ArgumentNullException(nameof(internalAuthenticationProvider)); } if (readIndex == null) { throw new ArgumentNullException(nameof(readIndex)); } if (vNodeSettings == null) { throw new ArgumentNullException(nameof(vNodeSettings)); } if (externalHttpService == null) { throw new ArgumentNullException(nameof(externalHttpService)); } _subsystems = subsystems; _mainQueue = mainQueue; _internalAuthenticationProvider = internalAuthenticationProvider; _readIndex = readIndex; _vNodeSettings = vNodeSettings; _externalHttpService = externalHttpService; _internalHttpService = internalHttpService; _statusCheck = new StatusCheck(this); }
public async Task <StatusCheck> Get(string ouNetId, string assignmentId, string courseId, string minimumGrade) { var result = new StatusCheck(); var assignmentSubmission = await CanvasHelper.GetSubmissionGradeOfAssignmentForUser(ouNetId, assignmentId, courseId); if (minimumGrade.IsNumber()) { if (assignmentSubmission.Grade.IsNumber()) { if (Convert.ToDouble(assignmentSubmission.Grade) >= Convert.ToDouble(minimumGrade)) { result.IsComplete = true; result.PercentComplete = 1.0; } } else { result.IsComplete = false; result.Exception = new ExceptionMessage() { Message = @"Grade passed in to check was a number, but the grade value for the assignment is not numeric." }; } } else if (minimumGrade.IsAlphaGrade()) { if (minimumGrade.CompareAlphaGrades(assignmentSubmission.Grade) >= 0) { result.IsComplete = true; result.PercentComplete = 1.0; } else { result.IsComplete = false; } } else if (assignmentSubmission.Grade.IsPassed()) { result.IsComplete = true; result.PercentComplete = 1.0; } return(result); }
protected void Page_Load(object sender, EventArgs e) { StatusCheck.loginStatusCheck(Session, Response, "student"); if (Request["Request_Method"] == "POST") { if (Request["id"] != null) { SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); String question = Request["question"]; String sql = "UPDATE dotnetexp.dbo.seminar_student SET question='" + question + "' WHERE is_deleted=0 AND seminar_id=" + Request["id"] + " AND student_id=" + Session["cur_id"] + ";"; if (connection.State == ConnectionState.Closed) { connection.Open(); } SqlCommand cmd = new SqlCommand(sql, connection); object obj = cmd.ExecuteNonQuery(); if (obj != null) { //Success } else { //Fail } } Response.Redirect("seminar.aspx"); } if (Request["Request_Method"] == "GET") { if (Request["id"] != null) { SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLServerConnection"].ToString()); String sql = "SELECT question from dotnetexp.dbo.seminar_student WHERE is_deleted=0 AND seminar_id=" + Request["id"] + " AND student_id=" + Session["cur_id"] + ";"; SqlDataAdapter adapter = new SqlDataAdapter(sql, connection); DataSet dataSet = new DataSet(); adapter.Fill(dataSet, "question"); Session["question"] = dataSet.Tables[0].Rows[0].ItemArray[0].ToString(); } } }
public StatusCheck loadTickCheckProfile(string studentID) { SqlConnection con = DbConnect.GetConnection(); con.Open(); string sql = "select status from Rank WHERE studentID=@studentID "; SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.Add("studentID", SqlDbType.NVarChar); cmd.Parameters["studentID"].Value = studentID; SqlDataReader dr = cmd.ExecuteReader(); StatusCheck stk = null; dr.Read(); stk = new StatusCheck(); stk.attention = (bool)dr["status"]; con.Close(); return(stk); }
public List <StatusCheck> loadCheck() { List <StatusCheck> stl = new List <StatusCheck>(); SqlConnection con = DbConnect.GetConnection(); con.Open(); string sql = " SELECT studentID,status From Rank "; SqlCommand cmd = new SqlCommand(sql, con); SqlDataReader dr = cmd.ExecuteReader(); StatusCheck stk = null; while (dr.Read()) { stk = new StatusCheck(); stk.studentID = dr["studentID"].ToString(); stk.attention = (bool)dr["status"]; stl.Add(stk); } con.Close(); return(stl); }
// 170507 EDS #892 Only lookup setup files in CreateNewProject. Removed redundant code private void cmdContinue_Click(object sender, EventArgs e) { m_serverName = txtServerName.Text; m_databaseName = txtDatabaseName.Text; m_instanceName = txtInstanceName.Text; m_instance = txtInstance.Text; m_ecpLocation = txtLicenseFile.Text; m_dbLocation = txtLocation.Text; m_backupLocation = txtLocationBackup.Text; m_userName = txtUsername.Text; m_password = txtPassword.Text; try { switch (m_task) { case NavServerSetupTask.Create: CreateNewProject(); break; case NavServerSetupTask.Upgrade: StatusCheck.Perform(m_serverName, m_databaseName, rdoUseSQLServerAuthentication.Checked, m_userName, m_password, m_dbLocation, m_backupLocation, m_instance, m_instanceName, m_sdeSetupFileName); break; default: break; } } catch (Exception exc) { InstallUtility.ExceptionHandler(exc, System.Reflection.MethodInfo.GetCurrentMethod().Name); } DialogResult = DialogResult.OK; this.Close(); }
private void Awake() { gameManager = GameObject.Find("GameManager").GetComponent <GameManager> (); statusList = new StatusCheck(); statusList.Initialize(this); }
protected void Page_Load(object sender, EventArgs e) { StatusCheck.loginStatusCheck(Session, Response, "student"); }
public void Page_Load(object sender, EventArgs e) { Label10.Text = ""; lbNoitice.Text = ""; Label1.Text = ""; Label11.Text = ""; lbResult.Text = ""; upLabel.Text = ""; try { if ((Session["account"]) == null || (Session["role"]) == null || (Session["accountID"]) == null) { Response.Redirect("~/UI/Login.aspx"); } string selected = Request.QueryString["studentID"]; string checkrole = (string)(Session["role"]); string account = (string)(Session["account"]); int staffID = (int)(Session["accountID"]); lbUserName.Text = account; if (checkrole == "HeadStaff") { divide.Visible = true; logCare.Visible = true; control.Visible = true; btnUpdateStaff.Visible = true; lbGuide.Visible = true; drpStaff.Visible = true; } else { divide.Visible = false; logCare.Visible = false; control.Visible = false; btnUpdateStaff.Visible = false; lbGuide.Visible = false; drpStaff.Visible = false; } Business.ScsBO sbo = new Business.ScsBO(); //int staffID = (int)(Session["accountID"]); //ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); //ServiceReference1.Student s = ws.getStudentInf(selected); ServiceReference2.SAPISoapClient fap = new ServiceReference2.SAPISoapClient(); List <StudentProfile> stp = new List <StudentProfile>(); string inf = fap.GetStudentById(selected); stp = JsonConvert.DeserializeObject <List <StudentProfile> >(inf); decimal t = fap.CheckBlance(selected); stImage.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(fap.RetriveImage(selected)); currrentTerm.Text = stp[0].currentTermNo; finance.Text = t.ToString("00.##" + "VND"); dob.Text = stp[0].dateOfBirth.ToString("dd/MM/yyyy"); addr.Text = stp[0].address; name.Text = stp[0].fullName; rollnumb.Text = stp[0].rollNumber; phonenumb.Text = stp[0].phone; mail.Text = stp[0].email; curr.Text = stp[0].batch; member.Text = stp[0].membercode; ktx.Text = stp[0].termPaid; dateofissue.Text = stp[0].dateOfIsue.ToString("dd/MM/yyyy"); major.Text = stp[0].major; mode.Text = stp[0].chuuyenNganh; status.Text = stp[0].statusCode; limit7year.Text = stp[0].HanBayNam; dropout.Text = stp[0].QD_ThoiHoc; changeCampus.Text = stp[0].QD_BaoLuu_Exchange; changeMajor.Text = stp[0].qd_chuyennganh; getDiscipline.Text = stp[0].qD_kyluat; gruadation.Text = stp[0].qD_Tn; svcq.Text = stp[0].QD_SV_ChinhQuy; rejoin.Text = stp[0].qD_rejoin; contact.Text = stp[0].parentPhone; parent.Text = stp[0].parentName; if (!Page.IsPostBack) { string currentSemester = "Spring2018"; RankDAL rdal = new RankDAL(); //Comment cm = sbo.getComment(selected); StatusCheck stk = sbo.loadTickCheckProfile(selected); Rank r = rdal.loadRank(selected, currentSemester); Student st = sbo.loadTakecareStaff(selected); if (!string.IsNullOrEmpty(st.StaffName)) { drpStaff.SelectedValue = st.StaffName; } else { Label24.Text = "Chưa có người chăm sóc , vui lòng chọn NV"; } //TextArea1.Value = cm.content+" bởi "+cm.staffName; drpChangeRank.SelectedValue = r.rank; cbAttent.Checked = stk.attention; } Series series = Chart1.Series["Series1"]; List <GpaTerm> list = sbo.listGpa(selected); Chart1.ChartAreas[0].AxisY.Title = "Điểm trung bình (GPA)"; for (int i = 0; i < list.Count; i++) { series.Points.AddXY(list[i].semester.ToString(), Math.Round(list[i].gpa, 2)); series.ToolTip = " #VALX #VALY"; } List <BehaviorTerm> beList = sbo.beList(selected); Series series2 = Chart2.Series["Series2"]; Chart2.ChartAreas[0].AxisY.Title = "Điểm hành vi (Behavior)"; for (int b = 0; b < beList.Count; b++) { series2.Points.AddXY(beList[b].semester.ToString(), Math.Round(beList[b].behavior, 2)); series2.ToolTip = " #VALX #VALY"; } List <Curricurlum> listFail = new List <Curricurlum>(); string failcourse = fap.getFailCourse(selected); if (!failcourse.Equals("Data not found")) { listFail = JsonConvert.DeserializeObject <List <Curricurlum> >(failcourse); } for (int f = 0; f < listFail.Count; f++) { pnStudy.Controls.Add(new LiteralControl(listFail[f].subjectCode + "</br>")); } this.lbFailnumb.Text = listFail.Count.ToString(); //********************** //string currentSemester = "Spring2018"; ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); ServiceReference1.ArrayOfGetTeacherComment flist = ws.getCommentBehavior(selected); for (int be = 0; be < flist.Count; be++) { Panel3.Controls.Add(new LiteralControl(flist[be].contentComment + " " + flist[be].teacherID + "</br>")); } //***************** DataTable dt = sbo.curriculum(selected); //Building an HTML string. StringBuilder html = new StringBuilder(); //Table start. html.Append("<table id='curi' class='table table-hover'>"); html.Append("<thead>"); //Building the Header row. html.Append("<tr class='info'>"); foreach (DataColumn column in dt.Columns) { html.Append("<th>"); html.Append(column.ColumnName); html.Append("</th>"); } html.Append("</tr>"); html.Append("</thead>"); html.Append("<tbody>"); //Building the Data rows. foreach (DataRow row in dt.Rows) { html.Append("<tr>"); foreach (DataColumn column in dt.Columns) { html.Append("<td>"); html.Append(row[column.ColumnName]); html.Append("</td>"); } html.Append("</tr>"); } //Table end. html.Append("</table>"); html.Append("</tbody>"); //Append the HTML string to Placeholder. Panel1.Controls.Add(new Literal { Text = html.ToString() }); //*************************************** DataTable dt2 = sbo.getTimetable(selected); //Building an HTML string. StringBuilder html2 = new StringBuilder(); //Table start. html2.Append("<table id='time' class='table table-hover'>"); html2.Append("<thead>"); //Building the Header row. html2.Append("<tr class='info'>"); foreach (DataColumn column2 in dt2.Columns) { html2.Append("<th>"); html2.Append(column2.ColumnName); html2.Append("</th>"); } html2.Append("</tr>"); html2.Append("</thead>"); html2.Append("<tbody>"); //Building the Data rows. foreach (DataRow row2 in dt2.Rows) { html2.Append("<tr>"); foreach (DataColumn column2 in dt2.Columns) { html2.Append("<td>"); html2.Append(row2[column2.ColumnName]); html2.Append("</td>"); } html2.Append("</tr>"); } //Table end. html2.Append("</table>"); html2.Append("</tbody>"); //Append the HTML string to Placeholder. scheduleStudy.Controls.Add(new Literal { Text = html2.ToString() }); //******************************************************** DataTable dt3 = sbo.scheduleExam(selected); //Building an HTML string. StringBuilder html3 = new StringBuilder(); //Table start. html3.Append("<table id='exam' class='table table-hover'>"); html3.Append("<thead>"); //Building the Header row. html3.Append("<tr class='info'>"); foreach (DataColumn column3 in dt3.Columns) { html3.Append("<th>"); html3.Append(column3.ColumnName); html3.Append("</th>"); } html3.Append("</tr>"); html3.Append("</thead>"); html3.Append("<tbody>"); //Building the Data rows. foreach (DataRow row3 in dt3.Rows) { html3.Append("<tr>"); foreach (DataColumn column3 in dt3.Columns) { html3.Append("<td>"); html3.Append(row3[column3.ColumnName]); html3.Append("</td>"); } html3.Append("</tr>"); } //Table end. html3.Append("</table>"); html3.Append("</tbody>"); //Append the HTML string to Placeholder. scheduleExam.Controls.Add(new Literal { Text = html3.ToString() }); //grOtherComment.DataBind(); } catch (Exception ee) { Response.Redirect("~/UI/Error.aspx"); } }
public MainMenuOption() { a = new SchedulingBasedAdPosting(); b = new ClientCharges(); c = new StatusCheck(); }