Exemplo n.º 1
0
    protected void lbtnSignOut_Click(object sender, EventArgs e)
    {
        try
        {
            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID)
                               , Convert.ToInt32(AppSessions.EmployeeOrStudentID)
                               , Convert.ToInt16(AppSessions.DivisionID)
                               , this.Page.AppRelativeVirtualPath
                               , "lbtnSignOut", "Click"
                               , Convert.ToDateTime(System.DateTime.Now)
                               , AppSessions.SessionID.ToString()
                               , StringEnum.stringValueOf(EnumFile.Activity.LogoutSuccess)
                               , "LoginID: " + AppSessions.UserName
                               , Convert.ToInt32(AppSessions.BMSSCTID));
        }
        catch (Exception)
        {
        }

        Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];

        if (sessions == null)
        {
            sessions = new Hashtable();
        }

        if (Session["EmpolyeeID"] != null)
        {
            sessions.Remove(Session["EmpolyeeID"].ToString());
        }

        if (Session["StudentID"] != null)
        {
            sessions.Remove(Session["StudentID"].ToString());
        }

        Application.Lock();
        Application["WEB_SESSIONS_OBJECT"] = sessions;
        Application.UnLock();


        HttpContext.Current.Session.Clear();
        HttpContext.Current.Session.Abandon();

        Response.Redirect("~/Index.aspx");
    }
