Esempio n. 1
0
    protected void btnOk_OnClick(object sender, EventArgs e)
    {
        STD_Student student = new STD_Student();

        if (Profile.IsStudent)
        {
            student.StudentID = Profile.card_id;
        }
        else
        {
            student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);
        }
        List<STD_ExamDetailsStudent> results = new List<STD_ExamDetailsStudent>();

        DataSet tblResults = STD_ExamDetailsStudentManager.GetSTD_ExamResultByStudentID(student.StudentID);

        foreach (DataTable tblResult in tblResults.Tables)
        {
            foreach (DataRow dr in tblResult.Rows)
            {
                STD_ExamDetailsStudent result = new STD_ExamDetailsStudent();

                result.TotalMark = dr["TotalMarks"].ToString();
                result.ObtainedMark = decimal.Parse(dr["ObtainedMark"].ToString());

                result.ExamName = dr["ExamName"].ToString();
                result.ExamID = int.Parse(dr["ExamID"].ToString());
                result.StudentID = student.StudentID;
                results.Add(result);
            }
        }

        gvSTD_ExamDetails.DataSource = results;
        gvSTD_ExamDetails.DataBind();
    }
Esempio n. 2
0
 public static STD_Student GetHR_MaritualStatusByMaritualStatusID(int MaritualStatusID)
 {
     STD_Student sTD_Student = new STD_Student();
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     sTD_Student = sqlSTD_StudentProvider.GetSTD_StudentByMaritualStatusID(MaritualStatusID);
     return sTD_Student;
 }
Esempio n. 3
0
 public static STD_Student GetHR_ReligionByReligionID(int ReligionID)
 {
     STD_Student sTD_Student = new STD_Student();
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     sTD_Student = sqlSTD_StudentProvider.GetSTD_StudentByReligionID(ReligionID);
     return sTD_Student;
 }
Esempio n. 4
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
     STD_Student sTD_Student = new STD_Student ();
     sTD_Student.StudentID=  Request.QueryString["ID"].ToString();
     sTD_Student.StudentName=  txtStudentName.Text;
     sTD_Student.PPSizePhoto=  txtPPSizePhoto.Text;
     sTD_Student.StudentCode=  txtStudentCode.Text;
     sTD_Student.PresentAddress=  txtPresentAddress.Text;
     sTD_Student.PermanentAddress=  txtPermanentAddress.Text;
     sTD_Student.Telephone=  txtTelephone.Text;
     sTD_Student.Mobile=  txtMobile.Text;
     sTD_Student.Email=  txtEmail.Text;
     sTD_Student.DateofBirth=   DateTime.Parse(txtDateofBirth.Text);
     sTD_Student.PassportNo=  txtPassportNo.Text;
     sTD_Student.Gender=  txtGender.Text;
     sTD_Student.MaritualStatusID=  int.Parse(ddlMaritualStatusID.SelectedValue);
     sTD_Student.ReligionID=  int.Parse(ddlReligionID.SelectedValue);
     sTD_Student.SpouseQualification=  txtSpouseQualification.Text;
     sTD_Student.EnglishQualification=  txtEnglishQualification.Text;
     sTD_Student.IsRegisterWithACCA=  bool.Parse( radIsRegisterWithACCA.SelectedValue);
     sTD_Student.RegistrationDate=   DateTime.Parse(txtRegistrationDate.Text);
     sTD_Student.RegistrationNo=  txtRegistrationNo.Text;
     sTD_Student.AddedBy=  Profile.card_id;
     sTD_Student.AddedDate=  DateTime.Now;
     sTD_Student.ModifiedBy=  Profile.card_id;
     sTD_Student.ModifiedDate=  DateTime.Now;
     sTD_Student.BloodGroup=  txtBloodGroup.Text;
     sTD_Student.IELTS=  decimal.Parse(txtIELTS.Text);
     sTD_Student.TOFEL=  decimal.Parse(txtTOFEL.Text);
     bool  resutl =STD_StudentManager.UpdateSTD_Student(sTD_Student);
     }catch(Exception ex){}Response.Redirect("AdminDisplaySTD_Student.aspx");
 }
Esempio n. 5
0
 public static STD_Student GetAllSTD_StudentsByBatchNo(int batchNo)
 {
     STD_Student sTD_Student = new STD_Student();
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     sTD_Student = sqlSTD_StudentProvider.GetAllSTD_StudentsByBatchNo(batchNo);
     return sTD_Student;
 }
Esempio n. 6
0
    protected void btnVarify_OnClick(object sender, EventArgs e)
    {
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);

        if (student == null)
        {
            lblMessage.Text = "<br/>There is no Student with this student Id";
            return;
        }
        else
        {
            lblMessage.Text = "!!! Valid ID  !!!";
            hfStudentID.Value = student.StudentID;
            StudentCodeVarification(student);
        }
    }
Esempio n. 7
0
    private void showSTD_StudentData()
    {
        STD_Student sTD_Student = new STD_Student();
        sTD_Student = STD_StudentManager.GetSTD_StudentByStudentID(Request.QueryString["studentID"]);
        txtStudentName.Text = sTD_Student.StudentName.ToString();
        //txtPPSizePhoto.Text =sTD_Student.PPSizePhoto.ToString();
        txtStudentCode.Text = sTD_Student.StudentCode.ToString();
        txtPresentAddress.Text = sTD_Student.PresentAddress.ToString();
        txtPermanentAddress.Text = sTD_Student.PermanentAddress.ToString();
        txtTelephone.Text = sTD_Student.Telephone.ToString();
        txtMobile.Text = sTD_Student.Mobile.ToString();
        txtEmail.Text = sTD_Student.Email.ToString();
        txtDateofBirth.Text = sTD_Student.DateofBirth.ToString();
        txtPassportNo.Text = sTD_Student.PassportNo.ToString();
        txtGender.Text = sTD_Student.Gender.ToString();
        ddlMaritualStatusID.SelectedValue = sTD_Student.MaritualStatusID.ToString();
        ddlReligionID.SelectedValue = sTD_Student.ReligionID.ToString();
        txtSpouseQualification.Text = sTD_Student.SpouseQualification.ToString();
        txtEnglishQualification.Text = sTD_Student.EnglishQualification.ToString();
        radIsRegisterWithACCA.SelectedValue = sTD_Student.IsRegisterWithACCA.ToString();
        txtRegistrationDate.Text = sTD_Student.RegistrationDate.ToString();
        txtRegistrationNo.Text = sTD_Student.RegistrationNo.ToString();
        txtBloodGroup.Text = sTD_Student.BloodGroup.ToString();
        txtIELTS.Text = sTD_Student.IELTS.ToString();
        txtTOFEL.Text = sTD_Student.TOFEL.ToString();
        ddlCourseID.SelectedValue = sTD_Student.SpouseQualification;

        loadEducationalBackground(sTD_Student.StudentID);
        loadjobExperience(sTD_Student.StudentID);
        loadcontact(sTD_Student.StudentID);
        ddlBatchID.SelectedValue = sTD_Student.BatchNo.ToString();

        #region Load Semester fee
        DataSet ds = STD_FeesMasterManager.GetSTD_SemesterFeeByStudentID(Request.QueryString["studentID"]);
        if (ds.Tables[0].Rows.Count > 0)
        {
            ddlCourseID.SelectedValue = ds.Tables[0].Rows[0]["CourseID"].ToString();
            txtSemesterFee.Text = ds.Tables[0].Rows[0]["ExtraField5"].ToString();
            hfLatestSemesterFeesAmount.Value = ds.Tables[0].Rows[0]["ExtraField5"].ToString();
            hfLatestSemesterFeesCourseID.Value = ds.Tables[0].Rows[0]["CourseID"].ToString();
            hfLatestSemesterFeesTypeID.Value = ds.Tables[0].Rows[0]["FeesTypeID"].ToString();
            hfLatestSemesterFeesID.Value = ds.Tables[0].Rows[0]["FeesMasterID"].ToString();
        }
        #endregion
    }
Esempio n. 8
0
    private bool IsUser(string user)
    {
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(user);

        if (student == null)
            return false;
        else
        {
            hfStudentID.Value = student.StudentID;
            return true;
        }
    }
