Esempio n. 1
0
    private void ExamCurrent()
    {
        cmd = new SqlCommand("select * from ExamCurrent where SID='" + txtMembership.Text + "'", con);
        SqlDataReader rd = cmd.ExecuteReader();

        if (rd.Read())
        {
            viewdetails.Visible         = true; lblerror.Text = "";
            txtIMID.Text                = rd["IMID"].ToString(); lblName.Text = rd["SName"].ToString(); ddlCourse.SelectedValue = rd["Course"].ToString(); ddlPart.SelectedValue = rd["Part"].ToString();
            ddlExamStatus.SelectedValue = rd["ExamStatus"].ToString();  ddlCourseStatus.SelectedValue = rd["CourseStatus"].ToString();
            if (rd["Stream"].ToString() == "Tech")
            {
                lblStream.Text = "Technician";
            }
            else if (rd["Stream"].ToString() == "Asso")
            {
                lblStream.Text = "Associate";
            }
            txtCousreID.Text         = rd["CourseID"].ToString();
            ddlSession.SelectedValue = rd["Session"].ToString().Substring(0, 3); txtYear.Text = rd["Session"].ToString().Substring(3, 4); lblCourse.Text = rd["Course"].ToString(); lblstreamhidden.Text = rd["Stream"].ToString();
            rd.Close();
            SessionDuration duration = new SessionDuration();
            lblSessionDuration.Text = duration.duration(ddlCourse.SelectedValue.ToString(), ddlPart.SelectedValue.ToString());
            FillGrid();
        }
        else
        {
            rd.Close(); viewdetails.Visible = false; lblerror.Text = "Membership Not Found";
        }
    }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             maikal dev = new maikal();
             int    se  = dev.chksession();
             if (se == 0)
             {
                 ddlExamSeason.SelectedValue = "Sum";
             }
             else
             {
                 ddlExamSeason.SelectedValue = "Win";
             }
             txtYearSeason.Text       = DateTime.Now.Year.ToString();
             lblExamSeasonHidden.Text = ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString();
             sd = new SessionDuration();
             lblExamSeasonHidden.Text = sd.SessionToSessionID(lblExamSeasonHidden.Text).ToString();
             bindGrid();
             panelInVisible.Visible = true;
             panelVisible.Visible   = false;
             ddlExamSeason.Focus();
         }
     }
     catch (NullReferenceException ex)
     {
         Response.Redirect("../Login.aspx");
     }
 }
Esempio n. 3
0
 protected void ddlExamSeason_SelectedIndexChanged(object sender, EventArgs e)
 {
     lblExamSeasonHidden.Text = ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString();
     sd = new SessionDuration();
     lblExamSeasonHidden.Text = sd.SessionToSessionID(lblExamSeasonHidden.Text).ToString();
     txtYearSeason.Focus();
 }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToString(Server.HtmlEncode(Request.Cookies["MyLogin"]["PWD"])) == "")
            {
                Response.Redirect("../Login.aspx");
            }
            if (!IsPostBack)
            {
                txtYearSeason.Text = DateTime.Now.Year.ToString();
                maikal          dev = new maikal();
                int             se  = dev.chksession();
                SessionDuration sd  = new SessionDuration();
                if (se == 0)
                {
                    ddlExamSeason.SelectedValue = "Sum";
                }
                else
                {
                    ddlExamSeason.SelectedValue = "Win";
                }                                            // lblFromName.Text = "Membership No:";
                lblSeasonHidden.Text = sd.SessionToSessionID(ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString()).ToString();
                txtYearSeason.Text   = DateTime.Now.Year.ToString();
                lblSeasonHidden.Text = sd.SessionToSessionID(ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString()).ToString();

                ddlExamSeason.Focus();
            }
        }
        catch (NullReferenceException ex)
        {
            Response.Redirect("../Login.aspx");
        }
    }