Exemplo n.º 2
0
    protected void Dvw_PersonalDetails_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        try
        {
            if (Dvw_PersonalDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Label           lbl_findStudentid  = (Label)Dvw_PersonalDetails.Rows[0].FindControl("Lbl_EditStudentId");
                FileUpload      pictup             = (FileUpload)Dvw_PersonalDetails.Rows[1].FindControl("pictureupload");
                TextBox         txt_findFirstName  = (TextBox)Dvw_PersonalDetails.Rows[2].FindControl("Txt_EditFirstName");
                TextBox         txt_findMiddleName = (TextBox)Dvw_PersonalDetails.Rows[3].FindControl("Txt_EditMiddleName");
                TextBox         txt_findLastName   = (TextBox)Dvw_PersonalDetails.Rows[4].FindControl("Txt_EditLastName");
                TextBox         txt_findAddress    = (TextBox)Dvw_PersonalDetails.Rows[5].FindControl("Txt_EditAddress");
                TextBox         txt_findContact    = (TextBox)Dvw_PersonalDetails.Rows[6].FindControl("Txt_EditContact");
                TextBox         txt_findMobile     = (TextBox)Dvw_PersonalDetails.Rows[7].FindControl("Txt_EditMobile");
                TextBox         txt_findEmail      = (TextBox)Dvw_PersonalDetails.Rows[8].FindControl("Txt_EditEmail");
                TextBox         txt_findBithdate   = (TextBox)Dvw_PersonalDetails.Rows[9].FindControl("Txt_EditBirthdate");
                RadioButtonList rbLst_findGender   = (RadioButtonList)Dvw_PersonalDetails.Rows[10].FindControl("Rbtn_EditGender");
                TextBox         txt_findBloodGroup = (TextBox)Dvw_PersonalDetails.Rows[11].FindControl("Txt_EditBloodGroup");
                TextBox         txt_findCity       = (TextBox)Dvw_PersonalDetails.Rows[12].FindControl("Txt_EditSchoolCity");
                TextBox         txt_findzipcode    = (TextBox)Dvw_PersonalDetails.Rows[13].FindControl("Txt_EditSchoolZipcode");
                TextBox         txt_findstate      = (TextBox)Dvw_PersonalDetails.Rows[14].FindControl("Txt_EditState");
                TextBox         txt_findcountry    = (TextBox)Dvw_PersonalDetails.Rows[15].FindControl("Txt_EditCountry");

                Student_BLogic obj_studblogic = new Student_BLogic();
                Student        obj_student    = new Student();

                obj_student.studentid   = int.Parse(lbl_findStudentid.Text);
                obj_student.firstname   = txt_findFirstName.Text;
                obj_student.middlename  = txt_findMiddleName.Text;
                obj_student.lastname    = txt_findLastName.Text;
                obj_student.Address     = txt_findAddress.Text;
                obj_student.contactno   = long.Parse(txt_findContact.Text);
                obj_student.mobileno    = long.Parse(txt_findMobile.Text);
                obj_student.emailid     = txt_findEmail.Text;
                obj_student.dateofbirth = DateTime.Parse(txt_findBithdate.Text);

                if (rbLst_findGender.SelectedIndex == 0)
                {
                    obj_student.gender = 'M';
                }
                else if (rbLst_findGender.SelectedIndex == 1)
                {
                    obj_student.gender = 'F';
                }

                Byte[] imgByte = null;
                if (pictup.HasFile && pictup.PostedFile != null)
                {
                    HttpPostedFile File = pictup.PostedFile;
                    imgByte = new Byte[File.ContentLength];

                    DataAccess da     = new DataAccess();
                    ArrayList  tmplst = new ArrayList();
                    tmplst.Add(new parameter("FieldName", "UploadImageSize"));
                    DataSet dsgetSetting = da.DAL_Select("PROC_GetConfig", tmplst);

                    int allowed_bytes = int.Parse(dsgetSetting.Tables[0].Rows[0]["value"].ToString());
                    if (File.ContentLength <= allowed_bytes)
                    {
                        File.InputStream.Read(imgByte, 0, File.ContentLength);
                    }
                    else
                    {
                        imgByte = (byte[])ViewState["byteimage"];
                    }
                }
                else
                {
                    try { imgByte = (byte[])ViewState["byteimage"]; }
                    catch { }
                }
                obj_student.Picture = imgByte;

                obj_student.bloodgroup = txt_findBloodGroup.Text;
                obj_student.City       = txt_findCity.Text;
                obj_student.Zipcode    = txt_findzipcode.Text;
                obj_student.State      = txt_findstate.Text;
                obj_student.Country    = txt_findcountry.Text;

                obj_studblogic.UpdateStudentProfile(obj_student, "personal");

                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.ReadOnly);
                Student        Student     = new Student();
                Student_BLogic BAL_Student = new Student_BLogic();
                Student.studentid = AppSessions.StudentID;
                DataSet dsSelect = new DataSet();
                dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID");

                Dvw_PersonalDetails.DataSource = dsSelect;
                Dvw_PersonalDetails.DataBind();

                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Save Button", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountProfileSectionUpdated), "Updated Personal Details.", 0);
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 3
0
    protected void btnChangesubmit_Click(object sender, EventArgs e)
    {
        if (AppSessions.RoleID == 4)//student
        {
            //Employee_BLogic BEmployee = new Employee_BLogic();
            //Employee PEmployee = new Employee();
            //PEmployee.roleid = AppSessions.RoleID;
            //PEmployee.userid = "";
            //PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
            //PEmployee.password = txtnp.Text;
            //PEmployee.modifiedby = AppSessions.EmpolyeeID;
            //BEmployee.BAL_Employee_Password_Update(PEmployee);
            //lblmsg.Visible = true;
            DataSet   dtLogin   = new DataSet();
            DataTable LoginInfo = new DataTable();
            DataTable UserInfo  = new DataTable();

            SYS_Role        obj_SYS_Role     = new SYS_Role();
            SYS_Role_BLogic obj_BAL_SYS_Role = new SYS_Role_BLogic();
            obj_SYS_Role.Username = AppSessions.LoginID;
            obj_SYS_Role.Password = txtop.Text;

            dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
            LoginInfo = dtLogin.Tables[0];

            if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
            {
                Employee_BLogic BEmployee = new Employee_BLogic();
                Employee        PEmployee = new Employee();
                PEmployee.roleid      = AppSessions.RoleID;
                PEmployee.userid      = "";
                PEmployee.Studentlist = Convert.ToString(AppSessions.StudentID);
                PEmployee.password    = txtnp.Text;
                PEmployee.modifiedby  = AppSessions.EmpolyeeID;
                BEmployee.BAL_Employee_Password_Update(PEmployee);
                lblmsg.Text = "Password changed successfully";

                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Change Password Tab", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountChangedPassword), "Changed Password > From :  " + txtop.Text + " To : " + txtnp.Text, 0);
            }
            else
            {
                lblmsg.Visible = true;
                lblmsg.Text    = "Please enter valid old password.";
                //WebMsg.Show("Please enter valid old password.");
            }
        }
        else if (AppSessions.RoleID == 3 || AppSessions.RoleID == 2 || AppSessions.RoleID == 1) //3-teacher,2-sadmin,1-epath-admin
        {
            Employee_BLogic BEmployee = new Employee_BLogic();
            Employee        PEmployee = new Employee();
            PEmployee.roleid      = AppSessions.RoleID;
            PEmployee.userid      = Convert.ToString(AppSessions.EmpolyeeID);
            PEmployee.Studentlist = "";
            PEmployee.password    = txtnp.Text;
            PEmployee.modifiedby  = AppSessions.EmpolyeeID;
            BEmployee.BAL_Employee_Password_Update(PEmployee);
        }
    }
Exemplo n.º 4
0
    protected void Dvw_EducationalDetails_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        try
        {
            if (Dvw_EducationalDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Label   lbl_findStudentid     = (Label)Dvw_EducationalDetails.Rows[0].FindControl("Lbl_EditEduStudentId");
                TextBox Txt_findSchoolName    = (TextBox)Dvw_EducationalDetails.Rows[2].FindControl("Txt_EditSchool");
                TextBox Txt_findSchoolContact = (TextBox)Dvw_EducationalDetails.Rows[3].FindControl("Txt_EditSchoolContact");
                TextBox Txt_findSchoolEmail   = (TextBox)Dvw_EducationalDetails.Rows[4].FindControl("Txt_EditSchoolEmail");

                Student_BLogic obj_studblogic = new Student_BLogic();
                Student        obj_student    = new Student();

                obj_student.studentid     = int.Parse(lbl_findStudentid.Text);
                obj_student.schoolname    = Txt_findSchoolName.Text;
                obj_student.SchoolContact = Txt_findSchoolContact.Text;
                obj_student.SchoolEmail   = Txt_findSchoolEmail.Text;

                obj_studblogic.UpdateStudentProfile(obj_student, "education");

                Dvw_EducationalDetails.ChangeMode(DetailsViewMode.ReadOnly);

                Student        Student     = new Student();
                Student_BLogic BAL_Student = new Student_BLogic();
                Student.studentid = AppSessions.StudentID;
                DataSet dsSelect = new DataSet();
                dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID");

                Dvw_EducationalDetails.DataSource = dsSelect;
                Dvw_EducationalDetails.DataBind();

                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Save Button", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountProfileSectionUpdated), "Updated Educational Details.", 0);
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 5
0
    protected void btnClose_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnClose", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.Quitprayer), "Quit Morning/Evening Prayer.", 0);

        mp1.Hide();
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);
        obj_Teacher_Dashboard.ExamName   = TxtExamName.Text;
        obj_Teacher_Dashboard.TotalQues  = Convert.ToInt32(TxtTotalQuestions.Text);
        obj_Teacher_Dashboard.TotalMarks = Convert.ToInt32(TxtTotalMarks.Text);

        int bmssctid = obj_BAL_Teacher_Dashboard.Get_BMSSCTID(obj_Teacher_Dashboard);

        if (bmssctid == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("BMSSCT does not exists.");
        }
        else
        {
            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ExamEntryPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExamCreatedSuccessfully), "BMSSCT ID = " + bmssctid + " Exam Name : " + TxtExamName.Text + " Exam Marks : " + TxtTotalMarks.Text, bmssctid);

            obj_Teacher_Dashboard.BMSSCTID = Convert.ToInt64(bmssctid);
            int result = obj_BAL_Teacher_Dashboard.BAL_Insert_Exam(obj_Teacher_Dashboard);
            if (result == ((int)EnumFile.AssignValue.One))
            {
                WebMsg.Show("Exam entry has been entered successfully.");
            }
            else if (result == ((int)EnumFile.AssignValue.Zero))
            {
                WebMsg.Show("This exam entry already exists.");
            }
        }
        ClearControls();
    }