Esempio n. 9
0
    private void loadHistory(STD_Student student)
    {
        DataSet ds=STD_ClassManager.GetSTD_ClassByStudentID(student.StudentID);

        gvSTD_Class.DataSource = ds.Tables[0];
        gvSTD_Class.DataBind();

        if (ds.Tables[1].Rows.Count > 0)
        {
            DataTable dt = ds.Tables[1];
            lblDeletedHistory.Text = "<b style='font-size:15px'>Transfered Classes[Black= Active Classes; Green= Passed in those Classes; Red= Deleted from those classes]</b><table border='1' cellpadding='2' cellspacing='2'>";
            string doneSubjectID = "";
            foreach (DataRow dr in dt.Rows)
            {
                if (!doneSubjectID.Contains("-" + dr["SubjectID"].ToString() + "-"))
                {
                    lblDeletedHistory.Text+="<tr><td>"+dr["SubjectName"].ToString()+"</td><td>";
                    doneSubjectID+=";-" + dr["SubjectID"].ToString() + "-";

                    string doneClassID = "";

                    foreach (DataRow drClass in dt.Rows)
                    {
                        if (!doneClassID.Contains("-" + drClass["ClassID"].ToString() + "-"))
                        {
                            if (drClass["RowStatusID"].ToString() == "1" && dr["SubjectID"].ToString() == drClass["SubjectID"].ToString())
                            {
                                lblDeletedHistory.Text += " --> " + drClass["ClassName"].ToString();
                                doneClassID += ";-" + drClass["ClassID"].ToString() + "-";
                            }
                        }
                    }
                        foreach (DataRow drClass in dt.Rows)
                        {
                            if (!doneClassID.Contains("-" + drClass["ClassID"].ToString() + "-"))
                            {
                                if (drClass["RowStatusID"].ToString() == "14" && dr["SubjectID"].ToString() == drClass["SubjectID"].ToString())
                                {
                                    lblDeletedHistory.Text += "<span style='color:Green;'> --> " + drClass["ClassName"].ToString() + "</span>";
                                    doneClassID += ";-" + drClass["ClassID"].ToString() + "-";
                                }
                            }
                        }
                        foreach (DataRow drClass in dt.Rows)
                        {
                            if (!doneClassID.Contains("-" + drClass["ClassID"].ToString() + "-"))
                            {
                                if (drClass["RowStatusID"].ToString() == "3" && dr["SubjectID"].ToString() == drClass["SubjectID"].ToString())
                                {
                                    lblDeletedHistory.Text += "<span style='color:red;'> --> " + drClass["ClassName"].ToString() + "</span>";
                                    doneClassID += ";-" + drClass["ClassID"].ToString() + "-";
                                }
                            }
                        }

                    }
                    lblDeletedHistory.Text += "</td></tr>";
                }

            lblDeletedHistory.Text += "</table>";
        }
        else
        {
            lblDeletedHistory.Text = "";
        }
    }
Esempio n. 10
0
    protected void btnVarify_OnClick(object sender, EventArgs e)
    {
        hfSubjects.Value = "-";
        txtStudentCode.Text = txtStudentCode.Text.Trim();
        ddlClassID.SelectedIndex = 0;
        ddlClassID_SelectedIndexChanged(this, new EventArgs());
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);
        txtAccARegistrationNo.Text = student.RegistrationNo;

        if (student.RegistrationNo != "")
        {
            txtAccARegistrationNo.Enabled = false;
            btnSaveRegistrationNo.Visible = false;
        }

        if (student == null)
        {
            lblMessage.Text = "<br/>There is no Student with this student Id";
            return;
        }
        else
        {
            lblMessage.Text = "!!! Valid ID  !!!";
            hfStudentID.Value = student.StudentID;
            StudentCodeVarification(student);

            //load routine for that student;
            STD_RoutineTime routineTime = new STD_RoutineTime();
            routineTime.RoomID = Request.QueryString["RoomID"] == null ? 0 : int.Parse(Request.QueryString["RoomID"]);
            routineTime.RoutineID = Request.QueryString["RoutineID"] == null ? 0 : int.Parse(Request.QueryString["RoutineID"]);
            routineTime.ClassID = Request.QueryString["ClassID"] == null ? 0 : int.Parse(Request.QueryString["ClassID"]);
            routineTime.SubjectID = Request.QueryString["SubjectID"] == null ? 0 : int.Parse(Request.QueryString["SubjectID"]);
            routineTime.EmployeeID = Request.QueryString["EmployeeID"] == null ? "" : Request.QueryString["EmployeeID"];
            string StudentID = hfStudentID.Value;
            lblVerifyRoutine.Text = STD_RoutineTimeManager.getRoutineTextDayTop(routineTime, StudentID);
            lblVerifyRoutine.Text = lblVerifyRoutine.Text.Replace("id='tblRoutineDisplay'", "border='1'");
            lblVerifyRoutine.Text = lblVerifyRoutine.Text.Replace("id='tblRoutineDisplayTeacher'", "border='1'");
            //lblVerifyRoutine.Text = //getRoutineText(0,0);
        }

        loadHistory(student);
    }