Esempio n. 5
0
        //GET /api/login?user=<string>&pwd=<string>
        public lResponse Get(string user, string pwd)
        {
            lResponse result = new lResponse();

            try
            {
                using (ISession session = ApplicationCore.Instance.SessionFactory.OpenSession())
                {
                    using (session.BeginTransaction())
                    {
                        //carico la risposta
                        if (session.QueryOver <Users>().Where(u => u.Login == user && u.Pwd == pwd).List().Count == 1)
                        {
                            result.token = Guid.NewGuid().ToString();
                            SessionDuration sd = new SessionDuration()
                            {
                                Token    = result.token,
                                Deadline = DateTime.Now.AddHours(1)
                            };
                            session.Save(sd);
                        }
                        session.Transaction.Commit();
                    }
                }
            }
            catch (Exception ex)
            {
                result.error = new SerializedError(ex);
            }
            return(result);
        }
Esempio n. 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Server.HtmlEncode(Request.Cookies["MyLogin"]["PWD"]) == null)
         {
             Response.Redirect("../Login.aspx");
         }
         if (!IsPostBack)
         {
             PnlMembership.Visible = false; pnlSpace.Visible = true; btnSubmit.Enabled = false; invisible(); pnlMain.Visible = false;
             maikal dev = new maikal();
             int    se  = dev.chksession();
             if (se == 0)
             {
                 ddlsession.SelectedValue = "Sum";
             }
             else
             {
                 ddlsession.SelectedValue = "Win";
             }
             txtSession.Text        = DateTime.Now.Year.ToString();
             lblSessionHiddend.Text = ddlsession.SelectedValue.ToString() + "" + txtSession.Text.ToString();
             SessionDuration sd = new SessionDuration();
             lblSessionID.Text = sd.SessionToSessionID(lblSessionHiddend.Text.ToString()).ToString();
         }
     }
     catch (NullReferenceException ex)
     {
         Response.Redirect("../Login.aspx");
     }
 }