Exemplo n.º 7
0
    //public void ShowMessage(string message)
    //{
    //    this.lblMessage.Text = message;
    //    ModalMessageExtender.Show();
    //}

    protected void RedirectToDashboard()
    {
        try
        {
            // 0 Indicates Student

            StudentDash    = new StudentDash();
            BLogic_Student = new Student_DashBoard_BLogic();

            DataSet   dtLogin   = new DataSet();
            DataTable LoginInfo = new DataTable();
            DataTable UserInfo  = new DataTable();

            obj_SYS_Role          = new SYS_Role();
            obj_BAL_SYS_Role      = new SYS_Role_BLogic();
            obj_SYS_Role.Username = txtEmail.Text;
            obj_SYS_Role.Password = ViewState["strpassword"].ToString();

            //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);
            //if (uctxtEmail.Text != "" && uctxtpass.Text != "")
            //{

            dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
            LoginInfo = dtLogin.Tables[0];
            //}
            if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
            {
                AppSessions.AppUserType = "Student";

                AppSessions.StudentID = Convert.ToInt32(LoginInfo.Rows[0]["StudentID"].ToString());
                AppSessions.UserName  = LoginInfo.Rows[0]["FirstName"].ToString();

                AppSessions.BMSID = Convert.ToInt32(LoginInfo.Rows[0]["BMSID"].ToString());
                AppSessions.BMS   = LoginInfo.Rows[0]["BMS"].ToString();

                AppSessions.BoardID = Convert.ToInt32(LoginInfo.Rows[0]["BoardID"].ToString());
                AppSessions.Board   = LoginInfo.Rows[0]["Board"].ToString();

                AppSessions.MediumID = Convert.ToInt32(LoginInfo.Rows[0]["MediumID"].ToString());
                AppSessions.Medium   = LoginInfo.Rows[0]["Medium"].ToString();

                AppSessions.StandardID = Convert.ToInt32(LoginInfo.Rows[0]["StandardID"].ToString());
                AppSessions.Standard   = LoginInfo.Rows[0]["Standard"].ToString();

                AppSessions.DivisionID = Convert.ToInt32(LoginInfo.Rows[0]["DivisionID"].ToString());
                //AppSessions.Division = LoginInfo.Rows[0]["Division"].ToString();

                AppSessions.SchoolID = Convert.ToInt32(LoginInfo.Rows[0]["SchoolID"].ToString());
                //AppSessions.SchoolName = LoginInfo.Rows[0]["SchoolName"].ToString();

                AppSessions.Role   = LoginInfo.Rows[0]["Role"].ToString();
                AppSessions.RoleID = Convert.ToInt32(LoginInfo.Rows[0]["RoleID"].ToString());

                AppSessions.IsFreePackage = IsFreePackage();


                //AppSessions.EmailID = Convert.ToString(LoginInfo.Rows[0]["EmailID"]);

                //yourLoginMethodStudent(LoginInfo);
                bool AllowMultipleSession = false;
                AllowMultipleSession = Convert.ToBoolean(LoginInfo.Rows[0]["AllowMultipleSession"].ToString());


                //Hashtable sessions1 = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                //HttpSessionState existingUserSession1 = (HttpSessionState)sessions1[Session["StudentID"].ToString()];
                //if (existingUserSession1 != null)
                //{
                //    Response.Redirect("../Dashboard/StudentDashboard.aspx");
                //}

                if (AllowMultipleSession == false)
                {
                    Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                    if (sessions == null)
                    {
                        sessions = new Hashtable();
                    }

                    HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["StudentID"].ToString()];
                    if (existingUserSession != null)
                    {
                        ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                        //logout current logged in user
                        WebMsg.Show("you are already logged in.");
                        return;
                    }
                }

                ////////getting the pointer to the Session of the current logged in user
                yourLoginMethodStudent(LoginInfo);
                //ProceedToRedirectPage(LoginInfo);

                bool    AllowPayment  = false;
                DataSet dsPaymentInfo = new DataSet();
                dsPaymentInfo = BLogic_Student.BAL_Select_PaymentPagesInfo("Payment");
                if (dsPaymentInfo != null & dsPaymentInfo.Tables.Count > 0)
                {
                    if (dsPaymentInfo.Tables[0].Rows.Count > 0)
                    {
                        string a = dsPaymentInfo.Tables[0].Rows[0]["value"].ToString();
                        if (a == "0")
                        {
                            AllowPayment = false;
                        }
                        else
                        {
                            AllowPayment = true;
                        }
                    }
                }

                DataSet ds = new DataSet();
                StudentDash.StudentID = AppSessions.StudentID;
                //ds = BLogic_Student.BAL_Validate_Student(StudentDash);
                ds = BLogic_Student.BAL_Validate_Student_Package(StudentDash);
                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtEmail.Text, 0);


                if (AllowPayment == true)
                {
                    //Session["ShowPaymentPages"] = "yes";
                    if (ds != null && dtLogin.Tables.Count > 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            Session["CheckValidity"] = "Yes";
                            ProceedToRedirect();
                        }
                        else
                        {
                            ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('We have sent your Login details on your registered Email Address, kindly check your Email to get your Password.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                            //Response.Redirect("~/DashBoard/StudentDashboard.aspx", false);
                            //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Congratulation! You got free trial for 30 days. \\n We have sent your Login details on your registered Email Address.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + txtEmail.Text, 0);
                        }
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('We have sent your Login details on your registered Email Address, kindly check your Email to get your Password.  ');window.open('../DashBoard/StudentDashboard.aspx','_self');", true);
                        //Response.Redirect("~/DashBoard/StudentDashboard.aspx", false);
                        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + txtEmail.Text, 0);
                    }
                }
                else
                {
                    Session["CheckValidity"]    = "Yes";
                    Session["ShowPaymentPages"] = "No";
                    ProceedToRedirect();
                }
            }
        }
        catch (Exception)
        {
        }
    }
Exemplo n.º 8
0
 protected void btnAttendance_Click(object sender, EventArgs e)
 {
     if (btnAttendance.Text == "Take Attendance")
     {
         Response.Redirect("~/Teacher/StudentAttendance.aspx");
         TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnAttendance", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.TakeAttendance), "Take Attendance.", 0);
     }
     else if (btnAttendance.Text == "View Attendance")
     {
         Response.Redirect("~/Teacher/StudentAttendance.aspx");
         TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnAttendance", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ViewAttendance), "View Attendance.", 0);
     }
 }
Exemplo n.º 9
0
    protected void btnReset_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ReschedulingChapterTopicPage", "btnReset", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResetReschedulingRequest), "Reset Rescheduling Request.", 0);
        DropDownList[] disddl3 = { ddlChapter, ddlTopic };
        DisableDropDwon(disddl3);

        DropDownList[] disddl = { ddlChapter };
        EnableDropDwon(disddl);
    }
