private void SaveAdmissionDetails(string strAction)
        {
            try
            {
                EWA_Admission objEWA = new EWA_Admission();
                BL_Admission  objBAL = new BL_Admission();

                // Get College ID And Name From Session

                // Panel 1

                objEWA.TransationAction = strAction.ToString();
                objEWA.AdmissionID      = txtFormNo.Text.ToString();

                objEWA.AdmissionDate = txtAdmissionDate.Text;
                objEWA.OrgID         = Convert.ToInt32(DDL_SelectCollege.SelectedValue);

                objEWA.GRNo    = txtGRNo.Text;
                objEWA.AdharNo = txtAdhar.Text;

                objEWA.FirstName  = txtFirstName.Text.Trim();
                objEWA.MiddleName = txtMiddleName.Text.Trim();
                objEWA.LastName   = txtLastName.Text.Trim();

                objEWA.Course        = ddlCourse.SelectedValue.Trim().Trim();
                objEWA.Branch_ID     = Convert.ToInt32(ddlBranch.SelectedValue);
                objEWA.Class1        = ddlClass.SelectedValue.Trim().Trim();
                objEWA.BirthDate     = txtBirthDate.Text;
                objEWA.BirthPlace    = txtBirthPlace.Text.Trim();
                objEWA.Country1      = ddlCountry.SelectedValue.ToString();
                objEWA.State1        = ddlState.SelectedValue.ToString();
                objEWA.District1     = ddlDistrict.SelectedValue.ToString();
                objEWA.Taluka1       = txtTal.Text.Trim();
                objEWA.City1         = txtCity.Text.Trim();
                objEWA.LastInstitute = txtLastSchool.Text.Trim();
                objEWA.Gender1       = rbtGender.SelectedItem.ToString();
                objEWA.BloodGroup    = ddlBloodGroup.SelectedValue.ToString();
                objEWA.Religion1     = ddlReligion.SelectedValue.ToString();
                objEWA.Subcaste      = txtSubcaste.Text;
                objEWA.MotherTongue  = txtMotherTongue.Text;
                objEWA.Nationality1  = ddlNationality.SelectedValue.ToString();
                objEWA.AddressLine1  = txtAddress1.Text.Trim();
                objEWA.AddressLine2  = txtAddress2.Text.Trim();
                objEWA.FeesCategory  = ddlFeeCategory.SelectedValue.ToString().Trim();
                objEWA.CasteCategory = ddlCaste.SelectedValue.Trim();

                objEWA.ParentName = txtFather.Text.Trim();
                objEWA.MotherName = txtMother.Text.Trim();

                objEWA.ParentMobile = txtFatherMobile.Text.Trim();
                objEWA.ParentEmail  = txtFatherEmail.Text.Trim();

                objEWA.Parent_Education  = txtFatherEdu.Text.Trim();
                objEWA.Parent_Occupation = txtFatherOccu.Text.Trim();

                objEWA.MobileNo      = txtFatherMobile.Text.Trim();
                objEWA.E_Mail        = txtFatherEmail.Text.Trim();
                objEWA.AdmissionYear = System.DateTime.Now.ToString("yyyy");
                objEWA.GuardianName  = txtMother.Text.ToString();
                objEWA.Relation1     = "Mother";

                objEWA.GuardianMobile = txtMotherMobile.Text.Trim();
                objEWA.GuardianEmail  = txtMotherEmail.Text.Trim();

                objEWA.Guardian_Education  = txtMotherEdu.Text.Trim();
                objEWA.Guardian_Occupation = txtMotherOccu.Text.Trim();

                // Panel Parent information

                objEWA.StudentUserName = txtFormNo.Text.Trim();

                objEWA.StudentPassword = txtFormNo.Text.Trim();

                // Iamage Store
                int    length       = 0;
                byte[] imgPhotobyte = null;

                if (fileupload_StudentPhoto.HasFile)
                {
                    length       = fileupload_StudentPhoto.PostedFile.ContentLength;
                    imgPhotobyte = new byte[length];
                    HttpPostedFile img1 = fileupload_StudentPhoto.PostedFile;
                    img1.InputStream.Read(imgPhotobyte, 0, length);
                    ViewState["StudentPhoto"] = imgPhotobyte;
                }
                GridToDatatable();
                objEWA.dtDocuments  = ViewState["tempDocs"] as DataTable;
                objEWA.StudentPhoto = (byte[])ViewState["StudentPhoto"];

                objEWA.Status = "Pending";

                if (Session["GRNO"] != null)
                {
                    if (Session["GRNO"].ToString() == txtGRNo.Text)
                    {
                        //msgBox.ShowMessage("Record already present !!!", "Information", UserControls.MessageBox.MessageStyle.Successfull);
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('Form Submitted Successfully')", true);
                        ClearControls();
                        return;
                    }
                }
                else
                {
                    Session["GRNO"] = txtGRNo.Text;
                }

                int flag = objBAL.InsertInto(objEWA);

                if (flag > 0)
                {
                    if (strAction == "Save")
                    {
                        //string strSMS = null;
                        //string strEmail = null;

                        // strEmail = SendEmails();
                        msgBox.ShowMessage("Form Submitted  Successfully", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        print();
                        Button1.Visible = true;
                        btnSave.Visible = false;

                        // msgBox.ShowMessage(strSMS, "Saved", UserControls.MessageBox.MessageStyle.Successfull);

                        // msgBox.ShowMessage(strEmail, "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        //  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Form Sumitted  Successfully Check Your Mail  !!!')", true);

                        //  Response.Redirect("~/College_Home.aspx");
                        ClearControls();
                        // Response.Redirect("~/Forms/Admin/College_Home.aspx");
                    }
                    else if (strAction == "Update")
                    {
                        msgBox.ShowMessage("Record Updated Successfully !!!", "Updated", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    else if (strAction == "Delete")
                    {
                        msgBox.ShowMessage("Record Deleted Successfully !!!", "Deleted", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                }
            }
            catch (Exception)
            {
                // throw;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (TxtFirstName.Text == "" || TxtFirstName.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Child First Name')", true);
                TxtFirstName.Focus();
                return;
            }
            if (TxtLastName.Text == "" || TxtLastName.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Child Last Name')", true);
                TxtLastName.Focus();
                return;
            }

            if (TxtMiddleName.Text == "" || TxtMiddleName.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Child Middle Name')", true);
                TxtMiddleName.Focus();
                return;
            }
            if (TxtDOB.Text == "" || TxtDOB.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Child Date Of Birth')", true);
                TxtMiddleName.Focus();
                return;
            }
            if (TxtAdmissionDate.Text == "" || TxtAdmissionDate.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Enquiry Date for Admission ')", true);
                TxtAdmissionDate.Focus();
                return;
            }
            if (TxtAddress.Text == "" || TxtAddress.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Address')", true);
                TxtAddress.Focus();
                return;
            }
            if (TxtStandard.Text == "" || TxtStandard.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Child Standard')", true);
                TxtStandard.Focus();
                return;
            }
            if (TxtWhatsupNumber.Text == "" || TxtWhatsupNumber.Text == string.Empty)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Information", "alert('please Enter Whats app Number For Contact')", true);
                TxtWhatsupNumber.Focus();
                return;
            }


            EWA_Admission objEWA = new EWA_Admission();
            BL_Admission  objBAL = new BL_Admission();


            objEWA.FirstName       = TxtFirstName.Text;
            objEWA.LastName        = TxtLastName.Text;
            objEWA.MiddleName      = TxtMiddleName.Text;
            objEWA.ParentEmail     = TxtEmail.Text;
            objEWA.MobileNo        = TxtWhatsupNumber.Text;
            objEWA.BirthDate       = TxtDOB.Text;
            objEWA.ApplicationDate = TxtAdmissionDate.Text;
            objEWA.Branch1         = TxtStandard.Text;
            objEWA.AddressLine1    = TxtAddress.Text;
            int flag = objBAL.InsertEnquiryInfo(objEWA);

            if (flag > 0)
            {
                Clear();
                msgBox.ShowMessage("Form Submitted  Successfully", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
            }
            else
            {
                msgBox.ShowMessage("Some Problem Occured....", "Critical", UserControls.MessageBox.MessageStyle.Critical);
            }
        }
        private void SaveAdmissionDetails(string strAction)
        {
            try
            {
                EWA_Admission objEWA = new EWA_Admission();
                BL_Admission  objBAL = new BL_Admission();

                // Get College ID And Name From Session

                // Panel 1

                objEWA.TransationAction = strAction.ToString();
                objEWA.AdmissionID      = lbl_ApplicationId.Text.ToString();

                //System.Data.SqlTypes.SqlDateTime AdmissionDate = System.Data.SqlTypes.SqlDateTime.Parse(lblAdmissionDate.Text);
                DateTime datetime1 = Convert.ToDateTime(lblAdmissionDate.Text);

                objEWA.AdmissionDate = datetime1.ToString();
                objEWA.OrgID         = Convert.ToInt32(Session["OrgId"]);

                objEWA.AdmissionType = ddl_AdmissionType.SelectedValue.ToString().Trim();
                objEWA.Course        = ddl_Course.SelectedValue.Trim().Trim();
                objEWA.Branch_ID     = Convert.ToInt32(ddl_Branch.SelectedValue);
                objEWA.Class1        = ddl_Class.SelectedValue.Trim().Trim();

                objEWA.PreviousRollNo = txt_PreviousRollNo.Text.Trim();
                objEWA.FeesCategory   = ddl_FeesCategory.SelectedItem.ToString().Trim();
                objEWA.CasteCategory  = ddl_CasteCategory.SelectedValue.Trim();

                // Panel 2

                objEWA.FirstName  = txt_FirstName.Text.Trim();
                objEWA.MiddleName = txt_MiddleName.Text.Trim();
                objEWA.LastName   = txt_LastName.Text.Trim();
                objEWA.Gender1    = rbt_Gender.SelectedItem.ToString();



                System.Data.SqlTypes.SqlDateTime birthdate = System.Data.SqlTypes.SqlDateTime.Parse(txt_BirthDate.Text);

                // DateTime birthdate = DateTime.ParseExact(txt_BirthDate.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture);


                DateTime datetime = Convert.ToDateTime(txt_BirthDate.Text);
                objEWA.BirthDate = datetime.ToString();



                objEWA.BirthPlace   = txt_BirthPlace.Text.Trim();
                objEWA.AddressLine1 = txt_Address1.Text.Trim();
                objEWA.AddressLine2 = txt_Address2.Text.Trim();
                objEWA.Country1     = ddl_Country.SelectedValue.ToString();
                objEWA.State1       = ddl_State.SelectedValue.ToString();
                objEWA.District1    = ddl_District.SelectedValue.ToString();
                objEWA.Taluka1      = TxtTaluka.Text.Trim();
                objEWA.City1        = TxtCity.Text.Trim();
                if (txt_Pincode.Text != string.Empty)
                {
                    objEWA.PinCode1 = Convert.ToInt32(txt_Pincode.Text);
                }

                objEWA.MarriedStatus = rbt_MarriedStatus.SelectedValue.ToString();
                objEWA.MobileNo      = txt_PersonalMobile.Text.Trim();
                objEWA.E_Mail        = txt_Email.Text.Trim();
                objEWA.Nationality1  = DDL_Nationality.SelectedValue.ToString();

                objEWA.BloodGroup    = ddl_BloodGroup.SelectedValue.ToString();
                objEWA.Handicaped    = ddl_Handicap.SelectedValue.ToString();
                objEWA.Conveyanceuse = ddl_ConveyanceUse.SelectedValue.ToString();
                objEWA.Religion1     = ddl_Religion.SelectedValue.ToString();
                objEWA.Caste1        = ddl_Caste.SelectedItem.ToString();
                objEWA.Subcaste      = txtSubcast.Text.Trim();


                objEWA.SportId = DDL_Sports.SelectedValue.ToString();
                objEWA.AdharNo = DDL_SportLevel.SelectedItem.ToString();

                // Panel 3
                objEWA.GuardianName     = txt_GuardianName.Text.ToString();
                objEWA.Relation1        = ddl_Relation.SelectedItem.ToString();
                objEWA.GuardianAddress1 = txt_GuardianAddress1.Text.ToString().Trim();
                objEWA.GuardianAddress2 = txt_GuardianAddress2.Text.ToString().Trim();
                objEWA.GuardianCountry  = ddl_GuardianCountry.SelectedItem.ToString().Trim();
                objEWA.GuardianState    = ddl_GuardianState.SelectedItem.ToString();
                objEWA.GuardianDistrict = ddl_GuardianDistrict.SelectedItem.ToString();
                objEWA.GuardianTaluka   = txtGuardianTaluka.Text.ToString().Trim();
                objEWA.GuardianCity     = txtGuardianCity.Text;
                if (txt_GuardianPincode.Text != string.Empty)
                {
                    objEWA.GuardianPinCode = Convert.ToInt32(txt_GuardianPincode.Text);
                }

                objEWA.GuardianMobile = txt_GuardianMobile.Text.Trim();
                objEWA.GuardianEmail  = txt_GuardianEmail.Text.Trim();

                // Panel Parent information

                objEWA.ParentName     = txt_ParentName.Text.Trim();
                objEWA.MotherName     = txt_MotherName.Text.Trim();
                objEWA.ParentAddress1 = txt_ParentAddress1.Text.Trim();
                objEWA.ParentAddress2 = txt_ParentAddress2.Text.Trim();
                objEWA.ParentCountry  = ddl_ParentCountry.SelectedItem.ToString();
                objEWA.ParentState    = ddl_ParentState.SelectedItem.ToString();
                objEWA.ParentTaluka   = txt_ParentCity.Text.ToString().Trim();
                if (txt_ParentPincode.Text != string.Empty)
                {
                    objEWA.ParentPinCode = Convert.ToInt32(txt_ParentPincode.Text);
                }

                objEWA.ParentMobile = txt_PersonalMobile.Text.Trim();
                objEWA.ParentEmail  = txt_ParentEmail.Text.Trim();


                // Panel Last Instituter information

                objEWA.LastClass     = txt_LastAttendedClass.Text.Trim();
                objEWA.ResidentType  = ddl_ResidentType.SelectedItem.ToString();
                objEWA.LastInstitute = txt_LastAttendedClass.Text.Trim();

                objEWA.PassingMonth = ddl_LastExamPassingMonth.SelectedValue.ToString();
                objEWA.PassingYear  = ddl_LastExamPassingYear.SelectedItem.ToString();
                objEWA.Result1      = txt_Result.Text.Trim();
                objEWA.Percentage1  = txt_Percentage.Text.Trim();

                objEWA.Gap1 = ddl_Gap.SelectedItem.ToString();
                objEWA.TcNo = txt_TcNo.Text.Trim();

                objEWA.BankName = txtBankName.Text.Trim();
                if (txt_AccountNo.Text != string.Empty)
                {
                    objEWA.AccountNo = txt_AccountNo.Text.ToString().Trim();
                }

                objEWA.Branch1  = txt_BranchName.Text.Trim();
                objEWA.IFSCCode = txt_IFSCCode.Text.Trim();



                objEWA.StudentUserName = txt_UserName.Text.Trim();

                objEWA.StudentPassword = txt_Password.Text.Trim();

                // Iamage Store
                int    length       = 0;
                byte[] imgSignbyte  = null;
                byte[] imgPhotobyte = null;

                if (fileupload_StudentPhoto.HasFile)
                {
                    length       = fileupload_StudentPhoto.PostedFile.ContentLength;
                    imgPhotobyte = new byte[length];
                    HttpPostedFile img1 = fileupload_StudentPhoto.PostedFile;
                    img1.InputStream.Read(imgPhotobyte, 0, length);
                    ViewState["StudentPhoto"] = imgPhotobyte;
                }

                objEWA.StudentPhoto = (byte[])ViewState["StudentPhoto"];;

                if (fileupload_StudentSign.HasFile)
                {
                    length      = fileupload_StudentSign.PostedFile.ContentLength;
                    imgSignbyte = new byte[length];
                    HttpPostedFile img1 = fileupload_StudentSign.PostedFile;
                    img1.InputStream.Read(imgSignbyte, 0, length);
                    ViewState["StudentSign"] = imgSignbyte;
                }
                //objEWA.StudentSign = (byte[])ViewState["StudentSign"];


                objEWA.StudentUserName = txt_UserName.Text;

                objEWA.StudentPassword = txt_Password.Text;

                objEWA.Status = "Pending";

                int flag = objBAL.InsertInto(objEWA);

                if (flag > 0)
                {
                    if (strAction == "Save")
                    {
                        msgBox.ShowMessage("Form Sumitted  Successfully Check Your Mail  !!!", "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        string strSMS   = null;
                        string strEmail = null;

                        msgBox.ShowMessage(strSMS, "Saved", UserControls.MessageBox.MessageStyle.Successfull);
                        strEmail = SendEmails();
                        msgBox.ShowMessage(strEmail, "Saved", UserControls.MessageBox.MessageStyle.Successfull);

                        Response.Redirect("~/College_Home.aspx");
                    }
                    else if (strAction == "Update")
                    {
                        msgBox.ShowMessage("Record Updated Successfully !!!", "Updated", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                    else if (strAction == "Delete")
                    {
                        msgBox.ShowMessage("Record Deleted Successfully !!!", "Deleted", UserControls.MessageBox.MessageStyle.Successfull);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void UpgradeAcademicyear(string strAction)
        {
            try
            {
                EWA_Admission objEWA      = new EWA_Admission();
                BL_Admission  objBAL      = new BL_Admission();
                int           Userid      = Convert.ToInt32(Session["UserCode"]);
                var           count       = GrdStudent.Rows.Count;
                string[]      AdmissionID = new string[count];
                int           i           = 0;
                int           oldOrgId    = Convert.ToInt32(Session["OrgId"].ToString());
                foreach (GridViewRow gvrow in GrdStudent.Rows)
                {
                    CheckBox chk = (CheckBox)gvrow.FindControl("chkbox");
                    if (chk != null && chk.Checked)
                    {
                        Label  addmissionId    = (Label)gvrow.FindControl("lbladdmissionid");
                        Label  UserCode        = (Label)gvrow.FindControl("lblUserCode");
                        Label  Branch          = (Label)gvrow.FindControl("lblBranch");
                        Label  Class           = (Label)gvrow.FindControl("LblClass");
                        Label  AcademicYear    = (Label)gvrow.FindControl("LblAcademicID");
                        string _drpcourse      = drpcourse.SelectedValue;
                        string _drpbranch      = drpbranch.SelectedValue;
                        string _drpclass       = drpclass.SelectedValue;
                        float  castcatergoryid = db.getDb_Value(" select feescategory FROM  tbladmissiondetails WHERE   admissionid='" + addmissionId.Text + "' and OrgID='" + oldOrgId + "' ");
                        float  AcademicYearId  = db.getDb_Value("SELECT AcademicYearId FROM tblStudent WHERE (UserCode = '" + UserCode.Text + "') and OrgID='" + oldOrgId + "' ");

                        float    fessid        = 0;
                        float    FeesDetailsid = 0;
                        string   FeesParticular;
                        float    TotalAmt    = 0;
                        DateTime currentDate = System.DateTime.Now.Date;
                        fessid = db.getDb_Value("SELECT  top(1) dbo.tblFeesDetails.FeesId FROM  dbo.tblFees INNER JOIN  dbo.tblFeesDetails ON dbo.tblFees.FeesId = dbo.tblFeesDetails.FeesId  where AcademicYearId='" + drpacedemicyear1.SelectedValue + "' and CourseId='" + _drpcourse + "' and  BranchId='" + _drpbranch + "' and  ClassId='" + _drpclass + "' and CasteCategoryId='" + castcatergoryid.ToString() + "' ");

                        FeesDetailsid = db.getDb_Value("SELECT top(1) dbo.tblFeesDetails.FeesDetailsId FROM  dbo.tblFees INNER JOIN  dbo.tblFeesDetails ON dbo.tblFees.FeesId = dbo.tblFeesDetails.FeesId  where AcademicYearId='" + drpacedemicyear1.SelectedValue + "' and CourseId='" + _drpcourse + "' and  BranchId='" + _drpbranch + "' and  ClassId='" + _drpclass + "' and CasteCategoryId='" + castcatergoryid.ToString() + "' ");
                        if (fessid > 0)
                        {
                            DataTable dt = new DataTable();
                            cn.Close();
                            cn.Open();
                            using (SqlCommand cmd = new SqlCommand("SELECT top(1) dbo.tblFeesDetails.Particular FROM  dbo.tblFees INNER JOIN  dbo.tblFeesDetails ON dbo.tblFees.FeesId = dbo.tblFeesDetails.FeesId  where AcademicYearId='" + drpacedemicyear1.SelectedValue + "' and CourseId='" + _drpcourse + "' and  BranchId='" + _drpbranch + "' and  ClassId='" + _drpclass + "'  and CasteCategoryId='" + castcatergoryid.ToString() + "'", cn))
                            {
                                cmd.CommandType = CommandType.Text;
                                cmd.Connection  = cn;
                                SqlDataReader dr = cmd.ExecuteReader();
                                dt.Load(dr);
                                FeesParticular = dt.Rows[0]["Particular"].ToString();
                            }

                            TotalAmt           = db.getDb_Value("select sum(Amount) as TotalAmount from tblFeesDetails where FeesId='" + Convert.ToInt32(fessid) + "' ");
                            Shwmsg.Visible     = false;
                            BtnAddFees.Visible = false;
                        }
                        else
                        {
                            Shwmsg.Visible     = true;
                            Shwmsg.Text        = "Please Add Fees For This Class";
                            BtnAddFees.Visible = true;
                            return;
                        }
                        float reciptno = db.getDb_Value("SELECT Max(ReceiptNo)  FROM tblStudentFeesPaid where StudentId='" + UserCode.Text + "'");
                        db.insert("update tblAdmissionDetails set CourseId='" + _drpcourse + "', BranchId='" + _drpbranch + "', ClassId='" + _drpclass + "' where AdmissionID='" + addmissionId.Text + "' ");
                        db.insert("update tblStudent_Details set AcademicYearId=" + drpacedemicyear1.SelectedValue + " where AdmissionID='" + addmissionId.Text + "' ");
                        db.insert("update  [dbo].[tblStudentFeesPaid] set StudentId='" + UserCode.Text + "',FeesId='" + Convert.ToInt32(fessid) + "',TotalAmount='" + Convert.ToInt32(TotalAmt) + "',PaidAmount=0,PendingAmount='" + Convert.ToInt32(TotalAmt) + "',UserId= '" + Convert.ToInt32(Userid) + "',TransDate= '" + currentDate + "',remark= '" + FeesParticular.ToString() + "',FeesDetailsId= '" + Convert.ToInt32(FeesDetailsid) + "' where  StudentId	='" + UserCode.Text + "' and GroupReceiptNo=0 ");
                        objEWA.OrgID          = Convert.ToInt32(Session["OrgId"].ToString());
                        objEWA.student_Code   = UserCode.Text;
                        objEWA.CourseId       = ddlCourse.SelectedValue;
                        objEWA.Branch_ID      = Convert.ToInt32(Branch.Text);
                        objEWA.ClassId        = Class.Text;
                        objEWA.AcademicYearID = AcademicYear.Text;
                        objEWA.PinCode1       = Convert.ToInt32(Userid);
                        string StatusSave = objBAL.SaveStudentFeesHistrory(objEWA);
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('Student Promoted Successfully ..!!');window.location='NextAcademicYearSpecial.aspx';", true);
                    }
                }

                dvBranch              = null;
                dvClass               = null;
                dvStudentData         = null;
                dvdrpBranch           = null;
                dvdrpClass            = null;
                dvdrpStudentData      = null;
                GrdStudent.DataSource = null;
                GrdStudent.DataBind();
                BindCourse();
                GetStudentData();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alert", "alert('SomeThing Is Wrong..!!');window.location='NextAcademicYearSpecial.aspx';", true);
            }
            catch (Exception)
            {
                throw;
            }
        }