Esempio n. 11
0
    public DataSet InsertSTD_Student(STD_Student sTD_Student)
    {
        DataSet ds = new DataSet();
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            using (SqlCommand cmd = new SqlCommand("InsertSTD_Student", connection))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value = sTD_Student.StudentID;
                //cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Direction = ParameterDirection.Output;
                cmd.Parameters.Add("@StudentName", SqlDbType.NVarChar).Value = sTD_Student.StudentName;
                cmd.Parameters.Add("@PPSizePhoto", SqlDbType.NVarChar).Value = sTD_Student.PPSizePhoto;
                cmd.Parameters.Add("@StudentCode", SqlDbType.NVarChar).Value = sTD_Student.StudentCode;
                cmd.Parameters.Add("@PresentAddress", SqlDbType.NVarChar).Value = sTD_Student.PresentAddress;
                cmd.Parameters.Add("@PermanentAddress", SqlDbType.NVarChar).Value = sTD_Student.PermanentAddress;
                cmd.Parameters.Add("@Telephone", SqlDbType.NVarChar).Value = sTD_Student.Telephone;
                cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = sTD_Student.Mobile;
                cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = sTD_Student.Email;
                cmd.Parameters.Add("@DateofBirth", SqlDbType.DateTime).Value = sTD_Student.DateofBirth;
                cmd.Parameters.Add("@PassportNo", SqlDbType.NVarChar).Value = sTD_Student.PassportNo;
                cmd.Parameters.Add("@Gender", SqlDbType.NVarChar).Value = sTD_Student.Gender;
                cmd.Parameters.Add("@MaritalStatusID", SqlDbType.Int).Value = sTD_Student.MaritualStatusID;
                cmd.Parameters.Add("@ReligionID", SqlDbType.Int).Value = sTD_Student.ReligionID;
                cmd.Parameters.Add("@SpouseQualification", SqlDbType.NVarChar).Value = sTD_Student.SpouseQualification;
                cmd.Parameters.Add("@EnglishQualification", SqlDbType.NVarChar).Value = sTD_Student.EnglishQualification;
                cmd.Parameters.Add("@IsRegisterWithACCA", SqlDbType.Bit).Value = sTD_Student.IsRegisterWithACCA;
                cmd.Parameters.Add("@RegistrationDate", SqlDbType.DateTime).Value = sTD_Student.RegistrationDate;
                cmd.Parameters.Add("@RegistrationNo", SqlDbType.NVarChar).Value = sTD_Student.RegistrationNo;
                cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = sTD_Student.AddedBy;
                cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_Student.AddedDate;
                cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = sTD_Student.ModifiedBy;
                cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = sTD_Student.ModifiedDate;
                cmd.Parameters.Add("@BloodGroup", SqlDbType.NChar).Value = sTD_Student.BloodGroup;
                cmd.Parameters.Add("@IELTS", SqlDbType.Decimal).Value = sTD_Student.IELTS;
                cmd.Parameters.Add("@TOFEL", SqlDbType.Decimal).Value = sTD_Student.TOFEL;
                cmd.Parameters.Add("@Year", SqlDbType.Int).Value = sTD_Student.Year;
                cmd.Parameters.Add("@BatchNo", SqlDbType.Int).Value = sTD_Student.BatchNo;
                cmd.Parameters.Add("@ID", SqlDbType.Int).Value = sTD_Student.ID;
                cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = sTD_Student.RowStatusID;
                connection.Open();
                SqlDataAdapter myadapter = new SqlDataAdapter(cmd);
                myadapter.Fill(ds);
                myadapter.Dispose();
                connection.Close();
                return ds;
            }
        }

        //using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        //{
        //    SqlCommand cmd = new SqlCommand("InsertSTD_Student", connection);
        //    cmd.CommandType = CommandType.StoredProcedure;
        //    cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value =sTD_Student.StudentID;
        //    //cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Direction = ParameterDirection.Output;
        //    cmd.Parameters.Add("@StudentName", SqlDbType.NVarChar).Value = sTD_Student.StudentName;
        //    cmd.Parameters.Add("@PPSizePhoto", SqlDbType.NVarChar).Value = sTD_Student.PPSizePhoto;
        //    cmd.Parameters.Add("@StudentCode", SqlDbType.NVarChar).Value = sTD_Student.StudentCode;
        //    cmd.Parameters.Add("@PresentAddress", SqlDbType.NVarChar).Value = sTD_Student.PresentAddress;
        //    cmd.Parameters.Add("@PermanentAddress", SqlDbType.NVarChar).Value = sTD_Student.PermanentAddress;
        //    cmd.Parameters.Add("@Telephone", SqlDbType.NVarChar).Value = sTD_Student.Telephone;
        //    cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = sTD_Student.Mobile;
        //    cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = sTD_Student.Email;
        //    cmd.Parameters.Add("@DateofBirth", SqlDbType.DateTime).Value = sTD_Student.DateofBirth;
        //    cmd.Parameters.Add("@PassportNo", SqlDbType.NVarChar).Value = sTD_Student.PassportNo;
        //    cmd.Parameters.Add("@Gender", SqlDbType.NVarChar).Value = sTD_Student.Gender;
        //    cmd.Parameters.Add("@MaritualStatusID", SqlDbType.Int).Value = sTD_Student.MaritualStatusID;
        //    cmd.Parameters.Add("@ReligionID", SqlDbType.Int).Value = sTD_Student.ReligionID;
        //    cmd.Parameters.Add("@SpouseQualification", SqlDbType.NVarChar).Value = sTD_Student.SpouseQualification;
        //    cmd.Parameters.Add("@EnglishQualification", SqlDbType.NVarChar).Value = sTD_Student.EnglishQualification;
        //    cmd.Parameters.Add("@IsRegisterWithACCA", SqlDbType.Bit).Value = sTD_Student.IsRegisterWithACCA;
        //    cmd.Parameters.Add("@RegistrationDate", SqlDbType.DateTime).Value = sTD_Student.RegistrationDate;
        //    cmd.Parameters.Add("@RegistrationNo", SqlDbType.NVarChar).Value = sTD_Student.RegistrationNo;
        //    cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = sTD_Student.AddedBy;
        //    cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_Student.AddedDate;
        //    cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = sTD_Student.ModifiedBy;
        //    cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = sTD_Student.ModifiedDate;
        //    cmd.Parameters.Add("@BloodGroup", SqlDbType.NChar).Value = sTD_Student.BloodGroup;
        //    cmd.Parameters.Add("@IELTS", SqlDbType.Decimal).Value = sTD_Student.IELTS;
        //    cmd.Parameters.Add("@TOFEL", SqlDbType.Decimal).Value = sTD_Student.TOFEL;
        //    connection.Open();

        //    int result = cmd.ExecuteNonQuery();
        //    return cmd.Parameters["@StudentID"].Value.ToString();
        //}
    }
Esempio n. 12
0
 public static DataSet InsertSTD_Student(STD_Student sTD_Student)
 {
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     return sqlSTD_StudentProvider.InsertSTD_Student(sTD_Student);
 }
Esempio n. 13
0
    protected void btnSearchStudent_Click(object sender, EventArgs e)
    {
        txtStudentCodeSearch.Enabled = false;
        if (Request.QueryString["StudentCode"] != null)
        {
            if (txtStudentCodeSearch.Text != Request.QueryString["StudentCode"])
            {
                Response.Redirect("FeesInstallment.aspx?StudentCode=" + txtStudentCodeSearch.Text);
            }
        }

        divFeesDetailsPerStudent.Visible = false;
        divReceivePayment.Visible = false;
        if (txtStudentCodeSearch.Text == "")
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID";

            return;
        }

        try
        {
            lblInstallmentSearchMessage.Text = "";
            //call the methord by which we can get the student info
            STD_Student sTD_Student = new STD_Student();
            sTD_Student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCodeSearch.Text);

            if (sTD_Student == null)
            {
                lblInstallmentSearchMessage.Text = "There is no registured student by this ID and in the selected Course";
                return;
            }

            //divReceivePayment.Visible = true;
            try
            {
                ddlCourseIDReceived.SelectedValue = sTD_Student.SpouseQualification;
            }
            catch (Exception ex)
            { }
            ddlCourseID.SelectedValue = ddlCourseIDReceived.SelectedValue;
            hfStudentID.Value = sTD_Student.StudentID;
            StudentCodeVarification(sTD_Student);
            showFeesMaster();
            showSTD_FeesDataByStudentIDnCourseID();
            divFeesDetailsPerStudent.Visible = true;
            //divReceivePayment.Visible = true;
            loadStudentSubjectData();
            showPaymentHistory();
        }
        catch (Exception ex)
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID";
        }
    }
Esempio n. 14
0
    protected void btnSearchStudent_Click(object sender, EventArgs e)
    {
        txtStudentCodeSearch.Enabled = false;
        divPaymentHistory.Visible = true;
        if (Request.QueryString["StudentCode"] != null)
        {
            if (txtStudentCodeSearch.Text != Request.QueryString["StudentCode"])
            {
                Response.Redirect("FeesInstallment.aspx?StudentCode=" + txtStudentCodeSearch.Text);
            }
        }

        divFeesDetailsPerStudent.Visible = false;
        divReceivePayment.Visible = false;
        if (txtStudentCodeSearch.Text == "")
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID";

            return;
        }

        try
        {
            lblInstallmentSearchMessage.Text = "";
            //call the methord by which we can get the student info
            STD_Student sTD_Student = new STD_Student();
            sTD_Student = STD_StudentManager.GetSTD_StudentByStudentCodeRefund(txtStudentCodeSearch.Text.Trim());

            if (sTD_Student == null)
            {
                lblInstallmentSearchMessage.Text = "There is no registured student by this ID";
                return;
            }
            if (sTD_Student.RowStatusID == 14)
            {
                lblInstallmentSearchMessage.Text = "<br/><br/><h1 style='font-size:60px;line-height: 60px;'>Student Registration Cancelled<h1>";
                hfIsRefund.Value = "1";
            }

            //divReceivePayment.Visible = true;
            try
            {
                ddlCourseIDReceived.SelectedValue = sTD_Student.SpouseQualification;
            }
            catch (Exception ex)
            { }
            ddlCourseID.SelectedValue = ddlCourseIDReceived.SelectedValue;
            hfStudentID.Value = sTD_Student.StudentID;
            StudentCodeVarification(sTD_Student);
            showFeesMaster();
            showSTD_FeesDataByStudentIDnCourseID();
            divFeesDetailsPerStudent.Visible = true;
            //divReceivePayment.Visible = true;
            loadStudentSubjectData();
            showPaymentHistory();

            if (hfIsRefund.Value == "1")
            {
                btnPayAdvance.Visible = false;
                btnRefund.Visible = false;
                divReceivePayment.Visible = false;
            }
        }
        catch (Exception ex)
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID";
        }
    }