Exemplo n.º 10
0
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        ArrayList alistContacts = new ArrayList();
        string    Body          = string.Empty;

        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.EmployeeID = Convert.ToInt64(Session["EmpolyeeID"]);
        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);

        int result = obj_BAL_Teacher_Dashboard.BAL_Insert_Rescheduling_BMSSCT(obj_Teacher_Dashboard);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ReschedulingChapterTopicPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ReschedulingRequestSubmited), "Request for Rescheduling BMSSCT ID : " + bmssctid, bmssctid);

        if (result == ((int)EnumFile.AssignValue.One))
        {
            alistContacts = GetEmailAddress();
            Body          = GenerateEmailBody();
            EmailUtility.SendEmail(alistContacts, "Rescheduling request notification", Body);
            WebMsg.Show("Rescheduling request sent successfully.");
            Applied_Chapter_Topics();
        }
        else if (result == ((int)EnumFile.AssignValue.Zero))
        {
            WebMsg.Show("This Chapter, Topic are already requested for Rescheduling.");
        }

        DropDownList[] disddl3 = { ddlChapter, ddlTopic };
        DisableDropDwon(disddl3);

        DropDownList[] disddl = { ddlChapter };
        EnableDropDwon(disddl);
    }
    protected void btnGo_Click(object sender, EventArgs e)
    {
        try
        {
            StoreCookie();
            int status = CheckLogin();
            //if (ddlUserType.SelectedValue == "0")
            if (status == 2)
            {
                WebMsg.Show("invalid username or password");
                return;
            }
            else if (status == 0)
            {
                // 0 Indicates Student

                StudentDash    = new StudentDash();
                BLogic_Student = new Student_DashBoard_BLogic();

                DataSet   dtLogin   = new DataSet();
                DataTable LoginInfo = new DataTable();
                DataTable UserInfo  = new DataTable();

                obj_SYS_Role          = new SYS_Role();
                obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                obj_SYS_Role.Username = txtUserName.Text;
                obj_SYS_Role.Password = txtUserPassword.Text;
                //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);

                dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
                LoginInfo = dtLogin.Tables[0];
                if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
                {
                    AppSessions.AppUserType = "Student";

                    AppSessions.StudentID = Convert.ToInt32(LoginInfo.Rows[0]["StudentID"].ToString());
                    AppSessions.UserName  = LoginInfo.Rows[0]["FirstName"].ToString();

                    AppSessions.BMSID = Convert.ToInt32(LoginInfo.Rows[0]["BMSID"].ToString());
                    AppSessions.BMS   = LoginInfo.Rows[0]["BMS"].ToString();

                    AppSessions.BoardID = Convert.ToInt32(LoginInfo.Rows[0]["BoardID"].ToString());
                    AppSessions.Board   = LoginInfo.Rows[0]["Board"].ToString();

                    AppSessions.MediumID = Convert.ToInt32(LoginInfo.Rows[0]["MediumID"].ToString());
                    AppSessions.Medium   = LoginInfo.Rows[0]["Medium"].ToString();

                    AppSessions.StandardID = Convert.ToInt32(LoginInfo.Rows[0]["StandardID"].ToString());
                    AppSessions.Standard   = LoginInfo.Rows[0]["Standard"].ToString();

                    AppSessions.DivisionID = Convert.ToInt32(LoginInfo.Rows[0]["DivisionID"].ToString());
                    //AppSessions.Division = LoginInfo.Rows[0]["Division"].ToString();

                    AppSessions.SchoolID = Convert.ToInt32(LoginInfo.Rows[0]["SchoolID"].ToString());
                    //AppSessions.SchoolName = LoginInfo.Rows[0]["SchoolName"].ToString();

                    AppSessions.Role   = LoginInfo.Rows[0]["Role"].ToString();
                    AppSessions.RoleID = Convert.ToInt32(LoginInfo.Rows[0]["RoleID"].ToString());

                    yourLoginMethodStudent(LoginInfo);

                    bool    AllowPayment  = false;
                    DataSet dsPaymentInfo = new DataSet();
                    dsPaymentInfo = BLogic_Student.BAL_Select_PaymentPagesInfo("Payment");
                    if (dsPaymentInfo != null & dsPaymentInfo.Tables.Count > 0)
                    {
                        if (dsPaymentInfo.Tables[0].Rows.Count > 0)
                        {
                            string a = dsPaymentInfo.Tables[0].Rows[0]["value"].ToString();
                            if (a == "0")
                            {
                                AllowPayment = false;
                            }
                            else
                            {
                                AllowPayment = true;
                            }
                        }
                    }


                    DataSet ds = new DataSet();
                    StudentDash.StudentID = AppSessions.StudentID;
                    // ds = BLogic_Student.BAL_Validate_Student(StudentDash);
                    ds = BLogic_Student.BAL_Validate_Student_Package(StudentDash);


                    if (AllowPayment == true)
                    {
                        if (ds != null && dtLogin.Tables.Count > 0)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                Session["CheckValidity"] = "Yes";
                                ProceedToRedirect();
                            }
                            else
                            {
                                Response.Redirect("~/DashBoard/SelectPackage.aspx");
                            }
                        }
                        else
                        {
                            Response.Redirect("~/DashBoard/SelectPackage.aspx");
                        }
                    }
                    else
                    {
                        Session["CheckValidity"]    = "Yes";
                        Session["ShowPaymentPages"] = "No";
                        ProceedToRedirect();
                    }
                }
            }
            else if (status == 1)
            {
                // 1 Indicates Teacher
                DataSet   dtLogin   = new DataSet();
                DataTable LoginInfo = new DataTable();
                DataTable UserInfo  = new DataTable();

                obj_SYS_Role          = new SYS_Role();
                obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                obj_SYS_Role.Username = txtUserName.Text;
                obj_SYS_Role.Password = txtUserPassword.Text;
                //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);

                dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Active_Login(obj_SYS_Role);
                LoginInfo = dtLogin.Tables[0];

                if (LoginInfo.Rows.Count > 0 && LoginInfo != null && LoginInfo.Rows[0]["Status"].ToString().Equals("1"))
                {
                    if (dtLogin.Tables[1].Rows[0]["RoleID"].ToString() != "3")
                    {
                        bool AllowMultipleSession = false;
                        UserInfo = dtLogin.Tables[1];
                        if (UserInfo.Rows.Count > 0 && UserInfo != null)
                        {
                            AppSessions.AppUserType = "School";
                            AppSessions.EmpolyeeID  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                            AppSessions.RoleID      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                            AppSessions.SchoolID    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                            AppSessions.UserName    = UserInfo.Rows[0]["FirstName"].ToString();
                            AppSessions.SchoolName  = UserInfo.Rows[0]["Name"].ToString();
                            AppSessions.Role        = UserInfo.Rows[0]["Role"].ToString();

                            AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtUserName.Text, 0);
                        }

                        if (AllowMultipleSession == false)
                        {
                            Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                            if (sessions == null)
                            {
                                sessions = new Hashtable();
                            }

                            ////////getting the pointer to the Session of the current logged in user
                            HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                            if (existingUserSession != null)
                            {
                                ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                //logout current logged in user
                                lblError1.Visible = true;
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                        else
                        {
                            yourLoginMethod(UserInfo);

                            ProceedToRedirectPage(UserInfo);
                        }
                    }
                    else
                    {
                        // For Teacher Redirection

                        bool AllowMultipleSession = false;
                        UserInfo = dtLogin.Tables[1];
                        if (UserInfo.Rows.Count > 0 && UserInfo != null)
                        {
                            Session["UserInfoTable"] = UserInfo;

                            ViewState["AppUserType"] = "School";
                            ViewState["EmpolyeeID"]  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                            ViewState["RoleID"]      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                            ViewState["SchoolID"]    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                            ViewState["UserName"]    = UserInfo.Rows[0]["FirstName"].ToString();
                            ViewState["SchoolName"]  = UserInfo.Rows[0]["Name"].ToString();
                            ViewState["Role"]        = UserInfo.Rows[0]["Role"].ToString();

                            AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                            TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + txtUserName.Text, 0);
                        }

                        if (AllowMultipleSession == false)
                        {
                            Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                            if (sessions == null)
                            {
                                sessions = new Hashtable();
                            }
                            ////////getting the pointer to the Session of the current logged in user
                            // HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                            HttpSessionState existingUserSession = (HttpSessionState)sessions[ViewState["EmpolyeeID"].ToString()];
                            if (existingUserSession != null)
                            {
                                ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                //logout current logged in user
                                lblError1.Visible = true;
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                        else
                        {
                            yourLoginMethod(UserInfo);

                            ProceedToRedirectPage(UserInfo);
                        }
                    }
                }
                else
                {
                    TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginFailed), "LoginId: " + txtUserName.Text + " , Password: "******"Authentication Failed,unable to login");
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
    }
    protected void btnOk_Click(object sender, EventArgs e)
    {
        string BMS = ddlBoard.SelectedItem.Text;

        string[] Split  = Regex.Split(BMS, ">>");
        string   Medium = Split[1];

        if (Medium == " Gujarati Medium ")
        {
            ViewState["A"] = "gu-IN";
        }
        else if (Medium == " English Medium ")
        {
            ViewState["A"] = "en-US";
        }
        else if (Medium == " Hindi Medium ")
        {
            ViewState["A"] = "hi-IN";
        }
        this.InitializeCulture();


        if (Session["UserInfoTable"] != null)
        {
            DataTable dtUsetInfo = new DataTable();
            dtUsetInfo = (DataTable)Session["UserInfoTable"];
            AppSessions.AppUserType = "School";
            AppSessions.EmpolyeeID  = int.Parse(dtUsetInfo.Rows[0]["EmployeeID"].ToString());
            AppSessions.RoleID      = int.Parse(dtUsetInfo.Rows[0]["RoleID"].ToString());
            AppSessions.SchoolID    = int.Parse(dtUsetInfo.Rows[0]["SchoolID"].ToString());
            AppSessions.UserName    = dtUsetInfo.Rows[0]["FirstName"].ToString();
            AppSessions.SchoolName  = dtUsetInfo.Rows[0]["Name"].ToString();
            AppSessions.Role        = dtUsetInfo.Rows[0]["Role"].ToString();
        }

        AppSessions.BoardID    = int.Parse(ddlBoard.SelectedValue);
        AppSessions.Board      = ddlBoard.SelectedItem.Text;
        AppSessions.SubjectID  = int.Parse(ddlSubject.SelectedValue);
        AppSessions.Subject    = ddlSubject.SelectedItem.Text;
        AppSessions.DivisionID = int.Parse(ddlDivision.SelectedValue);
        AppSessions.Division   = ddlDivision.SelectedItem.Text;

        string EmpID = AppSessions.EmpolyeeID.ToString();

        HttpCookie myCookie = new HttpCookie(EmpID + "TeacherDropDown");

        myCookie["BoardVal"]    = ddlBoard.SelectedValue;
        myCookie["SubjectVal"]  = ddlSubject.SelectedValue;
        myCookie["DivisionVal"] = ddlDivision.SelectedValue;
        myCookie.Expires        = DateTime.Now.AddDays(7);
        Response.Cookies.Add(myCookie);

        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnOk", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ActivitySelected), "BMS : " + AppSessions.Board + " , Division : " + AppSessions.Division + " , Subject : " + AppSessions.Subject + " , Teacher : " + AppSessions.UserName, 0);

        Response.Redirect("~/Dashboard/TeacherDashboard.aspx");
    }
Exemplo n.º 13
0
    protected void btnGo_Click(object sender, EventArgs e)
    {
        try
        {
            if (uctxtUserName.Text == string.Empty || uctxtUserPassword.Text == string.Empty)
            {
                WebMsg.Show("Please enter User ID and Password");
            }
            else
            {
                StoreCookie();

                int status = CheckLogin();
                //if (ddlUserType.SelectedValue == "0")
                if (status == 2)
                {
                    //WebMsg.Show("invalid username or password");
                    uctxtUserName.Text       = string.Empty;
                    uctxtUserPassword.Text   = string.Empty;
                    ucinvalididpassword.Text = "Invalid User ID or Password";

                    //Page.ClientScript.RegisterStartupScript(GetType(), "msgbox", "alert('FiveDot File uploaded successfully'); ", true);

                    //Response.Write("<script>alert('my message');</script> ");
                    //ScriptManager.RegisterClientScriptBlock(ucbtnGo, this.GetType(), "Alert Message", "<script> alert('invalid username or password');</script>", true);

                    return;
                }
                else if (status == 0)
                {
                    // 0 Indicates Student

                    StudentDash    = new StudentDash();
                    BLogic_Student = new Student_DashBoard_BLogic();

                    DataSet   dtLogin   = new DataSet();
                    DataTable LoginInfo = new DataTable();
                    DataTable UserInfo  = new DataTable();

                    obj_SYS_Role          = new SYS_Role();
                    obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                    obj_SYS_Role.Username = uctxtUserName.Text;
                    obj_SYS_Role.Password = uctxtUserPassword.Text;
                    //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);
                    //if (uctxtEmail.Text != "" && uctxtpass.Text != "")
                    //{

                    dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
                    LoginInfo = dtLogin.Tables[0];
                    //}
                    if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
                    {
                        AppSessions.AppUserType = "Student";

                        AppSessions.StudentID = Convert.ToInt32(LoginInfo.Rows[0]["StudentID"].ToString());
                        AppSessions.UserName  = LoginInfo.Rows[0]["FirstName"].ToString();

                        AppSessions.LoginID = LoginInfo.Rows[0]["LoginID"].ToString();

                        AppSessions.BMSID = Convert.ToInt32(LoginInfo.Rows[0]["BMSID"].ToString());
                        AppSessions.BMS   = LoginInfo.Rows[0]["BMS"].ToString();

                        AppSessions.BoardID = Convert.ToInt32(LoginInfo.Rows[0]["BoardID"].ToString());
                        AppSessions.Board   = LoginInfo.Rows[0]["Board"].ToString();

                        AppSessions.MediumID = Convert.ToInt32(LoginInfo.Rows[0]["MediumID"].ToString());
                        AppSessions.Medium   = LoginInfo.Rows[0]["Medium"].ToString();

                        AppSessions.StandardID = Convert.ToInt32(LoginInfo.Rows[0]["StandardID"].ToString());
                        AppSessions.Standard   = LoginInfo.Rows[0]["Standard"].ToString();

                        AppSessions.DivisionID = Convert.ToInt32(LoginInfo.Rows[0]["DivisionID"].ToString());
                        //AppSessions.Division = LoginInfo.Rows[0]["Division"].ToString();

                        AppSessions.SchoolID = Convert.ToInt32(LoginInfo.Rows[0]["SchoolID"].ToString());
                        //AppSessions.SchoolName = LoginInfo.Rows[0]["SchoolName"].ToString();

                        AppSessions.Role   = LoginInfo.Rows[0]["Role"].ToString();
                        AppSessions.RoleID = Convert.ToInt32(LoginInfo.Rows[0]["RoleID"].ToString());

                        AppSessions.IsFreePackage = IsFreePackage();


                        //AppSessions.EmailID = Convert.ToString(LoginInfo.Rows[0]["EmailID"]);

                        //yourLoginMethodStudent(LoginInfo);
                        bool AllowMultipleSession = false;
                        AllowMultipleSession = Convert.ToBoolean(LoginInfo.Rows[0]["AllowMultipleSession"].ToString());


                        //Hashtable sessions1 = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                        //HttpSessionState existingUserSession1 = (HttpSessionState)sessions1[Session["StudentID"].ToString()];
                        //if (existingUserSession1 != null)
                        //{
                        //    Response.Redirect("../Dashboard/StudentDashboard.aspx");
                        //}

                        if (AllowMultipleSession == false)
                        {
                            Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                            if (sessions == null)
                            {
                                sessions = new Hashtable();
                            }

                            HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["StudentID"].ToString()];
                            if (existingUserSession != null)
                            {
                                ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                //logout current logged in user
                                Session["StudentID"] = null;
                                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", "<script>alert('You are already Logged In.')</script>", false);
                                return;
                            }
                        }

                        ////////getting the pointer to the Session of the current logged in user
                        yourLoginMethodStudent(LoginInfo);
                        ProceedToRedirectPage(LoginInfo);

                        bool    AllowPayment  = false;
                        DataSet dsPaymentInfo = new DataSet();
                        dsPaymentInfo = BLogic_Student.BAL_Select_PaymentPagesInfo("Payment");
                        if (dsPaymentInfo != null & dsPaymentInfo.Tables.Count > 0)
                        {
                            if (dsPaymentInfo.Tables[0].Rows.Count > 0)
                            {
                                string a = dsPaymentInfo.Tables[0].Rows[0]["value"].ToString();
                                if (a == "0")
                                {
                                    AllowPayment = false;
                                }
                                else
                                {
                                    AllowPayment = true;
                                }
                            }
                        }

                        DataSet ds = new DataSet();
                        StudentDash.StudentID = AppSessions.StudentID;
                        //ds = BLogic_Student.BAL_Validate_Student(StudentDash);
                        ds = BLogic_Student.BAL_Validate_Student_Package(StudentDash);
                        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + uctxtUserName.Text, 0);


                        if (AllowPayment == true)
                        {
                            //Session["ShowPaymentPages"] = "yes";
                            if (ds != null && dtLogin.Tables.Count > 0)
                            {
                                if (ds.Tables[0].Rows.Count > 0)
                                {
                                    Session["CheckValidity"] = "Yes";
                                    ProceedToRedirect();
                                }
                                else
                                {
                                    Response.Redirect("~/DashBoard/SelectPackage.aspx", false);
                                    TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + uctxtUserName.Text, 0);
                                }
                            }
                            else
                            {
                                Response.Redirect("~/DashBoard/SelectPackage.aspx", false);
                                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), "Login", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.PackageSelection), "LoginId: " + uctxtUserName.Text, 0);
                            }
                        }
                        else
                        {
                            Session["CheckValidity"]    = "Yes";
                            Session["ShowPaymentPages"] = "No";
                            ProceedToRedirect();
                        }
                    }
                }

                //else if (ddlUserType.SelectedValue == "1")
                else if (status == 1)
                {
                    // 1 Indicates Teacher
                    DataSet   dtLogin   = new DataSet();
                    DataTable LoginInfo = new DataTable();
                    DataTable UserInfo  = new DataTable();

                    obj_SYS_Role          = new SYS_Role();
                    obj_BAL_SYS_Role      = new SYS_Role_BLogic();
                    obj_SYS_Role.Username = uctxtUserName.Text;
                    obj_SYS_Role.Password = uctxtUserPassword.Text;
                    //obj_SYS_Role.roleid = Convert.ToInt16(DdlRole.SelectedValue);

                    dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Active_Login(obj_SYS_Role);
                    LoginInfo = dtLogin.Tables[0];

                    if (LoginInfo.Rows.Count > 0 && LoginInfo != null && LoginInfo.Rows[0]["Status"].ToString().Equals("1"))
                    {
                        if (dtLogin.Tables[1].Rows[0]["RoleID"].ToString() != "3")
                        {
                            bool AllowMultipleSession = false;
                            UserInfo = dtLogin.Tables[1];
                            if (UserInfo.Rows.Count > 0 && UserInfo != null)
                            {
                                AppSessions.AppUserType = "School";
                                AppSessions.EmpolyeeID  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                                AppSessions.RoleID      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                                AppSessions.SchoolID    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                                AppSessions.UserName    = UserInfo.Rows[0]["FirstName"].ToString();
                                AppSessions.SchoolName  = UserInfo.Rows[0]["Name"].ToString();
                                AppSessions.Role        = UserInfo.Rows[0]["Role"].ToString();

                                AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), "LoginId: " + uctxtUserName.Text, 0);
                            }

                            if (AllowMultipleSession == false)
                            {
                                Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                                if (sessions == null)
                                {
                                    sessions = new Hashtable();
                                }

                                ////////getting the pointer to the Session of the current logged in user
                                HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                                if (existingUserSession != null)
                                {
                                    ////existingUserSession[Session["EmpolyeeID"].ToString()] = null;
                                    //logout current logged in user
                                }
                                else
                                {
                                    yourLoginMethod(UserInfo);
                                    ProceedToRedirectPage(UserInfo);
                                }
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                        else
                        {
                            // For Teacher Redirection

                            bool AllowMultipleSession = false;
                            UserInfo = dtLogin.Tables[1];
                            if (UserInfo.Rows.Count > 0 && UserInfo != null)
                            {
                                Session["UserInfoTable"] = UserInfo;

                                ViewState["AppUserType"] = "School";
                                ViewState["EmpolyeeID"]  = int.Parse(UserInfo.Rows[0]["EmployeeID"].ToString());
                                ViewState["RoleID"]      = int.Parse(UserInfo.Rows[0]["RoleID"].ToString());
                                ViewState["SchoolID"]    = int.Parse(UserInfo.Rows[0]["SchoolID"].ToString());
                                ViewState["UserName"]    = UserInfo.Rows[0]["FirstName"].ToString();
                                ViewState["SchoolName"]  = UserInfo.Rows[0]["Name"].ToString();
                                ViewState["Role"]        = UserInfo.Rows[0]["Role"].ToString();

                                AllowMultipleSession = Convert.ToBoolean(UserInfo.Rows[0]["AllowMultipleSession"].ToString());
                                TrackLog_Utils.Log(Convert.ToInt32(ViewState["SchoolID"]), Convert.ToInt32(ViewState["EmpolyeeID"]), Convert.ToInt16(AppSessions.DivisionID), "LoginMasterPage.master", "ucbtnGo", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginSuccess), ViewState["UserName"] + " (" + uctxtUserName.Text + ") From " + ViewState["SchoolName"] + " school Logged in.", 0);
                            }

                            if (AllowMultipleSession == false)
                            {
                                Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];
                                if (sessions == null)
                                {
                                    sessions = new Hashtable();
                                }
                                ////////getting the pointer to the Session of the current logged in user
                                // HttpSessionState existingUserSession = (HttpSessionState)sessions[Session["EmpolyeeID"].ToString()];
                                HttpSessionState existingUserSession = (HttpSessionState)sessions[ViewState["EmpolyeeID"].ToString()];
                                if (existingUserSession != null)
                                {
                                    WebMsg.Show("This user is already logged in");
                                }
                                else
                                {
                                    yourLoginMethod(UserInfo);
                                    ProceedToRedirectPage(UserInfo);
                                }
                            }
                            else
                            {
                                yourLoginMethod(UserInfo);
                                ProceedToRedirectPage(UserInfo);
                            }
                        }
                    }
                    else
                    {
                        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LoginPage", "btnLogin", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LoginFailed), "LoginId: " + uctxtUserName.Text + " , Password: "******"Authentication Failed,unable to login");
                    }
                }

                uctxtUserName.Text     = string.Empty;
                uctxtUserPassword.Text = string.Empty;
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
    }
