Beispiel #1
0
        protected void btnFinish_Click(object sender, EventArgs e)
        {
            long UserId = 0;

            long.TryParse(Session["UserId"].ToString(), out UserId);

            if (Session["UserType"] != null && Session["UserType"].ToString() == "User")
            {
                JP_DAC dac = new JP_DAC();
                int    res = dac.UpdateUserDetails(UserId, 49);
                if (res > 0)
                {
                    Session["UserId"]   = null;
                    Session["UserType"] = null;
                    Response.Redirect("~/Login.aspx");
                }
                dac = null;
            }
        }
        protected void btnSaveMarks_Click(object sender, EventArgs e)
        {
            //if (txtMarks.Text.Trim().Length == 0)
            //{
            //    mpeUserFolders.Show();
            //}
            //else
            {
                int ModuleId = 49;
                int marks    = 0;
                int.TryParse(ddlMarks.SelectedValue, out marks);

                long UserId = 0;
                long.TryParse(Session["UserId"].ToString(), out UserId);

                if (Session["UserType"] != null && Session["UserType"].ToString() == "Evaluator")
                {
                    long EvaluatorId = 0;
                    long.TryParse(Session["EvaluatorId"].ToString(), out EvaluatorId);

                    JP_DAC dac = new JP_DAC();
                    int    res = dac.UpdateEvaluatorDetails(UserId, EvaluatorId, ModuleId, marks);
                    dac = null;

                    if (res > 0)
                    {
                        Page.ClientScript.RegisterStartupScript(typeof(Page), "marin1", "alert('Your evaluation for this user is saved')", true);
                    }
                    Session["UserId"] = null;
                    //gvUserTestDtls.SelectedIndex = -1;
                    GetUserTestDetails();
                }
                if (Session["UserType"] != null && Session["UserType"].ToString() == "Administrator")
                {
                    Session["UserId"] = null;
                    //Response.Redirect("AdminHome.aspx");
                }
            }
        }
        private void GetUserTestDetails()
        {
            int ModuleId = 49;

            DateTime StartDate = DateTime.Now.Date;
            DateTime EndDate   = DateTime.Now.Date;

            //DateTime.TryParseExact(txtFromDate.Text, sysFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out StartDate);
            //DateTime.TryParseExact(txtToDate.Text, sysFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out EndDate);

            StartDate = Convert.ToDateTime(txtFromDate.Text);
            EndDate   = Convert.ToDateTime(txtToDate.Text);
            gvUserTestDtls.DataSource = null;
            JP_DAC dac = new JP_DAC();

            {
                DataTable dt = dac.Get_OtherUserTestDetails(ModuleId, StartDate, EndDate);
                gvUserTestDtls.DataSource = dt;

                if (dt != null && dt.Rows.Count > 0)
                {
                    int Total_Marks = 0;
                    int.TryParse(dt.Rows[0]["Total_Marks"].ToString(), out Total_Marks);

                    if (Total_Marks != ddlMarks.Items.Count)
                    {
                        for (int i = 0; i <= Total_Marks; i++)
                        {
                            ddlMarks.Items.Add(i.ToString());
                        }
                        ddlMarks.DataBind();
                    }
                }
            }
            gvUserTestDtls.DataBind();
        }