Esempio n. 15
0
    protected void btnRejectedDate_OnClick(object sender, EventArgs e)
    {
        int sID = 1;
        var studentID = "";
        Student student = StudentManager.GetStudentByID("93102412");

        #region StudentInfo
        try
        {
            STD_Student sTD_Student = new STD_Student();

            MembershipUser myObject = Membership.GetUser("93102412");
            studentID = myObject.ProviderUserKey.ToString();

            sTD_Student.StudentID = studentID;
            sTD_Student.StudentName = student.S_name;
            //sTD_Student.PPSizePhoto=  "Fileurl";

            sTD_Student.PPSizePhoto = "~/Uploads/StudentImages/NoImage.jpg";

            sTD_Student.StudentCode = student.S_id;
            sTD_Student.PresentAddress = student.Pre_add;
            sTD_Student.PermanentAddress = student.Pre_add;
            sTD_Student.Telephone = student.Tel;
            sTD_Student.Mobile = student.Mob;
            sTD_Student.Email = student.Email;

            DateTime dateOfBirth = new DateTime(1970, 1, 1, 0, 0, 0, 0);

            dateOfBirth = dateOfBirth.AddSeconds(int.Parse(student.Dob));

            sTD_Student.DateofBirth = dateOfBirth;

            sTD_Student.PassportNo = student.Password;
            sTD_Student.Gender = student.Gender;
            sTD_Student.MaritualStatusID = 1;
            sTD_Student.ReligionID = student.R_id != "" ? int.Parse(student.R_id) : 0;
            sTD_Student.SpouseQualification = "";
            sTD_Student.EnglishQualification = "";
            sTD_Student.IsRegisterWithACCA = false;
            sTD_Student.RegistrationDate = DateTime.Parse("1/1/1753");
            sTD_Student.RegistrationNo = "";
            sTD_Student.AddedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
            sTD_Student.AddedDate = DateTime.Now;
            sTD_Student.ModifiedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
            sTD_Student.ModifiedDate = DateTime.Now;
            sTD_Student.BloodGroup = "";
            sTD_Student.IELTS = 0;
            sTD_Student.TOFEL = 0;
            sTD_Student.ID = sID;
            sTD_Student.BatchNo = 12007;
            sTD_Student.Year = DateTime.Now.Year;
            //sTD_Student.StudentID =
            sTD_Student.RowStatusID = 1;
            DataSet dsStudent = new DataSet();
            dsStudent = STD_StudentManager.InsertSTD_Student(sTD_Student);

            sTD_Student.StudentID = dsStudent.Tables[0].Rows[0]["StudentID"].ToString();
            sTD_Student.StudentCode = dsStudent.Tables[0].Rows[0]["StudentCode"].ToString();

            if (sTD_Student.StudentID != "")
            {
                //add to educational background to the db

                STD_Contact contact = new STD_Contact();

                contact.StudentID = sTD_Student.StudentID;
                contact.AddedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                contact.ModifiedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                contact.ModifiedDate = DateTime.Now;
                contact.Name = student.Father_name;
                contact.Occupation = "";
                contact.OfficeAddress = "";
                contact.OfficeTel = "";
                contact.RowStatusID = 1;
                contact.CellNo = "";
                contact.ContactTypeID = 1;
                contact.AddedDate = DateTime.Now;
                STD_ContactManager.InsertSTD_Contact(contact);

            }

            sID++;

        }
        catch (Exception ex)
        {
            lblError.Text = ex.Message;
        }
        #endregion
    }
Esempio n. 16
0
    protected void btnAddStudent_Click(object sender, EventArgs e)
    {
        try
        {

            var studentID = "";
            string email = "";
            int sID = 1;

            List<Student> students = StudentManager.GetAllStudents();

            foreach (Student student in students)
            {

                #region Create User

                if (student.Email != "")
                {
                    MembershipCreateStatus result;

                    try
                    {

                        Membership.CreateUser(student.S_id, "123456", student.Email, "a", "a", true, out result);

                        switch (result)
                        {
                            case MembershipCreateStatus.Success:

                                FormsAuthentication.SetAuthCookie(student.S_id.ToString(), true);

                                var role = "STD";

                                MembershipUser myObject = Membership.GetUser(student.S_id.Trim());
                                studentID = myObject.ProviderUserKey.ToString();

                                //Assign Role to the Student
                                if (!Roles.IsUserInRole("Student"))
                                    Roles.AddUserToRole(myObject.UserName, "Student");

                                lblError.Text = "User successfully created!";
                                lblError.ForeColor = System.Drawing.Color.Green;
                                break;

                            case MembershipCreateStatus.InvalidUserName:
                                lblError.Text = "The username format was invalid. Please enter a different username.";
                                break;
                            case MembershipCreateStatus.InvalidPassword:
                                lblError.Text = "The password was invalid: A password cannot be an empty string and must also meet the pasword strength requirements of the configured provider. Please enter a new password.";
                                break;
                            case MembershipCreateStatus.InvalidEmail:
                                lblError.Text = "The email format was invalid. Please enter a different username.";
                                break;
                            case MembershipCreateStatus.InvalidQuestion:
                                lblError.Text = "The password question format was invalid. Please enter a different question.";
                                break;
                            case MembershipCreateStatus.InvalidAnswer:
                                lblError.Text = "The password answer format was invalid. Please enter a different answer.";
                                break;
                            case MembershipCreateStatus.DuplicateUserName:
                                lblError.Text = "The username is already in use. Please enter a new username.";
                                break;
                            case MembershipCreateStatus.DuplicateEmail:
                                lblError.Text = "The email address is already in use. Please enter a different email address.";
                                break;
                            default:
                                lblError.Text = "An error occurred while creating the user.";
                                break;
                        }
                    }

                    catch (Exception ex)
                    {
                        lblError.Text = ex.Message;
                        return;
                    }
                }

                else
                {
                    MembershipCreateStatus result;
                    try
                    {

                        email = student.S_id.ToString() + "@cuc.com";
                        Membership.CreateUser(student.S_id, "123456", email, "a", "a", true, out result);

                        switch (result)
                        {
                            case MembershipCreateStatus.Success:

                                FormsAuthentication.SetAuthCookie(student.S_id.ToString(), true);

                                var role = "STD";

                                MembershipUser myObject = Membership.GetUser(student.S_id.Trim());
                                studentID = myObject.ProviderUserKey.ToString();

                                //Assign Role to the Student
                                if (!Roles.IsUserInRole("Student"))
                                    Roles.AddUserToRole(myObject.UserName, "Student");

                                lblError.Text = "User successfully created!";
                                lblError.ForeColor = System.Drawing.Color.Green;
                                break;

                            case MembershipCreateStatus.InvalidUserName:
                                lblError.Text = "The username format was invalid. Please enter a different username.";
                                break;
                            case MembershipCreateStatus.InvalidPassword:
                                lblError.Text = "The password was invalid: A password cannot be an empty string and must also meet the pasword strength requirements of the configured provider. Please enter a new password.";
                                break;
                            case MembershipCreateStatus.InvalidEmail:
                                lblError.Text = "The email format was invalid. Please enter a different username.";
                                break;
                            case MembershipCreateStatus.InvalidQuestion:
                                lblError.Text = "The password question format was invalid. Please enter a different question.";
                                break;
                            case MembershipCreateStatus.InvalidAnswer:
                                lblError.Text = "The password answer format was invalid. Please enter a different answer.";
                                break;
                            case MembershipCreateStatus.DuplicateUserName:
                                lblError.Text = "The username is already in use. Please enter a new username.";
                                break;
                            case MembershipCreateStatus.DuplicateEmail:
                                lblError.Text = "The email address is already in use. Please enter a different email address.";
                                break;
                            default:
                                lblError.Text = "An error occurred while creating the user.";
                                break;
                        }
                    }
                    catch (Exception ex)
                    {
                        lblError.Text = ex.Message;
                        return;
                    }
                }

                #endregion

                #region StudentInfo
                try
                {
                    STD_Student sTD_Student = new STD_Student();
                    sTD_Student.StudentID = studentID;
                    sTD_Student.StudentName = student.S_name;
                    //sTD_Student.PPSizePhoto=  "Fileurl";

                    sTD_Student.PPSizePhoto = "~/Uploads/StudentImages/NoImage.jpg";

                    sTD_Student.StudentCode = student.S_id;
                    sTD_Student.PresentAddress = student.Pre_add;
                    sTD_Student.PermanentAddress = student.Pre_add;
                    sTD_Student.Telephone = student.Tel;
                    sTD_Student.Mobile = student.Mob;
                    sTD_Student.Email = student.Email != "" ? student.Email : email;

                    DateTime dateOfBirth = new DateTime(1970, 1, 1, 0, 0, 0, 0);

                    dateOfBirth = dateOfBirth.AddSeconds(int.Parse(student.Dob));

                    sTD_Student.DateofBirth = dateOfBirth;

                    sTD_Student.PassportNo = student.Password;
                    sTD_Student.Gender = student.Gender;
                    sTD_Student.MaritualStatusID = 1;
                    sTD_Student.ReligionID = student.R_id != "" ? int.Parse(student.R_id) : 0;
                    sTD_Student.SpouseQualification = "";
                    sTD_Student.EnglishQualification = "";
                    sTD_Student.IsRegisterWithACCA = false;
                    sTD_Student.RegistrationDate = DateTime.Parse("1/1/1753");
                    sTD_Student.RegistrationNo = "";
                    sTD_Student.AddedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                    sTD_Student.AddedDate = DateTime.Now;
                    sTD_Student.ModifiedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                    sTD_Student.ModifiedDate = DateTime.Now;
                    sTD_Student.BloodGroup = "";
                    sTD_Student.IELTS = 0;
                    sTD_Student.TOFEL = 0;
                    sTD_Student.ID = sID;
                    sTD_Student.BatchNo = 12007;
                    sTD_Student.Year = DateTime.Now.Year;
                    //sTD_Student.StudentID =
                    sTD_Student.RowStatusID = 1;
                    DataSet dsStudent = new DataSet();
                    dsStudent = STD_StudentManager.InsertSTD_Student(sTD_Student);

                    sTD_Student.StudentID = dsStudent.Tables[0].Rows[0]["StudentID"].ToString();
                    sTD_Student.StudentCode = dsStudent.Tables[0].Rows[0]["StudentCode"].ToString();

                    if (sTD_Student.StudentID != "")
                    {
                        //add to educational background to the db

                        STD_Contact contact = new STD_Contact();

                        contact.StudentID = sTD_Student.StudentID;
                        contact.AddedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                        contact.ModifiedBy = "530038e1-cf38-4ddb-84a4-99b6974b4f9d";
                        contact.ModifiedDate = DateTime.Now;
                        contact.Name = student.Father_name;
                        contact.Occupation = "";
                        contact.OfficeAddress = "";
                        contact.OfficeTel = "";
                        contact.RowStatusID = 1;
                        contact.CellNo = "";
                        contact.ContactTypeID = 1;
                        contact.AddedDate = DateTime.Now;
                        STD_ContactManager.InsertSTD_Contact(contact);

                    }

                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                }
                #endregion

            }
        }

        catch (Exception ex)
        {
        }
    }