Exemplo n.º 14
0
    protected void lbtnSignOut_Click(object sender, EventArgs e)
    {
        Hashtable sessions = (Hashtable)Application["WEB_SESSIONS_OBJECT"];

        if (sessions == null)
        {
            sessions = new Hashtable();
        }

        if (Session["EmpolyeeID"] != null)
        {
            sessions.Remove(Session["EmpolyeeID"].ToString());
        }

        if (Session["StudentID"] != null)
        {
            sessions.Remove(Session["StudentID"].ToString());
        }

        Application.Lock();
        Application["WEB_SESSIONS_OBJECT"] = sessions;
        Application.UnLock();

        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "LogoutPage", "btnLogout", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.LogoutSuccess), "LoginId : " + Session["UserName"].ToString(), 0);

        HttpContext.Current.Session.Clear();
        HttpContext.Current.Session.Abandon();

        Session["StudentID"]  = null;
        Session["EmpolyeeID"] = null;
        //Response.Redirect("../OtherPages/Login.aspx");
        //Response.Redirect("../OtherPages/Landing.aspx");
        //Response.Redirect("../NewPublic/epathhome.aspx");
        Response.Redirect("../NewPublic/userLogin.aspx");
    }
 protected void btnReset_Click(object sender, EventArgs e)
 {
     TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "btnReset", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResetExamResult), "Clear entered result in grid for " + ddlExam.SelectedItem.ToString() + " exam.", Convert.ToInt32(ViewState["BMSSCT"]));
     ClearControls();
 }
