Exemplo n.º 1
0
    public static bool verifyLoginID(string LoginID)
    {
        bool Flag = true;

        try
        {
            Student_BLogic BAL_Student = new Student_BLogic();
            Student        Student     = new Student();
            DataSet        ds          = new DataSet();

            Student.loginid = LoginID;
            ds = BAL_Student.BAL_Verify_Student(Student);
            if (ds.Tables[0].Rows.Count > 0 && ds != null)
            {
                string UserLoginID = ds.Tables[0].Rows[0]["LoginID"].ToString();
                if (UserLoginID != string.Empty)
                {
                    Flag = false;
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(Flag);
    }
    protected void FillStudentList()
    {
        Student_BLogic OStudent_BLogic = new Student_BLogic();
        DataSet        dsStudentList   = new DataSet();

        //dsStudentList = OStudent_BLogic.BAL_Student_SelectBMSDIVWise(Convert.ToInt32(ddlschool.SelectedValue), Convert.ToInt32(ddlnextyearBMS.SelectedValue), Convert.ToInt32(ddldivision.SelectedValue), ddlAcademicYear.SelectedItem.ToString());
        dsStudentList = OStudent_BLogic.BAL_Student_SelectBMSDIVWise(Convert.ToInt32(ddlschool.SelectedValue), Convert.ToInt32(ddlnextyearBMS.SelectedValue), Convert.ToInt32(ddldivision.SelectedValue), lblnextacedemicyear.Text.Trim());
        try
        {
            if (dsStudentList != null)
            {
                if (dsStudentList.Tables[0].Rows.Count > 0)
                {
                    if (ddlnextyearBMS.SelectedIndex > 0 && ddldivision.SelectedIndex > 0)
                    {
                        btnupdate.Visible   = true;
                        lblNoOfStudent.Text = "Total Student in " + ddlnextyearBMS.SelectedItem.ToString() + " is " + dsStudentList.Tables[0].Rows.Count.ToString();
                        // dvstudentlist.Visible = true;
                        GridView1.DataSource = dsStudentList.Tables[0];
                        GridView1.DataBind();
                    }
                }
                else
                {
                    GridView1.DataSource = null;
                    GridView1.DataBind();
                    btnupdate.Visible = false;
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnupdate_Click(object sender, EventArgs e)
    {
        try
        {
            int            CurrnetRollNo   = 0;
            string         GRNO            = string.Empty;
            int            studentid       = 0;
            Student_BLogic oStudent_Blogic = new Student_BLogic();
            foreach (GridViewRow gvrow in GridView1.Rows)
            {
                CurrnetRollNo = Convert.ToInt32(((TextBox)GridView1.Rows[gvrow.RowIndex].Cells[2].FindControl("txtrollno")).Text);
                GRNO          = ((TextBox)GridView1.Rows[gvrow.RowIndex].Cells[3].FindControl("txtgrno")).Text;
                studentid     = Convert.ToInt32(GridView1.DataKeys[gvrow.RowIndex].Value);

                oStudent_Blogic.BAL_Student_Update_Student(studentid, CurrnetRollNo, GRNO);
            }

            WebMsg.Show("Student details updated sucessfully....");

            FillPromotedStudentList();
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 4
0
    protected bool verifyLoginID()
    {
        bool Flag = true;

        try
        {
            BAL_Student = new Student_BLogic();
            Student     = new Student();
            DataSet ds = new DataSet();

            Student.loginid = txtEmail.Text;
            ds = BAL_Student.BAL_Verify_Student(Student);
            if (ds.Tables[0].Rows.Count > 0 && ds != null)
            {
                string LoginID = ds.Tables[0].Rows[0]["LoginID"].ToString();
                if (LoginID != string.Empty)
                {
                    Flag = false;
                    // WebMsg.Show("LoginID already exist..");
                }
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(Flag);
    }
Exemplo n.º 5
0
    protected void Dvw_PersonalDetails_ModeChanging(object sender, DetailsViewModeEventArgs e)
    {
        try
        {
            if (Dvw_PersonalDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.ReadOnly);
            }
            else
            {
                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.Edit);
            }
            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();

            ViewState["byteimage"] = (byte[])dsSelect.Tables[0].Rows[0]["Picture"];
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 6
0
    public static int InsertStudent(int BMSID, string LoginID, string Password, string FirstName, string LastName, int ContactNo, string Gender)
    {
        Student        Student     = new Student();
        Student_BLogic BAL_Student = new Student_BLogic();
        int            t1          = 0;

        try
        {
            Student.bmsid     = BMSID;
            Student.loginid   = LoginID;
            Student.password  = Password;
            Student.firstname = FirstName;
            Student.lastname  = LastName;
            Student.contactno = ContactNo;
            Student.emailid   = LoginID;
            if (Gender == "1")
            {
                Student.gender = 'M';
            }
            else if (Gender == "2")
            {
                Student.gender = 'F';
            }

            Student.PaymentType = 'I';


            t1 = BAL_Student.BAL_Student_Insert_Online(Student, "OnlineReg");
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        return(t1);
    }
    private void BindGridData()
    {
        Student_BLogic oStudent_BLogic = new Student_BLogic();
        DataSet        ods             = oStudent_BLogic.BAL_Get_MessageLog();

        this.GvUserList.DataSource = ods;
        this.GvUserList.DataBind();
    }
Exemplo n.º 8
0
    protected void Dvw_ParentGuardianDetails_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        try
        {
            if (Dvw_ParentGuardianDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Label   lbl_findStudentid     = (Label)Dvw_ParentGuardianDetails.Rows[0].FindControl("Lbl_EditParentStudentId");
                TextBox Txt_findFathername    = (TextBox)Dvw_ParentGuardianDetails.Rows[1].FindControl("Txt_EditFatherName");
                TextBox Txt_findFatherContact = (TextBox)Dvw_ParentGuardianDetails.Rows[2].FindControl("Txt_EditFatherContact");
                TextBox Txt_findFatherEmail   = (TextBox)Dvw_ParentGuardianDetails.Rows[3].FindControl("Txt_EditFatherEmail");

                TextBox Txt_findMothername    = (TextBox)Dvw_ParentGuardianDetails.Rows[4].FindControl("Txt_EditMotherName");
                TextBox Txt_findMotherContact = (TextBox)Dvw_ParentGuardianDetails.Rows[5].FindControl("Txt_EditMotherContact");
                TextBox Txt_findMotherEmail   = (TextBox)Dvw_ParentGuardianDetails.Rows[6].FindControl("Txt_EditMotherEmail");

                TextBox Txt_findGuardianname    = (TextBox)Dvw_ParentGuardianDetails.Rows[7].FindControl("TxtEditGuardianName");
                TextBox Txt_findGuardianContact = (TextBox)Dvw_ParentGuardianDetails.Rows[8].FindControl("Txt_EditGuardianContact");
                TextBox Txt_findGuardianEmail   = (TextBox)Dvw_ParentGuardianDetails.Rows[9].FindControl("Txt_EditGuardianEmail");

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

                obj_student.studentid     = int.Parse(lbl_findStudentid.Text);
                obj_student.FatherName    = Txt_findFathername.Text;
                obj_student.FatherContact = Txt_findFatherContact.Text;
                obj_student.FatherEmail   = Txt_findFatherEmail.Text;

                obj_student.MotherName    = Txt_findMothername.Text;
                obj_student.MotherContact = Txt_findMotherContact.Text;
                obj_student.MotherEmail   = Txt_findMotherEmail.Text;

                obj_student.GuardianName    = Txt_findGuardianname.Text;
                obj_student.GuardianContact = Txt_findGuardianContact.Text;
                obj_student.GuardianEmail   = Txt_findGuardianEmail.Text;

                obj_studblogic.UpdateStudentProfile(obj_student, "parent");

                Dvw_ParentGuardianDetails.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_ParentGuardianDetails.DataSource = dsSelect;
                Dvw_ParentGuardianDetails.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 Parent Details.", 0);
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Page.Title = "Update Pofile";

            string IFormat = "dd-MMM-yyyy";

            //lblRole.Text = "Student";

            DataSet dsStudent = new DataSet();
            BAL_Student = new Student_BLogic();
            try
            {
                dsStudent = BAL_Student.BAL_Student_GetDetailByStudentID(AppSessions.StudentID);
                if (dsStudent != null & dsStudent.Tables.Count > 0)
                {
                    if (dsStudent.Tables[0].Rows.Count > 0)
                    {
                        //FirstName, MiddleName, LastName, Gender, DateOfBirth, BloodGroup, Address, EmailID, ContactNo, MobileNumber
                        txtAddFirstName.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["FirstName"]);
                        //   txtAddMiddleName.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["MiddleName"]);
                        txtAddLastName.Text         = Convert.ToString(dsStudent.Tables[0].Rows[0]["LastName"]);
                        rlstAddGender.SelectedValue = Convert.ToString(dsStudent.Tables[0].Rows[0]["Gender"]);
                        DateTime dt;
                        if (DateTime.TryParse(Convert.ToString(dsStudent.Tables[0].Rows[0]["DateOfBirth"]), out dt))
                        {
                            txtAddDOB.Text = dt.ToString(IFormat);
                        }
                        //txtAddBloodGroup.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["BloodGroup"]);
                        txtAddPermanentAddress.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["Address"]);
                        txtAddEmail.Text            = Convert.ToString(dsStudent.Tables[0].Rows[0]["EmailID"]);
                        string contactno = Convert.ToString(dsStudent.Tables[0].Rows[0]["ContactNo"]);
                        string mobileno  = Convert.ToString(dsStudent.Tables[0].Rows[0]["MobileNo"]);
                        if (contactno != "0")
                        {
                            txtAddContactNumber.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["ContactNo"]);
                        }
                        if (mobileno != "0")

                        {
                            txtAddMobileNumber.Text = Convert.ToString(dsStudent.Tables[0].Rows[0]["MobileNo"]);
                        }
                        // lblAddTitle.Text = "Update Profile: " + txtAddFirstName.Text;
                        TxtOldPassword.Text = null;
                    }
                }
            }
            catch (Exception ex)
            {
                WebMsg.Show(ex.Message);
            }
        }
    }
Exemplo n.º 10
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int t1 = 0;

        try
        {
            if (verifyLoginID())
            {
                Student             = new Student();
                BAL_Student         = new Student_BLogic();
                Student.schoolid    = 1;
                Student.divisionid  = 1;
                Student.bmsid       = int.Parse(ddlBMS.SelectedValue);
                Student.loginid     = txtEmail.Text;
                Student.password    = txtPassword.Text;
                Student.firstname   = txtFirstName.Text;
                Student.lastname    = txtLastName.Text;
                Student.contactno   = Convert.ToInt64(txtContactNo.Text);
                Student.emailid     = txtEmail.Text;
                Student.dateofbirth = Convert.ToDateTime(txtBirthdate.Text);
                if (ddlGender.SelectedValue == "1")
                {
                    Student.gender = 'M';
                }
                else if (ddlGender.SelectedValue == "2")
                {
                    Student.gender = 'F';
                }

                Student.PaymentType = 'I';



                t1 = BAL_Student.BAL_Student_Insert_Online(Student, "OnlineReg");
                if (t1 > 0)
                {
                    //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "You are successfully registered", false);
                    WebMsg.Show("Your registration has been done successfully.");
                    ClearRegisterControls();
                }
                ClearRegisterControls();
            }
            else
            {
                WebMsg.Show("LoginID already exist..");
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        finally
        { }
    }
Exemplo n.º 11
0
    public static KeyValueData[] GETSTUDENTDATA()
    {
        List <KeyValueData> olst = new List <KeyValueData>();
        DataSet             ods  = new DataSet();
        Student_BLogic      BAL_Student_BLogic = new Student_BLogic();

        ods = BAL_Student_BLogic.BAL_Student_BySchoolid(AppSessions.SchoolID);

        foreach (DataRow dr in ods.Tables[0].Rows)
        {
            KeyValueData okey = new KeyValueData();
            okey.Key   = Convert.ToString(dr["StudentID"]);
            okey.Value = Convert.ToString(dr["MobileNo"]);
            olst.Add(okey);
        }
        return(olst.ToArray());
    }
    protected void FillGridDetails()
    {
        Student_BLogic OStudent_BLogic = new Student_BLogic();

        dsStudentList = OStudent_BLogic.BAL_Student_SelectBMSDIVWise(Convert.ToInt32(ddlschool.SelectedValue), Convert.ToInt32(ddlBMS.SelectedValue), Convert.ToInt32(ddldiv.SelectedValue), ddlcurrentacedemicyear.SelectedItem.ToString());
        try
        {
            if (dsStudentList != null)
            {
                gvstudentList.Visible    = true;
                gvstudentList.DataSource = dsStudentList;
                gvstudentList.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnok_Click(object sender, EventArgs e)
    {
        Student_BLogic OStudent_BLogic = new Student_BLogic();


        dsStudentList = OStudent_BLogic.BAL_Student_SelectBMSDIVWise(Convert.ToInt32(ddlschool.SelectedValue), Convert.ToInt32(ddlBMS.SelectedValue), Convert.ToInt32(ddldiv.SelectedValue), ddlcurrentacedemicyear.SelectedItem.ToString());
        try
        {
            if (dsStudentList != null)
            {
                if (dsStudentList.Tables[0].Rows.Count > 0)
                {
                    if (ddlschool.SelectedIndex > 0 && ddlBMS.SelectedIndex > 0 && ddldiv.SelectedIndex > 0)
                    {
                        gvstudentList.Visible    = true;
                        gvstudentList.DataSource = dsStudentList.Tables[0];
                        gvstudentList.DataBind();
                        ViewState["StudentList"] = dsStudentList.Tables[0];
                        //divpromot.Visible = true;
                        btnpromote.Visible             = true;
                        ddlBMS.Enabled                 = false;
                        ddldiv.Enabled                 = false;
                        ddlcurrentacedemicyear.Enabled = false;
                        FillBMSDropdown(ddlnextyearBMS);
                        FillAcademicYearDropdown();
                    }
                    else
                    {
                        WebMsg.Show("Please select BMS and Division and Current Acedemic Year......");
                    }
                }
                else
                {
                    divpromot.Visible = false;
                    DataTable dt = new DataTable();
                    gvstudentList.DataSource = dt;
                    gvstudentList.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnImport_Click(object sender, EventArgs e)
    {
        if (Convert.ToBoolean(ViewState["IsValid"]))
        {
            System.Data.DataTable dt = new System.Data.DataTable();
            dt = (System.Data.DataTable)ViewState["ImportTable"];
            StringBuilder sb = new StringBuilder();

            foreach (DataRow row in dt.Rows)
            {
                sb.Append("(" + AppSessions.SchoolID + "," + GetBMSID(Convert.ToString(row["BMS"])) + "," + GetDivisionID(Convert.ToString(row["Division"])) + ",Null," + Rim(Convert.ToString(row["FirstName"]), true) + "," + Rim(Convert.ToString(row["MiddleName"]), true) + "," + Rim(Convert.ToString(row["LastName"]), true) + "," + Rim(Convert.ToString(row["Address"]), true) + "," + CheckNull(Convert.ToString(row["RollNo"])) + "," + CheckNull(Convert.ToString(row["ContactNo"])) + "," + CheckNull(Convert.ToString(row["MobileNo"])) + "," + Rim(Convert.ToString(row["EmailID"])) + "," + Rim(Convert.ToString(row["GRNo"])) + "," + ((!string.IsNullOrEmpty(Convert.ToString(row["DateOfBirth"]))) ? Rim(Convert.ToDateTime(row["DateOfBirth"]).ToString("dd-MMM-yyyy")) : "Null") + "," + Rim(GetMaleFemaleChar(Convert.ToString(row["Gender"]).ToLower())) + "," + Rim(Convert.ToString(row["BloodGroup"]), true) + "," + AppSessions.EmpolyeeID + "),");
            }
            string InsertStatement = sb.ToString().Remove(sb.ToString().Length - 1, 1);

            BAL_Student = new Student_BLogic();

            DataSet dsResult = BAL_Student.Insert_Student_Bulk(InsertStatement);

            if (dsResult.Tables.Count > 0)
            {
                if (dsResult.Tables[0].Rows.Count > 0)
                {
                    ViewState["dsResult"] = dsResult.Tables[0];

                    gvresult.Visible    = true;
                    gvresult.DataSource = dsResult.Tables[0];
                    gvresult.DataBind();
                    mdlresult.Show();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Student has been imported failed.');", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Student has been imported failed.');", true);
            }
        }
        else
        {
            ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Please resolve the red cell data in excel and try again.');", true);
        }
    }
Exemplo n.º 15
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Student            = new Student();
        BAL_Student        = new Student_BLogic();
        Student.studentid  = Convert.ToInt32(ViewState["studentid"].ToString());
        Student.schoolid   = int.Parse(ltrlSchoolIDEdit.Text);
        Student.bmsid      = int.Parse(ddlBMSEdit.SelectedValue);
        Student.divisionid = int.Parse(ddlDivisionEdit.SelectedValue);
        //Student.studentcode = txtStudentCodeEdit.Text;
        Student.loginid    = txtLoginIDEdit.Text;
        Student.password   = txtPasswordEdit.Text;
        Student.firstname  = txtFirstNameEdit.Text;
        Student.middlename = txtMiddleNameEdit.Text;
        Student.lastname   = txtLastNameEdit.Text;
        Student.rollno     = Convert.ToInt16(txtRollNoEdit.Text);
        //Student.contactno = Convert.ToInt64(txtContactNoEdit.Text);
        //Student.mobileno = Convert.ToInt64(txtMobileNoEdit.Text);
        //Student.emailid = txtEmailIDEdit.Text;
        //Student.grno = txtGRNoEdit.Text;
        //Student.dateofbirth = Convert.ToDateTime(txtDateOfBirthEdit.Text);
        if (rdbGenderEditList.SelectedValue == "0")
        {
            Student.gender = 'M';
        }
        else
        {
            Student.gender = 'F';
        }
        //Student.bloodgroup = txtBloodGroupEdit.Text;
        //if (chkIsActiveEdit.Checked == true)
        //{
        //    Student.isactive = true;
        //}
        //else
        //{
        //    Student.isactive = false;
        //}


        Student.modifiedby = AppSessions.EmpolyeeID;
        BAL_Student.BAL_Student_Update(Student, "Update");
        RefreshPageControls();
    }
Exemplo n.º 16
0
    public static bool SENDMESSAGE(string studentid, string number, string message)
    {
        bool   IsSuccess   = false;
        bool   SendStatus  = false;
        string strresponse = string.Empty;

        SendStatus = SendSMS(number, message, ref strresponse);
        if (SendStatus == true && strresponse.ToLower().Contains("message gid"))
        {
            IsSuccess = true;
        }

        #region Log Message
        Student_BLogic BAL_Student_BLogic = new Student_BLogic();
        BAL_Student_BLogic.BAL_MessageLog(studentid, number, message, strresponse, IsSuccess);
        #endregion

        return(IsSuccess);
    }
Exemplo n.º 17
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            Student            = new Student();
            BAL_Student        = new Student_BLogic();
            Student.schoolid   = int.Parse(ltrlSchoolID.Text);
            Student.bmsid      = int.Parse(ddlBMSAdd.SelectedValue);
            Student.divisionid = int.Parse(ddlDivisionAdd.SelectedValue);
            //Student.studentcode = txtStudentCode.Text;
            //Student.loginid = txtLoginID.Text;
            //Student.password = txtPassword.Text;
            Student.firstname  = txtFirstName.Text;
            Student.middlename = txtMiddleName.Text;
            Student.lastname   = txtLastName.Text;
            Student.rollno     = Convert.ToInt16(txtRollNo.Text);
            //Student.contactno = Convert.ToInt64(txtContactNo.Text);
            //Student.mobileno = Convert.ToInt64(txtMobileNo.Text);
            //Student.emailid = txtEmailID.Text;
            //Student.grno = txtGRNo.Text;
            //Student.dateofbirth = Convert.ToDateTime(txtDateOfBirth.Text);
            if (rdbGenderList.SelectedValue == "0")
            {
                Student.gender = 'M';
            }
            else if (rdbGenderList.SelectedValue == "1")
            {
                Student.gender = 'F';
            }

            //Student.bloodgroup = txtBloodGroup.Text;
            Student.createdby = AppSessions.EmpolyeeID;
            BAL_Student.BAL_Student_Insert(Student, "Insert");
            RefreshPageControls();
            pnlSearch.CssClass = "Visible";
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        { }
    }
Exemplo n.º 18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            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();

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

            Dvw_EducationalDetails.DataSource = dsSelect;
            Dvw_EducationalDetails.DataBind();
        }
    }
Exemplo n.º 19
0
    //public bool CheckPasswordComplexcity()
    //{
    //    bool flag = false;
    //    BLogic_Student = new Student_DashBoard_BLogic();
    //    DataSet dsResult = new DataSet();
    //    dsResult = BLogic_Student.BAL_Select_PaymentPagesInfo("Password");

    //    string Complexcity = dsResult.Tables[0].Rows[0]["value"].ToString();

    //    if (txtPassword.Text.Length > 0)
    //    {
    //        if (System.Text.RegularExpressions.Regex.IsMatch(txtPassword.Text, Complexcity))
    //        {

    //            //WebMsg.Show("Valid Password");
    //            flag = true;
    //        }
    //        else
    //        {
    //            //WebMsg.Show("Invalid Password");
    //            flag = false;
    //        }
    //    }
    //    return flag;
    //}

    //public void InsertIntoStudentPackageDetails(int studentid)
    //{
    //    try
    //    {
    //        //Student = new Student();
    //        BAL_Student = new Student_BLogic();
    //        Package_BLogic Blogic_Package = new Package_BLogic();
    //        //Student.bmsid = Convert.ToInt32(ViewState["BMSID"]);
    //        int BMSID = Convert.ToInt32(ViewState["BMSID"]);
    //        DataSet dsPackageID = BAL_Student.BAL_Student_SelectPackageID(BMSID);

    //        if (dsPackageID != null && dsPackageID.Tables.Count > 0)
    //        {
    //            Package Opackage = new Package();

    //            Opackage.StudentID = studentid;
    //            Opackage.PackageFD_ID = Convert.ToInt64(dsPackageID.Tables[0].Rows[0]["PackageID"].ToString());
    //            int result = Blogic_Package.BAL_Student_TrialPackage_Insert(Opackage);
    //            if (result > 0)
    //            {
    //                string MailContent = DefaultEmailBody("yes");
    //                string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
    //                WebMsg.Show("Congratulation! You got free trial for 7 days");
    //            }
    //            else
    //            {
    //                string MailContent = DefaultEmailBody();
    //                string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
    //            }
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //    }
    //}

    public void InsertIntoStudentPackageDetails(int studentid)
    {
        try
        {
            //Student = new Student();
            BAL_Student = new Student_BLogic();
            Package_BLogic Blogic_Package = new Package_BLogic();
            //Student.bmsid = Convert.ToInt32(ViewState["BMSID"]);
            int     BMSID       = Convert.ToInt32(ViewState["BMSID"]);
            DataSet dsPackageID = BAL_Student.BAL_Student_SelectPackageID(BMSID);

            if (dsPackageID != null && dsPackageID.Tables.Count > 0)
            {
                if (dsPackageID.Tables[0].Rows.Count > 0)
                {
                    Session["dsTrailPAckage"] = dsPackageID.Tables[0];
                    Package Opackage = new Package();

                    Opackage.StudentID    = studentid;
                    Opackage.PackageFD_ID = Convert.ToInt64(dsPackageID.Tables[0].Rows[0]["PackageID"].ToString());
                    int result = Blogic_Package.BAL_Student_TrialPackage_Insert(Opackage);
                    if (result > 0)
                    {
                        string MailContent = DefaultEmailBody("yes");
                        string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
                        //ClientScript.RegisterStartupScript(this.GetType(), "Alert", "alert('Your message.');window.open('AnotherPage.aspx','_self');", true);
                        //WebMsg.Show("Congratulation! You got free trial for 30 days");
                    }
                }
                else
                {
                    string MailContent = DefaultEmailBody();
                    string strResponce = SendMail(txtEmail.Text, "New Registration Details", MailContent);
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 20
0
 protected void Dvw_ParentGuardianDetails_ModeChanging(object sender, DetailsViewModeEventArgs e)
 {
     try
     {
         if (Dvw_ParentGuardianDetails.CurrentMode == DetailsViewMode.Edit)
         {
             Dvw_ParentGuardianDetails.ChangeMode(DetailsViewMode.ReadOnly);
         }
         else
         {
             Dvw_ParentGuardianDetails.ChangeMode(DetailsViewMode.Edit);
         }
         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_ParentGuardianDetails.DataSource = dsSelect;
         Dvw_ParentGuardianDetails.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 21
0
    protected void ibtnDelete_Click(object sender, ImageClickEventArgs e)
    {
        int    CountChecked = 0;
        string StudentIDStr = "";

        foreach (GridViewRow gr in grvStudentdetail.Rows)
        {
            CheckBox chk = new CheckBox();
            chk = (CheckBox)gr.FindControl("chkSelect");
            if (chk.Checked == true)
            {
                if (CountChecked == 0)
                {
                    StudentIDStr = grvStudentdetail.DataKeys[gr.RowIndex]["StudentID"].ToString();
                }
                else
                {
                    StudentIDStr = StudentIDStr + "," + grvStudentdetail.DataKeys[gr.RowIndex]["StudentID"].ToString();
                }
                CountChecked = CountChecked + 1;
            }
        }
        if (CountChecked == 0)
        {
            WebMsg.Show("Please select one record to delete.");
        }
        else
        {
            Student              = new Student();
            BAL_Student          = new Student_BLogic();
            Student.studentidStr = StudentIDStr;
            BAL_Student.BAL_Student_Delete(Student, "Delete");
            ClearControls();
            bindgrvStudentdetail();
        }
    }
Exemplo n.º 22
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)
        {
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int t1 = 0;

        //if (TxtBxCap.Text.Trim() != "")
        //{
        //Captcha1.ValidateCaptcha(TxtBxCap.Text.Trim());
        try
        {
            if (verifyLoginID())
            {
                if (!CheckPasswordComplexcity())
                {
                    WebMsg.Show("Invalid password format, please enter minimum 6 alphanumeric character with @ # $ %. Sign.");
                    return;
                }
                OStudent            = new Student();
                OBAL_Student        = new Student_BLogic();
                OStudent.schoolid   = 1;
                OStudent.divisionid = 1;
                OStudent.bmsid      = int.Parse(ddlBMS.SelectedValue);
                OStudent.loginid    = txtEmail.Text;
                OStudent.password   = txtPassword.Text;
                OStudent.firstname  = txtFirstName.Text;
                OStudent.lastname   = txtLastName.Text;
                OStudent.contactno  = Convert.ToInt64(txtContactNo.Text);
                OStudent.emailid    = txtEmail.Text;

                DateTime fromdatetime;
                if (DateTime.TryParse(txtBirthdate.Text, out fromdatetime))
                {
                    OStudent.dateofbirth = fromdatetime;
                }

                if (ddlGender.SelectedValue == "1")
                {
                    OStudent.gender = 'M';
                }
                else if (ddlGender.SelectedValue == "2")
                {
                    OStudent.gender = 'F';
                }
                OStudent.PaymentType = 'I';
                //if (Captcha1.UserValidated)
                //{
                t1 = OBAL_Student.BAL_Student_Insert_Online(OStudent, "OnlineReg");
                //}
                //else
                //{
                //    WebMsg.Show("Please enter the correct Captcha code");

                //}
                if (t1 > 0)
                {
                    //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "You are successfully registered", false);
                    WebMsg.Show("Your registration has been done successfully.");
                    ClearRegisterControls();
                }
                ClearRegisterControls();
            }
            else
            {
                // WebMsg.Show("LoginID already exist..");
            }
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        finally
        { }
    }
    protected void PromoteToNextYear()
    {
        int studentcnt = 0;

        try
        {
            if (ddlnextyearBMS.SelectedIndex > 0 && ddldivision.SelectedIndex > 0)
            {
                Student_BLogic oStudent_Blogic = new Student_BLogic();
                DataSet        ds    = new DataSet();
                DataTable      table = new DataTable();
                table = (DataTable)ViewState["StudentList"];
                foreach (GridViewRow gvrow in gvstudentList.Rows)
                {
                    CheckBox chk = (CheckBox)gvrow.FindControl("chk");
                    if (chk != null & chk.Checked)
                    {
                        studentcnt = studentcnt + 1;
                        DataRow[] result               = table.Select("Studentid=" + gvstudentList.DataKeys[gvrow.RowIndex].Value.ToString());
                        long      studentid            = Convert.ToInt64(result[0].ItemArray[0].ToString());
                        long      schoolid             = Convert.ToInt64(result[0].ItemArray[1].ToString());
                        int       Roleid               = Convert.ToInt32(result[0].ItemArray[4].ToString());
                        string    GrNo                 = result[0].ItemArray[14].ToString();
                        string    previousacedemicyear = result[0].ItemArray[19].ToString();
                        //string currentacedemicyear = ddlAcademicYear.SelectedItem.ToString();
                        string currentacedemicyear = lblnextacedemicyear.Text.Trim();
                        int    PreviousRollNo      = 0;
                        int    CurrnetRollNo       = 0;
                        if (result[0].ItemArray[10].ToString() != string.Empty)
                        {
                            PreviousRollNo = Convert.ToInt32(result[0].ItemArray[10].ToString());
                            // CurrnetRollNo = Convert.ToInt32(((TextBox)gvstudentList.Rows[gvrow.RowIndex].Cells[2].FindControl("txtrollno")).Text);
                            CurrnetRollNo = PreviousRollNo;
                        }

                        long   PreviousBMSID = Convert.ToInt64(result[0].ItemArray[2].ToString());
                        long   CurrentBMSID  = Convert.ToInt64(ddlnextyearBMS.SelectedValue.ToString());
                        int    PreviousDivID = Convert.ToInt32(result[0].ItemArray[3].ToString());
                        int    CurrentDivID  = Convert.ToInt32(ddldivision.SelectedValue.ToString());
                        long   CreatedBy     = Convert.ToInt64(AppSessions.EmpolyeeID);
                        string status        = "Promoted";

                        oStudent_Blogic.BAL_Student_PromoteNextYear(studentid, schoolid, Roleid, GrNo, previousacedemicyear, currentacedemicyear, PreviousRollNo, CurrnetRollNo,
                                                                    PreviousBMSID, CurrentBMSID, PreviousDivID, CurrentDivID, CreatedBy, status);
                        btnupdate.Visible = true;
                    }
                }

                FillGridDetails();
                FillPromotedStudentList();
                if (studentcnt <= 0)
                {
                    WebMsg.Show("please select atleast one student");
                }
                else
                {
                    WebMsg.Show("Student promted to " + ddlnextyearBMS.SelectedItem.ToString() + " Sucessfully");
                    //ddlnextyearBMS.SelectedIndex = 0;
                    //ddldivision.SelectedIndex = 0;
                    //ddlAcademicYear.SelectedIndex = 0;
                    //lblNoOfStudent.Text = "";
                    //divpromot.Visible = false;
                }
            }
            else
            {
                WebMsg.Show("Please select Next Year BMS , Division and Acedemic year....");
            }
        }
        catch (Exception ex)
        {
        }
    }
Exemplo n.º 25
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (AppSessions.RoleID == 4)//student
            {
                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 = TxtOldPassword.Text;
                if (!string.IsNullOrEmpty(TxtOldPassword.Text))
                {
                    dtLogin   = obj_BAL_SYS_Role.BAL_SYS_Student_Login(obj_SYS_Role);
                    LoginInfo = dtLogin.Tables[0];

                    if (LoginInfo.Rows.Count > 0 && LoginInfo != null)
                    {
                        oStudent.password = TxtNewPassword.Text;
                    }
                    else
                    {
                        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    = TxtNewPassword.Text;
                PEmployee.modifiedby  = AppSessions.EmpolyeeID;
                BEmployee.BAL_Employee_Password_Update(PEmployee);
            }
            oStudent    = new Student();
            BAL_Student = new Student_BLogic();

            string IFormat = "dd-MMM-yyyy";
            oStudent.studentid = AppSessions.StudentID;
            oStudent.firstname = txtAddFirstName.Text;
            //  oStudent.middlename = txtAddMiddleName.Text;
            oStudent.lastname = txtAddLastName.Text;
            if (rlstAddGender.SelectedIndex == (int)EnumFile.AssignValue.Zero)
            {
                oStudent.gender = 'M';
            }
            else if (rlstAddGender.SelectedIndex == (int)EnumFile.AssignValue.One)
            {
                oStudent.gender = 'F';
            }
            if (!string.IsNullOrEmpty(txtAddDOB.Text))

            {
                oStudent.dateofbirth = Convert.ToDateTime(DateTime.Parse(txtAddDOB.Text).ToString(IFormat));
            }
            //else
            //{

            //    oStudent.dateofbirth = null;


            //}
            //oStudent.bloodgroup = ""; //txtAddBloodGroup.Text;
            if (!string.IsNullOrEmpty(txtAddPermanentAddress.Text))
            {
                oStudent.Address = txtAddPermanentAddress.Text;
            }
            if (!string.IsNullOrEmpty(txtAddEmail.Text))
            {
                oStudent.emailid = txtAddEmail.Text;
            }
            if (!string.IsNullOrEmpty(txtAddContactNumber.Text))
            {
                oStudent.contactno = Convert.ToInt64(txtAddContactNumber.Text);
            }
            if (!string.IsNullOrEmpty(txtAddMobileNumber.Text))
            {
                oStudent.mobileno = Convert.ToInt64(txtAddMobileNumber.Text);
            }

            bool Status = this.BAL_Student.BAL_Student_UpdateProfile(oStudent);

            if (Status)
            {
                ResetControl();
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Update profile sucessfully');", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alertMessage", "alert('Update profile Failed');", true);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
        }
    }
Exemplo n.º 26
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int t1 = 0;

        //if (TxtBxCap.Text.Trim() != "")
        //{
        //Captcha1.ValidateCaptcha(TxtBxCap.Text.Trim());
        try
        {
            if (verifyLoginID())
            {
                //if (!CheckPasswordComplexcity())
                //{
                //    WebMsg.Show("Invalid password format, please enter minimum 6 alphanumeric character with @ # $ %. Sign.");
                //    return;
                //}

                /*if (txtPassword.Text.Length < 6)
                 * {
                 *  WebMsg.Show("Minimum 6 character required in password");
                 *  return;
                 * }*/
                Student            = new Student();
                BAL_Student        = new Student_BLogic();
                Student.schoolid   = GetDefaultSchoolID();
                Student.divisionid = 1;
                Student.bmsid      = (int)ViewState["BMSID"];
                //ViewState["BMSID"] = int.Parse(ddlBMS.SelectedValue);
                Student.loginid = txtEmail.Text;
                //Student.password = txtPassword.Text;
                Student.password   = ViewState["strpassword"].ToString();
                Student.firstname  = txtFirstName.Text;
                Student.lastname   = txtLastName.Text;
                Student.schoolname = txtSchoolname.Text;
                //Student.contactno = Convert.ToInt64(txtContactNo.Text);
                Student.mobilenostring = txtContactNo.Text;
                Student.emailid        = txtEmail.Text;

                //DateTime fromdatetime;

                //string d = txtBirthdate.Text;
                //d = d.Replace("-", "/");
                //DateTime dt;
                //try
                //{
                //    dt = DateTime.ParseExact(d, "d/M/yyyy", CultureInfo.InvariantCulture);
                //}
                //catch (Exception)
                //{
                //    dt = DateTime.ParseExact(d, "M/d/yyyy", CultureInfo.InvariantCulture); ;
                //}

                //= DateTime.ParseExact(d, "d/M/yyyy", CultureInfo.InvariantCulture);
                // for both "1/1/2000" or "25/1/2000" formats
                //string newString = dt.ToString("dd/MMM/yyyy");
                //Student.dateofbirth = dt;
                //if (DateTime.TryParse(txtBirthdate.Text, out fromdatetime))
                //{
                //    Student.dateofbirth = fromdatetime;
                //}

                //if (RlstGender.SelectedValue == "1")
                //{
                //    Student.gender = 'M';
                //}
                //else if (RlstGender.SelectedValue == "2")
                //{
                //    Student.gender = 'F';
                //}
                Student.PaymentType = 'I';
                //if (Captcha1.UserValidated)
                //{
                t1 = BAL_Student.BAL_Student_Insert_Online(Student, "OnlineReg");
                InsertIntoStudentPackageDetails(t1);
                //}
                //else
                //{
                //    WebMsg.Show("Please enter the correct Captcha code");

                //}
                if (t1 > 0)
                {
                    //ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "You are successfully registered", false);
                    //string MailContent = DefaultEmailBody();
                    //string strResponce = SendMail(txtEmail.Text, "New Registration Details:", MailContent);

                    //WebMsg.Show("Your registration was successfull. We have sent your Login details on your registered Email Address.");
                    // ShowMessage("Your registration was successfull. We have sent your Login details on your registered Email Address.");
                    RedirectToDashboard();
                    //AppSessions.StudentID = t1;
                    //AppSessions.BMSID = (int)ViewState["BMSID"];
                    //Response.Redirect("~/Dashboard/StudentDashboard.aspx", false);



                    //WebMsg.Show(strResponce);
                    //ClearRegisterControls();
                    //Response.Redirect("Login.aspx");
                }
                ClearRegisterControls();
            }
            else
            {
                WebMsg.Show("LoginID already exist..");
            }
        }
        catch (FormatException fe)
        {
            //WebMsg.Show("Invalid birthdate");
            //txtBirthdate.Focus();
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        finally
        { }

        //}
        //else
        //{
        //    WebMsg.Show("Please enter code");

        //}
    }
Exemplo n.º 27
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int t1 = 0;

        try
        {
            if (verifyLoginID())
            {
                Student            = new Student();
                BAL_Student        = new Student_BLogic();
                Student.bmsid      = int.Parse(ddlBMSAdd.SelectedValue);
                Student.loginid    = txtLoginID.Text;
                Student.password   = txtPassword.Text;
                Student.firstname  = txtFirstName.Text;
                Student.middlename = txtMiddleName.Text;
                Student.lastname   = txtLastName.Text;
                Student.contactno  = Convert.ToInt64(txtContactNo.Text);
                Student.mobileno   = Convert.ToInt64(txtMobileNo.Text);
                Student.emailid    = txtEmailID.Text;
                //Student.dateofbirth = Convert.ToDateTime(txtDateOfBirth.Text);
                Student.Address = txtAddress.Text;
                if (rdbGenderList.SelectedValue == "0")
                {
                    Student.gender = 'M';
                }
                else if (rdbGenderList.SelectedValue == "1")
                {
                    Student.gender = 'F';
                }

                if (rdbCountry.SelectedValue == "0")
                {
                    Student.PaymentType = 'I';
                }
                else if (rdbCountry.SelectedValue == "1")
                {
                    Student.PaymentType = 'O';
                }


                t1 = BAL_Student.BAL_Student_Insert_Online(Student, "OnlineReg");
                if (t1 > 0)
                {
                    ScriptManager.RegisterStartupScript(this.Page, GetType(), "Message", "You are successfully registered", false);
                    //WebMsg.Show("You are successfully registered");
                    ClearControls();
                    Response.Redirect("../Default.aspx");
                }
                ClearControls();
            }
            else
            {
                WebMsg.Show("LoginID already exist..");
            }
            //WebMsg.Show("Registration succeed");
            //Response.Redirect("~/Default.aspx");
        }
        catch (Exception ex)
        {
            WebMsg.Show(ex.Message);
        }
        finally
        { }
    }
Exemplo n.º 28
0
    private void bindgrvStudentdetail()
    {
        Student     = new Student();
        BAL_Student = new Student_BLogic();
        DataSet dsSelect = new DataSet();

        dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectAll");
        if (dsSelect.Tables.Count > 0)
        {
            string Condition = string.Empty;
            if (ltrlSchoolIDSearch.Text != string.Empty)
            {
                Condition = "SchoolID=" + ltrlSchoolIDSearch.Text;
            }

            if (ddlBMSSearch.SelectedValue != "0")
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "BMSID=" + ddlBMSSearch.SelectedValue;
                }
                else
                {
                    Condition = "BMSID=" + ddlBMSSearch.SelectedValue;
                }
            }

            if (ddlDivisionSearch.SelectedValue != "0")
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "DivisionID=" + ddlDivisionSearch.SelectedValue;
                }
                else
                {
                    Condition = "DivisionID=" + ddlDivisionSearch.SelectedValue;
                }
            }


            if (txtFirstNameSearch.Text != string.Empty)
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "FirstName=" + txtFirstNameSearch.Text;
                }
                else
                {
                    Condition = "FirstName=" + txtFirstNameSearch.Text;
                }
            }

            if (txtRollNoSearch.Text != string.Empty)
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "RollNo=" + txtRollNoSearch.Text;
                }
                else
                {
                    Condition = "RollNo=" + txtRollNoSearch.Text;
                }
            }

            //if (txtDateOfBirthSearch.Text != string.Empty)
            //{
            //    if (Condition != string.Empty)
            //    {
            //        Condition = Condition + " And ";
            //        Condition = Condition + "DateOfBirth=" + txtDateOfBirthSearch.Text;
            //    }
            //    else
            //    {
            //        Condition = "DateOfBirth=" + txtDateOfBirthSearch.Text;
            //    }
            //}

            if (rdbListGenderSearch.SelectedValue == "0")
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "Gender='" + "M'";
                }
                else
                {
                    Condition = "Gender='" + "M'";
                }
            }
            else if (rdbListGenderSearch.SelectedValue == "1")
            {
                if (Condition != string.Empty)
                {
                    Condition = Condition + " And ";
                    Condition = Condition + "Gender='" + "F'";
                }
                else
                {
                    Condition = "Gender='" + "F'";
                }
            }


            //if (rlstAddActive.SelectedValue == "1")
            //{
            //    if (Condition != string.Empty)
            //    {
            //        Condition = Condition + " And ";
            //        Condition = Condition + "IsActive=" + true;
            //    }
            //    else
            //    {
            //        Condition = "IsActive=" + true;
            //    }
            //}
            //else if (rlstAddActive.SelectedValue == "0")
            //{
            //    if (Condition != string.Empty)
            //    {
            //        Condition = Condition + " And ";
            //        Condition = Condition + "IsActive=" + false;
            //    }
            //    else
            //    {
            //        Condition = "IsActive=" + false;
            //    }
            //}

            DataView dv = new DataView(dsSelect.Tables[0]);
            dv.RowFilter = Condition;

            DataSet FilteredData = new DataSet();
            FilteredData.Tables.Add(dv.ToTable());

            GridViewOperations GrvOperation = new GridViewOperations();
            GrvOperation.BindGridWithSorting(grvStudentdetail, FilteredData, this.SortField, this.SortDirection);
        }
        else
        {
            grvStudentdetail.DataSource = null;
            grvStudentdetail.DataBind();
        }
    }