Esempio n. 17
0
    private void SubjectStudentLoad()
    {
        try
        {
            hfClassSubjectStudentID.Value = "";
            List<STD_Student> students = new List<STD_Student>();
            DataSet dsStudentsByClassID =STD_ClassStudentManager.GetSTD_StudentByClassIDWithHistory(int.Parse(ddlClassID.SelectedValue));
            DataSet dsClassSubjectStudentByClass = STD_ClassSubjectStudentManager.GetSTD_ClassSubjectStudentByClassID(int.Parse(ddlClassID.SelectedValue));
            Session["ClassSubjectStudentByClass"] = dsClassSubjectStudentByClass;
            string studentIDs = ";";

            foreach (DataRow dr in dsStudentsByClassID.Tables[0].Rows)
            {
                if (!studentIDs.Contains(";" + dr["StudentID"].ToString() + ";"))
                {
                    studentIDs += dr["StudentID"].ToString() + ";";

                    STD_Student student = new STD_Student();
                    student.StudentID = dr["StudentID"].ToString();
                    student.StudentName = dr["StudentName"].ToString();
                    student.StudentCode = dr["StudentCode"].ToString();
                    student.PPSizePhoto = dr["PPSizePhoto"].ToString();
                    student.IsActive = true;
                    student.IsHistory = false;
                    students.Add(student);
                }

            }

            foreach (DataRow dr in dsStudentsByClassID.Tables[1].Rows)
            {
                if (!studentIDs.Contains(";" + dr["StudentID"].ToString() + ";"))
                {
                    studentIDs += dr["StudentID"].ToString() + ";";

                    STD_Student student = new STD_Student();
                    student.StudentID = dr["StudentID"].ToString();
                    student.StudentName = dr["StudentName"].ToString();
                    student.StudentCode = dr["StudentCode"].ToString();
                    student.PPSizePhoto = dr["PPSizePhoto"].ToString();
                    student.IsActive = false;
                    student.IsHistory = true;
                    students.Add(student);
                }
            }

            if (dsStudentsByClassID != null)
            {

                if (dsStudentsByClassID == null) return;
                if (dsStudentsByClassID.Tables[0].Rows.Count == 0)
                {
                    gvStudentSubject.Visible = false;
                    btnAdd.Visible = false;
                    return;
                }
                btnAdd.Visible = true;
                gvStudentSubject.Visible = true;
            }

            gvStudentSubject.DataSource = students;
            gvStudentSubject.DataBind();
        }
        catch (Exception ex)
        {

        }
    }
Esempio n. 18
0
    protected void btnSearchStudent_Click(object sender, EventArgs e)
    {
        if (ddlCourseIDReceived.SelectedIndex == 0 || txtStudentCodeSearch.Text == "")
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID and Select the Course";
            return;
        }

        try
        {
            //call the methord by which we can get the student info
            STD_Student sTD_Student = new STD_Student();
            sTD_Student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCodeSearch.Text);

            if (sTD_Student == null)
            {
                lblInstallmentSearchMessage.Text = "There is no registured student by this ID and in the selected Course";
                return;
            }

            //divReceivePayment.Visible = true;
            ddlCourseID.SelectedValue = ddlCourseIDReceived.SelectedValue;
            hfStudentID.Value = sTD_Student.StudentID;
            showSTD_FeesDataByStudentIDnCourseID();
        }
        catch (Exception ex)
        {
            lblInstallmentSearchMessage.Text = "Please enter the Student ID and Select the Course";
        }
    }