Exemplo n.º 16
0
    protected void btnReset_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnReset", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResetActivity), "Reset Activity Successfully.", 0);

        ddlChapter.SelectedIndex = ((int)EnumFile.AssignValue.Zero);
        DropDownList[] disddl = { ddlTopic };
        DisableDropDwon(disddl);
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard    = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard        = new Teacher_Dashboard();
        obj_Teacher_Dashboard.ExamID = Convert.ToInt64(ViewState["ExamID"]);
        obj_BAL_Teacher_Dashboard.BAL_SYS_Delete_Student_Result(obj_Teacher_Dashboard);

        DataTable TbStudent = new DataTable("StudentExam");

        TbStudent.Columns.Add("ExamID", typeof(Int64));
        TbStudent.Columns.Add("StudentID", typeof(Int64));
        TbStudent.Columns.Add("RightAnswers", typeof(System.String));
        TbStudent.Columns.Add("WorngAnswers", typeof(Int32));
        TbStudent.Columns.Add("Total", typeof(Int32));
        TbStudent.Columns.Add("CreatedBy", typeof(Int64));

        for (int i = 0; i < GridStudentList.Rows.Count; i++)
        {
            DataRow dr = TbStudent.NewRow();
            dr["ExamID"]    = Convert.ToInt64(ViewState["ExamID"]);
            dr["StudentID"] = Convert.ToInt64(GridStudentList.DataKeys[i].Values["StudentID"].ToString());
            TextBox tb1 = (TextBox)GridStudentList.Rows[i].Cells[2].FindControl("TxtRightMarks");
            if (tb1.Text.ToString().Equals("A"))
            {
                dr["RightAnswers"] = "A";
                dr["WorngAnswers"] = Convert.ToInt32("0");
            }
            else if (tb1.Text.ToString().Equals("Z"))
            {
                dr["RightAnswers"] = "Z";
                dr["WorngAnswers"] = Convert.ToInt32("0");
            }
            else
            {
                dr["RightAnswers"] = Convert.ToInt32(tb1.Text);
                dr["WorngAnswers"] = Convert.ToInt32(Convert.ToInt32(ViewState["TotalMarks"]) - Convert.ToInt32(tb1.Text));
            }

            dr["Total"]     = Convert.ToInt32(ViewState["TotalMarks"]);
            dr["CreatedBy"] = Convert.ToInt64(Session["EmpolyeeID"]);

            TbStudent.Rows.Add(dr);
        }

        if (TbStudent.Rows.Count > ((int)EnumFile.AssignValue.Zero))
        {
            try
            {
                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "btnSave", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExamResultSaved), "BMSSCT ID : " + Convert.ToInt32(ViewState["BMSSCTID"]) + " Exam Name : " + ddlExam.SelectedItem.ToString(), Convert.ToInt32(ViewState["BMSSCTID"]));

                string con = ConfigurationManager.AppSettings["EpathshalaStudentCon"];
                using (SqlBulkCopy copy = new SqlBulkCopy(con))
                {
                    //copy.ColumnMappings.Add(0, 0);
                    copy.ColumnMappings.Add(0, 1); //ExamID
                    copy.ColumnMappings.Add(1, 2); //StudentID
                    copy.ColumnMappings.Add(2, 3); //RightAnswers
                    copy.ColumnMappings.Add(3, 4); //WorngAnswers
                    copy.ColumnMappings.Add(4, 5); //Total
                    copy.ColumnMappings.Add(5, 8); //CreatedBy
                    copy.DestinationTableName = "Student_Exam_Result";
                    copy.WriteToServer(TbStudent);
                }
                WebMsg.Show("Result inserted successfully.");
            }
            catch (Exception ex)
            {
                WebMsg.Show("Error in inserting the result.");
            }
        }
        else
        {
            WebMsg.Show("There is no data to be set.");
        }
        ClearControls();
    }