Esempio n. 7
0
        public async Task StopTimer(string sessionCode, int durationInSeconds)
        {
            _duration = SessionDuration.Durations.GetOrAdd(Context.ConnectionId, _duration) as SessionDuration;
            // Maybe I should find a way to better dispose of it
            //_duration.Elapsed -= (sender, e) => UpdateDuration(sender, e, sessionCode, DateTime.Now.AddSeconds(durationInSeconds));
            _duration.Enabled = false;

            # pragma warning disable CA2007
Esempio n. 8
0
        public async Task StartTimer(string sessionCode, int durationInSeconds)
        {
            _duration = SessionDuration.Durations.GetOrAdd(Context.ConnectionId, _duration) as SessionDuration;
            var endTime = DateTime.Now.AddSeconds(durationInSeconds);

            _duration.Elapsed += (sender, e) => UpdateDuration(sender, e, sessionCode, endTime);
            _duration.Interval = 1000;
            _duration.Enabled  = true;
        }
Esempio n. 9
0
    private void FinalPassCourse()
    {
        string query = "";
        bool   flag  = true;

        if (ddlFinalPassCourse.SelectedValue == "CivilPartII")
        {
            query        = "select SessionID,Part,Certificate from SFinalPass where SID='" + txtMem.Text.ToString() + "' and Course='Civil' and Part='PartII' ";
            lblPart.Text = "PartII";
        }
        else if (ddlFinalPassCourse.SelectedValue == "CivilSectionB")
        {
            query        = "select SessionID,Part,Certificate from SFinalPass where SID='" + txtMem.Text.ToString() + "' and Course='Civil' and Part='SectionB' ";
            lblPart.Text = "SectionB";
        }
        else if (ddlFinalPassCourse.SelectedValue == "ArchiPartII")
        {
            query        = "select SessionID,Part,Certificate from SFinalPass where SID='" + txtMem.Text.ToString() + "' and Course='Architecture' and Part='PartII'";
            lblPart.Text = "PartII";
        }
        else if (ddlFinalPassCourse.SelectedValue == "ArchiSectionB")
        {
            query        = "select SessionID,Part,Certificate from SFinalPass where SID='" + txtMem.Text.ToString() + "' and Course='Architecture' and Part='SectionB' ";
            lblPart.Text = "SectionB";
        }
        else
        {
            lblExceptionOK.Text = "Please Select Course";
            flag = false;
        }
        if (flag == true)
        {
            cmd = new SqlCommand(query, con);
            SqlDataReader reader  = cmd.ExecuteReader();
            string        strPart = "";
            if (reader.Read())
            {
                lblSessionID.Text = reader["SessionID"].ToString();
                strPart           = reader["Part"].ToString();
                finalpassFees(lblSessionID.Text, strPart); // Get FinalPass(Certificate Fees) according to SessionID
                btnSubmit.Enabled   = true;
                lblExceptionOK.Text = "";
            }
            else
            {
                lblExceptionOK.Text      = "";
                lblExceptionOK.ForeColor = System.Drawing.Color.Red;
                SessionDuration sd = new SessionDuration();
                lblSessionID.Text = sd.SessionToSessionID(lblSessionHiddend.Text.ToString()).ToString();
                finalpassFees(lblSessionID.Text, lblPart.Text); // Get FinalPass(Certificate Fees) according to SessionID
                btnSubmit.Enabled = true;
            }
        }
    }
        public void OnPacketSessionData(ref PacketSessionData pSessionData, PacketSource _)
        {
            var timestamp   = DateTime.Now;
            var sessionId   = pSessionData.Header.SessionUID;
            var sessionTime = pSessionData.Header.SessionTime;

            var weather = new WeatherInfo(
                (Weather)pSessionData.Weather,
                pSessionData.TrackTemperature,
                pSessionData.AirTemperature,
                sessionId,
                timestamp,
                sessionTime);

            _newPacketRead?.Invoke(this, weather);

            var trackInfo = new TrackInfo(
                (Track)pSessionData.TrackId,
                pSessionData.TrackLength,
                sessionId,
                timestamp,
                sessionTime);

            _newPacketRead?.Invoke(this, trackInfo);

            var sessionPause = pSessionData.GamePaused != 0
                ? (Event) new SessionPause(sessionId, timestamp, sessionTime)
                : (Event) new SessionResume(sessionId, timestamp, sessionTime);

            _newPacketRead?.Invoke(this, sessionPause);

            var sessionDuration = new SessionDuration(TimeSpan.FromSeconds(pSessionData.SessionDuration), sessionId, timestamp, sessionTime);

            _newPacketRead?.Invoke(this, sessionDuration);

            var sessionTimeLeft = new SessionTimeLeft(TimeSpan.FromSeconds(pSessionData.SessionTimeLeft), sessionId, timestamp, sessionTime);

            _newPacketRead?.Invoke(this, sessionTimeLeft);
        }
Esempio n. 11
0
    protected void btnSessionOK_OnClick(object sender, EventArgs e)
    {
        SessionDuration sd = new SessionDuration();

        lblSeasonHidden.Text = sd.SessionToSessionID(ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString()).ToString();
    }
Esempio n. 12
0
 private void Update()
 {
     text.text = SessionDuration.FormatTime();
 }
Esempio n. 13
0
 void PrintSessionLength()
 {
     Debug.Log("SESSION TIME: " + SessionDuration.FormatTime(Time.time));
 }
Esempio n. 14
0
 protected void txtYearSeason_TextChanged(object sender, EventArgs e)
 {
     sd = new SessionDuration();
     lblExamSeasonHidden.Text = sd.SessionToSessionID(ddlExamSeason.SelectedValue.ToString() + "" + txtYearSeason.Text.ToString()).ToString();
     btnPromoteResult.Focus();
 }
Esempio n. 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToString(Server.HtmlEncode(Request.Cookies["MyLogin"]["PWD"])) == "")
            {
                Response.Redirect("../Login.aspx");
            }
            if (!IsPostBack)
            {
                showimg();
                try
                {
                    SqlDataReader reader;
                    con.Open();
                    lbtnUserName.Text = Convert.ToString(Request.QueryString["dev"]);
                    SqlCommand cmd = new SqlCommand("select * from Login where LogName='" + Convert.ToString(Server.HtmlEncode(Request.Cookies["MyLogin"]["UID"])) + "' and Password='******'", con);
                    reader = cmd.ExecuteReader();
                    if (reader.Read())
                    {
                        lbtnUserName.Text = Convert.ToString(reader[1].ToString());
                        int lvl = Convert.ToInt32(reader[20].ToString());
                        if (lvl == 0)
                        {
                            lblWelcome.Text = "Administrator";
                        }
                        else if (lvl == 1)
                        {
                            lblWelcome.Text     = "Admin";
                            panelUpdate.Visible = false;
                        }
                        else if (lvl == 2)
                        {
                            panelExamForm.Visible    = false; panelSeatingArrangement.Visible = false; panelDegree.Visible = false; panelPaperSetter.Visible = false;
                            panelExamPaper.Visible   = false; panelMarksFeed.Visible = false; PanelAdmitCard.Visible = false; PanelRollNo.Visible = false; panelExamSchedule.Visible = false;
                            panelCertificate.Visible = false; panelExamCenter.Visible = false; panelMarking.Visible = false; panelUFM.Visible = false; panelRechecking.Visible = false;
                            panelUpdate.Visible      = false;
                            lblWelcome.Text          = "User ID";
                            usermanage.Visible       = false;
                            if (reader["ExamForm"].ToString() == "ExamForm")
                            {
                                panelExamForm.Visible = true;
                            }
                            if (reader["Seating"].ToString() == "Seating")
                            {
                                panelSeatingArrangement.Visible = true;
                            }
                            if (reader["Marksheet"].ToString() == "Marksheet")
                            {
                                panelDegree.Visible = true;
                            }
                            if (reader["PaperSetter"].ToString() == "PaperSetter")
                            {
                                panelPaperSetter.Visible = true;
                            }
                            if (reader["ExamPaper"].ToString() == "ExamPaper")
                            {
                                panelExamPaper.Visible = true;
                            }
                            if (reader["MarksFeed"].ToString() == "MarksFeed")
                            {
                                panelMarksFeed.Visible = true;
                            }
                            if (reader["AdmitCard"].ToString() == "AdmitCard")
                            {
                                PanelAdmitCard.Visible = true;
                            }
                            if (reader["RollNO"].ToString() == "RollNO")
                            {
                                PanelRollNo.Visible = true;
                            }
                            if (reader["ExamAdmin1"].ToString() == "ExamSchedule")
                            {
                                panelExamSchedule.Visible = true;
                            }
                            if (reader["Certi"].ToString() == "Certi")
                            {
                                panelCertificate.Visible = true;
                            }
                            if (reader["ExamCenter"].ToString() == "ECenter")
                            {
                                panelExamCenter.Visible = true;
                            }
                            if (reader["Marking"].ToString() == "Marking")
                            {
                                panelMarking.Visible = true;
                            }
                            if (reader["UFM"].ToString() == "UFM")
                            {
                                panelUFM.Visible = true;
                            }
                            if (reader["Rechecking"].ToString() == "Rechecking")
                            {
                                panelRechecking.Visible = true;
                            }
                        }
                    }
                    reader.Close();
                    reader.Dispose();

                    maikal dev = new maikal();
                    int    se  = dev.chksession();
                    if (se == 0)
                    {
                        ddlSession.SelectedValue = "Sum";
                    }
                    else
                    {
                        ddlSession.SelectedValue = "Win";
                    }
                    txtYear.Text  = DateTime.Now.Year.ToString();
                    sd            = new SessionDuration();
                    SeasonId.Text = sd.SessionToSessionID(ddlSession.SelectedValue.ToString() + "" + txtYear.Text.ToString()).ToString();
                    ddlSession.Focus();
                    this.Session["UploadDetail"] = new UploadDetail {
                        IsReady = false
                    };
                    LoadUploadedFiles(ref gvNewFiles);
                    con.Close(); con.Dispose();
                }
                catch (SqlException ex)
                {
                    lblWelcome.Text = "Error";
                }
            }
        }
        catch (NullReferenceException ex)
        {
            Response.Redirect("../Login.aspx");
        }
    }
Esempio n. 16
0
 protected void ddlSession_SelectedIndexChanged(object sender, EventArgs e)
 {
     sd            = new SessionDuration();
     SeasonId.Text = sd.SessionToSessionID(ddlSession.SelectedValue.ToString() + "" + txtYear.Text.ToString()).ToString();
     txtYear.Focus();
 }
Esempio n. 17
0
 public SessionHub(SessionDuration sessionDuration)
 {
     _duration = sessionDuration;
 }