Esempio n. 19
0
 public bool UpdateSTD_Student(STD_Student sTD_Student)
 {
     using (SqlConnection connection = new SqlConnection(this.ConnectionString))
     {
         SqlCommand cmd = new SqlCommand("UpdateSTD_Student", connection);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value = sTD_Student.StudentID;
         //cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Direction = ParameterDirection.Output;
         cmd.Parameters.Add("@StudentName", SqlDbType.NVarChar).Value = sTD_Student.StudentName;
         cmd.Parameters.Add("@PPSizePhoto", SqlDbType.NVarChar).Value = sTD_Student.PPSizePhoto;
         cmd.Parameters.Add("@StudentCode", SqlDbType.NVarChar).Value = sTD_Student.StudentCode;
         cmd.Parameters.Add("@PresentAddress", SqlDbType.NVarChar).Value = sTD_Student.PresentAddress;
         cmd.Parameters.Add("@PermanentAddress", SqlDbType.NVarChar).Value = sTD_Student.PermanentAddress;
         cmd.Parameters.Add("@Telephone", SqlDbType.NVarChar).Value = sTD_Student.Telephone;
         cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = sTD_Student.Mobile;
         cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = sTD_Student.Email;
         cmd.Parameters.Add("@DateofBirth", SqlDbType.DateTime).Value = sTD_Student.DateofBirth;
         cmd.Parameters.Add("@PassportNo", SqlDbType.NVarChar).Value = sTD_Student.PassportNo;
         cmd.Parameters.Add("@Gender", SqlDbType.NVarChar).Value = sTD_Student.Gender;
         cmd.Parameters.Add("@MaritalStatusID", SqlDbType.Int).Value = sTD_Student.MaritualStatusID;
         cmd.Parameters.Add("@ReligionID", SqlDbType.Int).Value = sTD_Student.ReligionID;
         cmd.Parameters.Add("@SpouseQualification", SqlDbType.NVarChar).Value = sTD_Student.SpouseQualification;
         cmd.Parameters.Add("@EnglishQualification", SqlDbType.NVarChar).Value = sTD_Student.EnglishQualification;
         cmd.Parameters.Add("@IsRegisterWithACCA", SqlDbType.Bit).Value = sTD_Student.IsRegisterWithACCA;
         cmd.Parameters.Add("@RegistrationDate", SqlDbType.DateTime).Value = sTD_Student.RegistrationDate;
         cmd.Parameters.Add("@RegistrationNo", SqlDbType.NVarChar).Value = sTD_Student.RegistrationNo;
         cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = sTD_Student.AddedBy;
         cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_Student.AddedDate;
         cmd.Parameters.Add("@ModifiedBy", SqlDbType.NVarChar).Value = sTD_Student.ModifiedBy;
         cmd.Parameters.Add("@ModifiedDate", SqlDbType.DateTime).Value = sTD_Student.ModifiedDate;
         cmd.Parameters.Add("@BloodGroup", SqlDbType.NChar).Value = sTD_Student.BloodGroup;
         cmd.Parameters.Add("@IELTS", SqlDbType.Decimal).Value = sTD_Student.IELTS;
         cmd.Parameters.Add("@TOFEL", SqlDbType.Decimal).Value = sTD_Student.TOFEL;
         cmd.Parameters.Add("@Year", SqlDbType.Int).Value = sTD_Student.Year;
         cmd.Parameters.Add("@BatchNo", SqlDbType.Int).Value = sTD_Student.BatchNo;
         cmd.Parameters.Add("@ID", SqlDbType.Int).Value = sTD_Student.ID;
         cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = sTD_Student.RowStatusID;
         connection.Open();
         int result = cmd.ExecuteNonQuery();
         return result == 1;
     }
 }