Exemplo n.º 18
0
    protected void lbtnEveningPrayer_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "lbtnEveningPrayer", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.Eveningprayer), "Start Evening Prayer.", 0);

        //audply.InnerHtml = "<embed src=\"../prayer/ye kunde.mp3\" ></embed>";
        //Media_Player_Control1.Visible = true;
        //Media_Player_Control1.MovieURL = "../prayer/ye kunde.mp3";
        string testDay = DateTime.Now.DayOfWeek.ToString();

        path = "../prayer/eveningprayer" + testDay.ToLower() + ".mp3";
        mp1.Show();
    }
    protected void BtnPDF_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnPDF", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExportToPDF), "BMSSCT ID : " + Convert.ToInt32(ViewState["BMSSCTID"]) + " Exam Name : " + ddlExam.SelectedItem.ToString(), Convert.ToInt32(ViewState["BMSSCTID"]));

        Page.RegisterStartupScript("Page Title", "<script language='javascript'>window.open('Print_PDF.aspx?page=ResultEntry','My Window','width=700,height=600,scroll=1');</script>");
    }
Exemplo n.º 20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ExamEntryPage", "Page", "Load", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ExamEntryPage), "Exam Entry Page Loaded.", 0);

        this.TeacherPanel1.TeacherPanelEvent += new EventHandler(Demo1_ButtonClickDemo);
        if (!IsPostBack)
        {
            fill_ALL_Covered_Chaptes_Topics();
        }
    }
    protected void BtnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.SchoolID   = Convert.ToInt64(Session["SchoolID"]);
        obj_Teacher_Dashboard.BMSID      = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.DivisionID = Convert.ToInt16(Session["DivisionID"]);
        obj_Teacher_Dashboard.SubjectID  = Convert.ToInt16(Session["SubjectID"]);
        obj_Teacher_Dashboard.ChapterID  = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID    = Convert.ToInt64(ddlTopic.SelectedValue);
        obj_Teacher_Dashboard.ExamID     = Convert.ToInt64(ddlExam.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        ViewState["BMSSCT"] = bmssctid;

        DataSet dsStudentList = new DataSet();

        dsStudentList = obj_BAL_Teacher_Dashboard.Get_StudentList(obj_Teacher_Dashboard);

        //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResultEntryPage),"", Convert.ToInt32(Session["BMSSCTID"]));
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ResultEntryPage", "BtnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.StudentListPopulatedForExam), "BMSSCT ID = " + bmssctid + " Exam Name : " + ddlExam.SelectedItem.ToString() + " Exam Marks : " + TxtTotalMarks.Text, bmssctid);

        if (dsStudentList.Tables[0].Rows.Count > 0)
        {
            GridStudentList.Visible    = true;
            btnSave.Visible            = true;
            BtnPDF.Visible             = true;
            Session["ChapName"]        = ddlChapter.SelectedItem.ToString();
            Session["TopicName"]       = ddlTopic.SelectedItem.ToString();
            Session["ExamName"]        = ddlExam.SelectedItem.ToString();
            Session["ToatlQues"]       = TxtTotalQuestions.Text;
            Session["ToatlMarks"]      = TxtTotalMarks.Text;
            Session["StudentResult"]   = dsStudentList.Tables[0];
            GridStudentList.DataSource = dsStudentList.Tables[0];
            GridStudentList.DataBind();
        }
        else
        {
            GridStudentList.DataSource = null;
            GridStudentList.DataBind();
            GridStudentList.Visible = false;
            btnSave.Visible         = false;
            BtnPDF.Visible          = false;
            WebMsg.Show("No student available.");
        }
    }