Esempio n. 20
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            string studentCode = "";
            DateTime date = DateTime.Now;
            int year = date.Year;
            string batchNo = "";

            STD_Student student = STD_StudentManager.GetAllSTD_StudentsByBatchNo(ddlBatchID.SelectedValue != "" ? Convert.ToInt32(ddlBatchID.SelectedValue) : 0);
            int sID = 0;
            if (student != null)
            {
                sID = student.MaxID ;
            }
            else
            {
                sID = 1;
            }
            if (ddlBatchID.SelectedValue.Length > 3)
            {
                batchNo = ddlBatchID.SelectedValue.Substring(2, 3);
            }
            studentCode = year.ToString().Substring(2, 2) + batchNo + sID.ToString("000");

            try
            {
                while (Membership.ValidateUser(studentCode, Membership.Provider.GetPassword(studentCode, "a")))
                {
                    sID = sID + 1;
                    studentCode = year.ToString().Substring(2, 2) + batchNo + sID.ToString("000");
                    //break;
                }
            }
            catch (Exception ex)
            {
            }
            lblError.ForeColor = System.Drawing.Color.Red;
            var employeerPhoto = string.Empty;
            var studentID = "";
            string email = "";

            #region Create User

            if (txtEmail.Text != "")
            {
                MembershipCreateStatus result;
                try
                {

                    txtStudentCode.Text = studentCode;//set the studentCode;
                    Membership.CreateUser(studentCode, "123456", txtEmail.Text, "a", "a", true, out result);

                    switch (result)
                    {
                        case MembershipCreateStatus.Success:

                            FormsAuthentication.SetAuthCookie(txtStudentCode.Text.ToString(), true);

                            var role = "STD";

                            MembershipUser myObject = Membership.GetUser(txtStudentCode.Text.Trim());
                            studentID = myObject.ProviderUserKey.ToString();

                            //Assign Role to the Student
                            if(!Roles.IsUserInRole("Student"))
                                Roles.AddUserToRole(myObject.UserName, "Student");

                            lblError.Text = "User successfully created!";
                            lblError.ForeColor = System.Drawing.Color.Green;
                            break;

                        case MembershipCreateStatus.InvalidUserName:
                            lblError.Text = "The username format was invalid. Please enter a different username.";
                            break;
                        case MembershipCreateStatus.InvalidPassword:
                            lblError.Text = "The password was invalid: A password cannot be an empty string and must also meet the pasword strength requirements of the configured provider. Please enter a new password.";
                            break;
                        case MembershipCreateStatus.InvalidEmail:
                            lblError.Text = "The email format was invalid. Please enter a different username.";
                            break;
                        case MembershipCreateStatus.InvalidQuestion:
                            lblError.Text = "The password question format was invalid. Please enter a different question.";
                            break;
                        case MembershipCreateStatus.InvalidAnswer:
                            lblError.Text = "The password answer format was invalid. Please enter a different answer.";
                            break;
                        case MembershipCreateStatus.DuplicateUserName:
                            lblError.Text = "The username is already in use. Please enter a new username.";
                            break;
                        case MembershipCreateStatus.DuplicateEmail:
                            lblError.Text = "The email address is already in use. Please enter a different email address.";
                            break;
                        default:
                            lblError.Text = "An error occurred while creating the user.";
                            break;
                    }
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                    return;
                }
            }
            else
            {
                MembershipCreateStatus result;
                try
                {

                    txtStudentCode.Text = studentCode;//set the studentCode;
                    email = studentCode.ToString() + "@cuc.com";
                    Membership.CreateUser(studentCode, "123456", email, "a", "a", true, out result);

                    switch (result)
                    {
                        case MembershipCreateStatus.Success:

                            FormsAuthentication.SetAuthCookie(txtStudentCode.Text.ToString(), true);

                            var role = "STD";

                            MembershipUser myObject = Membership.GetUser(txtStudentCode.Text.Trim());

                            studentID = myObject.ProviderUserKey.ToString();

                            if (!Roles.IsUserInRole("Student"))
                                Roles.AddUserToRole(myObject.UserName, "Student");

                            lblError.Text = "User successfully created!";
                            lblError.ForeColor = System.Drawing.Color.Green;
                            break;

                        case MembershipCreateStatus.InvalidUserName:
                            lblError.Text = "The username format was invalid. Please enter a different username.";
                            break;
                        case MembershipCreateStatus.InvalidPassword:
                            lblError.Text = "The password was invalid: A password cannot be an empty string and must also meet the pasword strength requirements of the configured provider. Please enter a new password.";
                            break;
                        case MembershipCreateStatus.InvalidEmail:
                            lblError.Text = "The email format was invalid. Please enter a different username.";
                            break;
                        case MembershipCreateStatus.InvalidQuestion:
                            lblError.Text = "The password question format was invalid. Please enter a different question.";
                            break;
                        case MembershipCreateStatus.InvalidAnswer:
                            lblError.Text = "The password answer format was invalid. Please enter a different answer.";
                            break;
                        case MembershipCreateStatus.DuplicateUserName:
                            lblError.Text = "The username is already in use. Please enter a new username.";
                            break;
                        case MembershipCreateStatus.DuplicateEmail:
                            lblError.Text = "The email address is already in use. Please enter a different email address.";
                            break;
                        default:
                            lblError.Text = "An error occurred while creating the user.";
                            break;
                    }
                }
                catch (Exception ex)
                {
                    lblError.Text = ex.Message;
                    return;
                }
            }

            //load The loggedin user
            FormsAuthentication.SetAuthCookie(hfLoggedInUserID.Value, true);
            MembershipUser myObjectLoggedInUser = Membership.GetUser(hfLoggedInUserID.Value);
            #endregion

            #region StudentInfo
            try
            {
                STD_Student sTD_Student = new STD_Student();
                sTD_Student.StudentID = studentID;
                sTD_Student.StudentName = txtStudentName.Text.Trim();
                //sTD_Student.PPSizePhoto=  "Fileurl";
                if (Session["imagePath"] != null)
                {
                    try
                    {
                        string dirUrl = "~/Uploads/StudentImages";
                        string dirPath = Server.MapPath(dirUrl);

                        if (!Directory.Exists(dirPath))
                        {
                            Directory.CreateDirectory(dirPath);
                        }

                        string picPath = Session["imagePath"].ToString();
                        Session.Remove("imagePath");
                        string[] st = picPath.ToString().Split('.');
                        string st_pic = st[1];
                        string fileName = sTD_Student.StudentID + "." + st_pic;
                        string fileUrl = dirUrl + "/" + fileName;

                        System.Drawing.Image stImage = System.Drawing.Image.FromFile(picPath);
                        stImage.Save(Server.MapPath(fileUrl));

                        sTD_Student.PPSizePhoto = fileUrl;
                    }
                    catch (Exception ex)
                    {
                        lblError.Text = ex.Message;
                    }
                }
                else
                {
                    if (uplFile.PostedFile != null && uplFile.PostedFile.ContentLength > 0)
                    {
                        try
                        {
                            string dirUrl = "~/Uploads/StudentImages";
                            string dirPath = Server.MapPath(dirUrl);

                            if (!Directory.Exists(dirPath))
                            {
                                Directory.CreateDirectory(dirPath);
                            }
                            string fileName = Path.GetFileName(uplFile.PostedFile.FileName);
                            string fileUrl = dirUrl + "/" + sTD_Student.StudentID + "_" + Path.GetFileName(uplFile.PostedFile.FileName);
                            string filePath = Server.MapPath(fileUrl);
                            uplFile.PostedFile.SaveAs(filePath);

                            System.Drawing.Image originalImage = System.Drawing.Image.FromFile(filePath);
                            System.Drawing.Image resizedImage = resizeImageWithGivenValue(originalImage, 150, 150);
                            resizedImage.Save(dirPath + "/" + "Display_" + sTD_Student.StudentID + fileName, ImageFormat.Jpeg);

                            sTD_Student.PPSizePhoto = dirUrl + "/" + "Display_" + sTD_Student.StudentID + fileName;
                        }
                        catch (Exception ex)
                        {
                            lblError.Text = ex.Message;
                        }
                    }
                    else
                    {
                        sTD_Student.PPSizePhoto = "~/Uploads/StudentImages/NoImage.jpg";
                    }
                }
                sTD_Student.StudentCode = txtStudentCode.Text;
                sTD_Student.PresentAddress = txtPresentAddress.Text;
                sTD_Student.PermanentAddress = txtPermanentAddress.Text;
                sTD_Student.Telephone = txtTelephone.Text;
                sTD_Student.Mobile = txtMobile.Text;
                sTD_Student.Email = txtEmail.Text != "" ? txtEmail.Text : email;
                sTD_Student.DateofBirth = DateTime.Parse(txtDateofBirth.Text);
                sTD_Student.PassportNo = txtPassportNo.Text;
                sTD_Student.Gender = txtGender.Text;
                sTD_Student.MaritualStatusID = ddlMaritualStatusID.SelectedValue != "" ? int.Parse(ddlMaritualStatusID.SelectedValue) : 0;
                sTD_Student.ReligionID = ddlReligionID.SelectedValue != "" ? int.Parse(ddlReligionID.SelectedValue) : 0;
                sTD_Student.SpouseQualification = ddlCourseID.SelectedValue;
                sTD_Student.EnglishQualification = txtEnglishQualification.Text;
                sTD_Student.IsRegisterWithACCA = Convert.ToBoolean(radIsRegisterWithACCA.SelectedValue);
                sTD_Student.RegistrationDate = txtRegistrationDate.Text != "" ? DateTime.Parse(txtRegistrationDate.Text) : DateTime.Parse("1/1/1753");
                sTD_Student.RegistrationNo = txtRegistrationNo.Text;
                sTD_Student.AddedBy = Profile.card_id;
                sTD_Student.AddedDate = DateTime.Now;
                sTD_Student.ModifiedBy = Profile.card_id;
                sTD_Student.ModifiedDate = DateTime.Now;
                sTD_Student.BloodGroup = txtBloodGroup.Text;
                sTD_Student.IELTS = txtIELTS.Text != "" ? decimal.Parse(txtIELTS.Text) : 0;
                sTD_Student.TOFEL = txtTOFEL.Text != "" ? decimal.Parse(txtTOFEL.Text) : 0;
                sTD_Student.ID = sID;
                sTD_Student.BatchNo = ddlBatchID.SelectedValue != "" ? Convert.ToInt32(ddlBatchID.SelectedValue) : 0;
                sTD_Student.Year = year;
                //sTD_Student.StudentID =
                sTD_Student.RowStatusID = 1;
                DataSet dsStudent = new DataSet();
                dsStudent = STD_StudentManager.InsertSTD_Student(sTD_Student);

                sTD_Student.StudentID = dsStudent.Tables[0].Rows[0]["StudentID"].ToString();
                sTD_Student.StudentCode = dsStudent.Tables[0].Rows[0]["StudentCode"].ToString();

                //add to educational background to the db

                if (Session["educationalBackground"] != null)
                {
                    List<COMN_EducatinalBackground> educationalBackground = new List<COMN_EducatinalBackground>();
                    educationalBackground = (List<COMN_EducatinalBackground>)Session["educationalBackground"];

                    foreach (COMN_EducatinalBackground cOMN_EducatinalBackground in educationalBackground)
                    {
                        cOMN_EducatinalBackground.UserID = sTD_Student.StudentID;
                        COMN_EducatinalBackgroundManager.InsertCOMN_EducatinalBackground(cOMN_EducatinalBackground);
                    }

                    educationalBackground.RemoveRange(0, educationalBackground.Count);
                }

                // Add job_experience
                if (Session["jobexperience"] != null)
                {
                    List<COMN_JobExperience> jobexperience = new List<COMN_JobExperience>();
                    jobexperience = (List<COMN_JobExperience>)Session["jobexperience"];

                    foreach (COMN_JobExperience cOMN_JobExperience in jobexperience)
                    {
                        cOMN_JobExperience.UserID = sTD_Student.StudentID;
                        COMN_JobExperienceManager.InsertCOMN_JobExperience(cOMN_JobExperience);
                    }
                    jobexperience.RemoveRange(0, jobexperience.Count);
                }
                // Add job_experience
                if (Session["contacts"] != null)
                {
                    List<STD_Contact> contacts = new List<STD_Contact>();
                    contacts = (List<STD_Contact>)Session["contacts"];

                    foreach (STD_Contact sTD_Contact in contacts)
                    {
                        sTD_Contact.StudentID = sTD_Student.StudentID;
                        STD_ContactManager.InsertSTD_Contact(sTD_Contact);
                    }
                    contacts.RemoveRange(0, contacts.Count);
                }

            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message;
            }
            #endregion

            #region Add semester fee
            if (txtSemesterFee.Text != "" && txtSemesterFee.Text != "0" && ddlCourseID.SelectedIndex != 0)
            {
                STD_FeesMaster sTD_FeesMaster = new STD_FeesMaster();
                sTD_FeesMaster = insertFeesMaster(29, studentID); //Semester Fee = 29

            }
            #endregion

            Response.Redirect("AdminDetailsSTD_Student.aspx?ID=" + studentID);

        }

        catch (Exception ex)
        {
            lblError.Text = ex.Message;
        }
    }
Esempio n. 21
0
    private bool StudentCodeVarification(STD_Student students)
    {
        // = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text.Trim());
        if (students != null)
        {
            pnStudentDetails.Visible = true;
            lblName.Text = students.StudentName;
            lblContact.Text = students.Mobile;
            imgStudent.ImageUrl = students.PPSizePhoto;

            hfStudentID.Value = students.StudentID;
            lblTest.Text = "Student Code is Exist. <a target='_blank' style='color:blue;' href='../Student/AdminDetailsSTD_Student.aspx?ID=" + students.StudentID + "'>Click here for Details</a>";
            //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Student Code is Exist')", true);
            return true;
        }
        else
        {
            lblTest.Text = "Student Code is not Exist";
            ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Student Code is not Exist')", true);
        }
        return false;
    }
Esempio n. 22
0
    protected void btnVarify_OnClick(object sender, EventArgs e)
    {
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);

        if (student == null)
        {
            lblMessage.Text = "<br/>There is no Student with this student Id";
            return;
        }
        else
        {
            lblMessage.Text = "!!! Valid ID  !!!";
            hfStudentID.Value = student.StudentID;
        }

        //Session["ClassSubjectStudents"] = student;
        CourseIDLoad();
        loadClassSubjectStudentDataBase();
        loadRoutine();
    }
Esempio n. 23
0
 public static STD_Student GetSTD_StudentMoneyReceitByStudentID(string StudentID)
 {
     STD_Student sTD_Student = new STD_Student();
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     sTD_Student = sqlSTD_StudentProvider.GetSTD_StudentMoneyReceitByStudentID(StudentID);
     return sTD_Student;
 }
Esempio n. 24
0
    public STD_Student GetSTD_StudentFromReader(IDataReader reader)
    {
        try
        {
            STD_Student sTD_Student = new STD_Student
                (

                     DataAccessObject.IsNULL<string>(reader["StudentID"].ToString()),
                     DataAccessObject.IsNULL<string>(reader["StudentName"]),
                     DataAccessObject.IsNULL<string>(reader["PPSizePhoto"]),
                     DataAccessObject.IsNULL<string>(reader["StudentCode"]),
                     DataAccessObject.IsNULL<string>(reader["PresentAddress"]),
                     DataAccessObject.IsNULL<string>(reader["PermanentAddress"]),
                     DataAccessObject.IsNULL<string>(reader["Telephone"]),
                     DataAccessObject.IsNULL<string>(reader["Mobile"]),
                     DataAccessObject.IsNULL<string>(reader["Email"]),
                     DataAccessObject.IsNULL<DateTime>(reader["DateofBirth"]),
                     DataAccessObject.IsNULL<string>(reader["PassportNo"]),
                     DataAccessObject.IsNULL<string>(reader["Gender"]),
                     DataAccessObject.IsNULL<int>(reader["MaritalStatusID"]),
                     DataAccessObject.IsNULL<int>(reader["ReligionID"]),
                     DataAccessObject.IsNULL<string>(reader["SpouseQualification"]),
                     DataAccessObject.IsNULL<string>(reader["EnglishQualification"]),
                     DataAccessObject.IsNULL<bool>(reader["IsRegisterWithACCA"]),
                     DataAccessObject.IsNULL<DateTime>(reader["RegistrationDate"]),
                     DataAccessObject.IsNULL<string>(reader["RegistrationNo"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["ModifiedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["ModifiedDate"]),
                     DataAccessObject.IsNULL<string>(reader["BloodGroup"]),
                     DataAccessObject.IsNULL<decimal>(reader["IELTS"]),
                     DataAccessObject.IsNULL<decimal>(reader["TOFEL"]),
                     DataAccessObject.IsNULL<int>(reader["Year"]),
                     DataAccessObject.IsNULL<int>(reader["BatchNo"]),
                     DataAccessObject.IsNULL<int>(reader["ID"]),
                     DataAccessObject.IsNULL<int>(reader["RowStatusID"])
                );
            try
            {
                sTD_Student.ClassName = DataAccessObject.IsNULL<string>(reader["ClassName"]);
            }
            catch (Exception ex)
            {

            }
            return sTD_Student;
        }
        catch (Exception ex)
        {
            return null;
        }
    }
Esempio n. 25
0
 public static bool UpdateSTD_Student(STD_Student sTD_Student)
 {
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     return sqlSTD_StudentProvider.UpdateSTD_Student(sTD_Student);
 }
Esempio n. 26
0
    public STD_Student GetSTD_StudentFromReader1(IDataReader reader)
    {
        try
        {
            STD_Student sTD_Student = new STD_Student
                (

                      DataAccessObject.IsNULL<int>(reader["MaxID"]),
                     DataAccessObject.IsNULL<int>(reader["Year"])

                );

            return sTD_Student;
        }
        catch (Exception ex)
        {
            return null;
        }
    }
Esempio n. 27
0
    protected void btnSaveRegistrationNo_Click(object sender, EventArgs e)
    {
        STD_Student student = new STD_Student();
        student = STD_StudentManager.GetHR_StudnetByStudentCode(txtStudentCode.Text);
        student.RegistrationNo = txtAccARegistrationNo.Text;
        btnSaveRegistrationNo.Visible = false;
        txtAccARegistrationNo.Enabled = false;

        STD_StudentManager.UpdateSTD_Student(student);
    }
Esempio n. 28
0
    protected void btnSavePhoneNo_Click(object sender, EventArgs e)
    {
        int count = 0;

        foreach (GridViewRow gvr in gvStudents.Rows)
        {
            string studentcode = ((Label)gvr.FindControl("lblStudentCode")).Text;

            string phoneNew = ((TextBox)gvr.FindControl("txtTelephone")).Text;
            string mobileNew = ((TextBox)gvr.FindControl("txtMobile")).Text;

            if (phoneNew != "" || mobileNew != "")
            {
                STD_Student student = new STD_Student();
                student = STD_StudentManager.GetHR_StudnetByStudentCode(studentcode);

                if (phoneNew != "")
                {
                    student.Telephone = phoneNew + "; " + student.Telephone;
                }

                if (mobileNew != "")
                {
                    student.Mobile = mobileNew + "; " + student.Mobile;
                }

                student.ModifiedBy = Profile.card_id;
                student.ModifiedDate = DateTime.Now.AddHours(int.Parse(ConfigurationManager.AppSettings["ServerTimeDiff"]));

                if (STD_StudentManager.UpdateSTD_Student(student))
                {
                    count++;
                }
            }

        }

        lblSavePhoneNo.Text = count +" Student(s) info has updated";
    }
Esempio n. 29
0
 public static STD_Student GetHR_StudnetByStudentCode(string studentCode)
 {
     STD_Student sTD_Student = new STD_Student();
     SqlSTD_StudentProvider sqlSTD_StudentProvider = new SqlSTD_StudentProvider();
     sTD_Student = sqlSTD_StudentProvider.GetSTD_StudentByStudentCode(studentCode);
     return sTD_Student;
 }
Esempio n. 30
0
 private void showSTD_StudentData()
 {
     STD_Student sTD_Student  = new STD_Student ();
      	sTD_Student = STD_StudentManager.GetSTD_StudentByStudentID(Request.QueryString["ID"]);
      	txtStudentName.Text =sTD_Student.StudentName.ToString();
      	txtPPSizePhoto.Text =sTD_Student.PPSizePhoto.ToString();
      	txtStudentCode.Text =sTD_Student.StudentCode.ToString();
      	txtPresentAddress.Text =sTD_Student.PresentAddress.ToString();
      	txtPermanentAddress.Text =sTD_Student.PermanentAddress.ToString();
      	txtTelephone.Text =sTD_Student.Telephone.ToString();
      	txtMobile.Text =sTD_Student.Mobile.ToString();
      	txtEmail.Text =sTD_Student.Email.ToString();
      	txtDateofBirth.Text =sTD_Student.DateofBirth.ToString();
      	txtPassportNo.Text =sTD_Student.PassportNo.ToString();
      	txtGender.Text =sTD_Student.Gender.ToString();
      	ddlMaritualStatusID.SelectedValue  =sTD_Student.MaritualStatusID.ToString();
      	ddlReligionID.SelectedValue  =sTD_Student.ReligionID.ToString();
      	txtSpouseQualification.Text =sTD_Student.SpouseQualification.ToString();
      	txtEnglishQualification.Text =sTD_Student.EnglishQualification.ToString();
      	 radIsRegisterWithACCA.SelectedValue  =sTD_Student.IsRegisterWithACCA.ToString();
      	txtRegistrationDate.Text =sTD_Student.RegistrationDate.ToString();
      	txtRegistrationNo.Text =sTD_Student.RegistrationNo.ToString();
      	txtBloodGroup.Text =sTD_Student.BloodGroup.ToString();
      	txtIELTS.Text =sTD_Student.IELTS.ToString();
      	txtTOFEL.Text =sTD_Student.TOFEL.ToString();
 }