Exemplo n.º 22
0
    protected void btnReset_Click(object sender, EventArgs e)
    {
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "ExamEntryPage", "bntReset", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ResetExamName), "Reset Exam Name.", Convert.ToInt32(Session["BMSSCTID"]));

        ClearControls();
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        obj_BAL_Teacher_Dashboard = new Teacher_Dashboard_BLogic();
        obj_Teacher_Dashboard     = new Teacher_Dashboard();

        obj_Teacher_Dashboard.BMSID     = Convert.ToInt64(Session["BMSID"]);
        obj_Teacher_Dashboard.SubjectID = Convert.ToInt16(Session["SubjectID"]);

        obj_Teacher_Dashboard.ChapterID = Convert.ToInt64(ddlChapter.SelectedValue);
        obj_Teacher_Dashboard.TopicID   = Convert.ToInt64(ddlTopic.SelectedValue);

        int bmssctid = obj_BAL_Teacher_Dashboard.BAL_Select_BMS_SCTID(obj_Teacher_Dashboard);

        //TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDashboard", "btnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), Session.SessionID, "click on submit button", "Submit Successfully.", bmssctid);
        TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmpolyeeID), Convert.ToInt16(AppSessions.DivisionID), "TeacherDeshboard", "btnSubmit", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.ActivityStarted), "BMSSCT ID : " + bmssctid, bmssctid);

        if (bmssctid > (int)EnumFile.AssignValue.Zero)
        {
            Session["ChapterTopic"] = ddlChapter.SelectedItem.ToString() + " >> " + ddlTopic.SelectedItem.ToString();
            Session["Chapter"]      = ddlChapter.SelectedItem.ToString();
            Session["BMSSCTID"]     = bmssctid;
            String Path1 = Server.MapPath("../EduResource/" + bmssctid);

            this.Title = "Epathshala - " + bmssctid;
            if (Directory.Exists(Path1) == false)
            {
                Path1 = Server.MapPath("../EduResource/NoContent");
            }

            if (Directory.Exists(Path1))
            {
                Response.Redirect("EducationalResource.aspx?Type=Teacher", false);
            }

            else
            {
                WebMsg.Show(bmssctid.ToString() + ": No Educational resource available.");
            }
        }
        else
        {
            WebMsg.Show(bmssctid.ToString() + ": No Educational resource available.");
        }
    }