protected void btnAdd_Click(object sender, EventArgs e)
    {
        BusinessLayer.StudentAdmissionBL objStudComm = new StudentAdmissionBL();
        int Batch = Convert.ToInt32(ddlBatch.Items[ddlBatch.SelectedIndex].Value);
        int Class = Convert.ToInt32(ddlClasses.Items[ddlClasses.SelectedIndex].Value);
        int Section = Convert.ToInt32(ddlSections.Items[ddlSections.SelectedIndex].Value);
        int i=objStudComm.AddStudPhysicalState(Convert.ToInt32(ddlStudent.Items[ddlStudent.SelectedIndex].Value), DateTime.Now, Convert.ToInt32(txtHeight.Text), Convert.ToInt32(txtWeight.Text), txtChest.Text, txtEyesight.Text, txtBloodgroup.Text, txtDietPreferred.Text, txtAilments.Text, txtAllergies.Text, txtChronocDisease.Text, txtMedicalOPenion.Text,Batch,Class,Section);
        if (i > 0)
        {
            lblSave.Visible = true;
            lblSave.Text = "Physical State Added Successfully";

        }

        ddlBatch.SelectedIndex = 0;
        ddlClasses.SelectedIndex = 0;
        ddlSections.SelectedIndex = 0;
        ddlStudent.SelectedIndex = 0;
        txtHeight.Text = "";
        txtWeight.Text = "";
        txtChest.Text = "";
        txtEyesight.Text = "";
        txtBloodgroup.Text = "";
        txtDietPreferred.Text = "";
        txtAilments.Text = "";
        txtAllergies.Text = "";
        txtChronocDisease.Text = "";
        txtMedicalOPenion.Text = "";
    }
 public void fillStudent(int ClassID, int BatchID, int SectionID)
 {
     BusinessLayer.StudentAdmissionBL objStudComm = new StudentAdmissionBL();
     ds = objStudComm.GetStudPromotionData(Convert.ToInt32(ddlClasses.Items[ddlClasses.SelectedIndex].Value), Convert.ToInt32(ddlBatch.Items[ddlBatch.SelectedIndex].Value), Convert.ToInt32(ddlSections.Items[ddlSections.SelectedIndex].Value));
     if (ds.Tables.Count > 0)
     {
         ddlStudID.DataSource = ds.Tables[0];
         ddlStudID.DataTextField = "FullName";
         ddlStudID.DataValueField = "StudID";
         ddlStudID.DataBind();
         ddlStudID.Items.Insert(0, new ListItem("---Select---", "0"));
     }
 }
Example #3
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     int i = 0;
     string strFromDate = txtFrom.Text;
     string strToDate = txtTo.Text;
     BusinessLayer.StudentAdmissionBL objStudComm = new BusinessLayer.StudentAdmissionBL();
     i = objStudComm.AddStudLeaves(Convert.ToInt32(ddlStudent.Items[ddlStudent.SelectedIndex].Value), Convert.ToDateTime(ChangeDateFormat(strFromDate)), Convert.ToDateTime(ChangeDateFormat(strToDate)), Convert.ToInt32(ddlhousemaster.Items[ddlhousemaster.SelectedIndex].Value), Convert.ToInt32(ddlClasses.Items[ddlClasses.SelectedIndex].Value), Convert.ToInt32(ddlSection.Items[ddlSection.SelectedIndex].Value), txtReason.Text);
     if (i > 0)
     {
         lblMessage.Visible = true;
         lblMessage.Text = "Student Leave Added Successfully";
         ddlStudent.SelectedIndex = 0;
         txtTo.Text = "";
         ddlhousemaster.SelectedIndex = 0;
         txtReason.Text = "";
         ddlBatch.SelectedIndex = 0;
         ddlClasses.SelectedIndex = 0;
         ddlSection.SelectedIndex = 0;
         ddlStudent.SelectedIndex = 0;
     }
 }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        btnreset.Attributes.Add("onclick", "javascript:return ResetForm();");
        btnsave.Attributes.Add("onclick", "javascript:return RequiredValidate();");
        fudStudent.Attributes.Add("onchange", "javascript:return AddPhoto('" + fudStudent.ClientID + "','" + imgStud.ClientID + "');");
        //fudFatherPhoto.Attributes.Add("onchange", "javascript:return AddPhoto('" + fudFatherPhoto.ClientID + "','" + imgFather.ClientID + "');");
        //fudMother.Attributes.Add("onchange", "javascript:return AddPhoto('" + fudMother.ClientID + "','" + imgMother.ClientID + "');");
           // fudGuardian.Attributes.Add("onchange", "javascript:return AddPhoto('" + fudGuardian.ClientID + "','" + imgGuardian.ClientID + "');");
        lblMessage.Attributes.Add("style", "color:red;font-weight:bold;");
        BusinessLayer.CommonDataBL objCommon = new CommonDataBL();
        StudentAdmissionBL objStud = new StudentAdmissionBL();
        ds = new DataSet();
        if (!IsPostBack)
        {
            for (int i = 2005; i < 2050; i++)
            {
                ddlYear.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            ddlYear.Items.Insert(0, new ListItem("---Select---", "0"));
            ddlYear.SelectedValue = "2012";

            txtAdmissionmDate.Text = DateTime.Today.ToString("dd/MM/yyyy");
            Message.Value = DateTime.Today.ToString("dd/MM/yyyy");
            ds = objCommon.GetMotherTounge();
            ddlMotherTounge.DataSource = ds.Tables[0];
            ddlMotherTounge.DataTextField = "Language";
            ddlMotherTounge.DataValueField = "MTID";
            ddlMotherTounge.DataBind();
            ddlMotherTounge.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetJoiningType();
            ddlJoinType.DataSource = ds.Tables[0];
            ddlJoinType.DataTextField = "JTName";
            ddlJoinType.DataValueField = "JTID";
            ddlJoinType.DataBind();
            ddlJoinType.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetPhysicallyChallenged();
            ddlPhysicallyChallanged.DataSource = ds.Tables[0];
            ddlPhysicallyChallanged.DataTextField = "PHType";
            ddlPhysicallyChallanged.DataValueField = "PHId";
            ddlPhysicallyChallanged.DataBind();
            ddlPhysicallyChallanged.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetCaste();
            ddlcaste.DataSource = ds.Tables[0];
            ddlcaste.DataTextField = "Caste";
            ddlcaste.DataValueField = "CasteID";
            ddlcaste.DataBind();
            ddlcaste.Items.Insert(0, new ListItem("---Select---", "0"));

            ds = objCommon.GetExtraCurricular();
            ddlECA.DataSource = ds.Tables[0];
            ddlECA.DataTextField = "Activity";
            ddlECA.DataValueField = "ExtraCurricularID";
            ddlECA.DataBind();
            ddlECA.Items.Insert(0, new ListItem("---Select---", "0"));
            //ds = objCommon.GetQualification();
            //ddlQualFather.DataSource = ds.Tables[0];
            //ddlQualFather.DataTextField = "QualificationDetails";
            //ddlQualFather.DataValueField = "QualificationID";
            //ddlQualFather.DataBind();
            //ddlQualFather.Items.Insert(0, new ListItem("---Select---", "0"));
            //ds = objCommon.GetQualification();
            //ddlQualMother.DataSource = ds.Tables[0];
            //ddlQualMother.DataTextField = "QualificationDetails";
            //ddlQualMother.DataValueField = "QualificationID";
            //ddlQualMother.DataBind();
            //ddlQualMother.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetClasses();
            ddlClass.DataSource = ds.Tables[0];
            ddlClass.DataTextField = "ClassName";
            ddlClass.DataValueField = "ClassID";
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetSection();
            ddlSection.DataSource = ds.Tables[0];
            ddlSection.DataTextField = "SectionName";
            ddlSection.DataValueField = "SectionId";
            ddlSection.DataBind();
            ddlSection.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetMedium();
            ddlMedium.DataSource = ds.Tables[0];
            ddlMedium.DataTextField = "Language";
            ddlMedium.DataValueField = "MediumID";
            ddlMedium.DataBind();
            ddlMedium.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetMedium();
            ddlMed1.DataSource = ds.Tables[0];
            ddlMed1.DataTextField = "Language";
            ddlMed1.DataValueField = "MediumID";
            ddlMed1.DataBind();
            ddlMed1.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetMedium();
            ddlMed2.DataSource = ds.Tables[0];
            ddlMed2.DataTextField = "Language";
            ddlMed2.DataValueField = "MediumID";
            ddlMed2.DataBind();
            ddlMed2.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetMedium();
            ddlMed3.DataSource = ds.Tables[0];
            ddlMed3.DataTextField = "Language";
            ddlMed3.DataValueField = "MediumID";
            ddlMed3.DataBind();
            ddlMed3.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetBatch();
            ddlBatch.DataSource = ds.Tables[0];
            ddlBatch.DataTextField = "BatchNo";
            ddlBatch.DataValueField = "BatchID";
            ddlBatch.DataBind();
            ddlBatch.Items.Insert(0, new ListItem("---Select---", "0"));
            //ds = objCommon.GetGroups();
            //ddlGroup.DataSource = ds.Tables[0];
            //ddlGroup.DataTextField = "GroupName";
            //ddlGroup.DataValueField = "GroupId";
            //ddlGroup.DataBind();
            //ddlGroup.Items.Insert(0, new ListItem("---Select---", "0"));
            ds = objCommon.GetState();
            ddlstate.DataSource = ds.Tables[0];
            ddlstate.DataTextField = "StateName";
            ddlstate.DataValueField = "StateID";
            ddlstate.DataBind();
            ddlstate.Items.Insert(0, new ListItem("---Select---", "0"));
            trCurHead.Style.Add("display", "none");
            trCurBatch.Style.Add("display", "none");
            trCurSection.Style.Add("display", "none");
            if (Request.QueryString["ID"] != null)
            {
                ds = objCommon.GetBatch();
                ddlCurBatch.DataSource = ds.Tables[0];
                ddlCurBatch.DataTextField = "BatchNo";
                ddlCurBatch.DataValueField = "BatchID";
                ddlCurBatch.DataBind();
                ddlCurBatch.Items.Insert(0, new ListItem("---Select---", "0"));
                ds = objCommon.GetGroups();
                ddlCurGroup.DataSource = ds.Tables[0];
                ddlCurGroup.DataTextField = "GroupName";
                ddlCurGroup.DataValueField = "GroupId";
                ddlCurGroup.DataBind();
                ddlCurGroup.Items.Insert(0, new ListItem("---Select---", "0"));
                ds = objCommon.GetClasses();
                ddlCurClass.DataSource = ds.Tables[0];
                ddlCurClass.DataTextField = "ClassName";
                ddlCurClass.DataValueField = "ClassID";
                ddlCurClass.DataBind();
                ddlCurClass.Items.Insert(0, new ListItem("---Select---", "0"));
                ds = objCommon.GetSection();
                ddlCurSection.DataSource = ds.Tables[0];
                ddlCurSection.DataTextField = "SectionName";
                ddlCurSection.DataValueField = "SectionId";
                ddlCurSection.DataBind();
                ddlCurSection.Items.Insert(0, new ListItem("---Select---", "0"));
                trCurHead.Style.Add("display", "inline");
                trCurBatch.Style.Add("display", "inline");
                trCurSection.Style.Add("display", "inline");

                StudID = Convert.ToInt32(Request.QueryString["ID"].ToString());
                string path = Server.MapPath("..\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\") + StudID.ToString() + ".jpeg";
                if (File.Exists(path))
                {
                    imgStud.ImageUrl = "~\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\" + StudID.ToString() + ".jpeg";
                }
                path = Server.MapPath("..\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\") + StudID.ToString() + "_F.jpeg";
                //if (File.Exists(path))
                //{
                //    imgFather.ImageUrl = "~\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\" + StudID.ToString() + "_F.jpeg";
                //}
                path = Server.MapPath("..\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\") + StudID.ToString() + "_M.jpeg";
                //if (File.Exists(path))
                //{
                //    imgMother.ImageUrl = "~\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\" + StudID.ToString() + "_M.jpeg";
                //}
                path = Server.MapPath("..\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\") + StudID.ToString() + "_G.jpeg";
                //if (File.Exists(path))
                //{
                //    imgGuardian.ImageUrl = "~\\" + ConfigurationManager.AppSettings["StudentImg"] + "\\" + StudID.ToString() + "_G.jpeg";
                //}
                //Student Data
                ds = objStud.GetStudent(StudID);
                txtAdmissionNo.Text = ds.Tables[0].Rows[0]["AdmissionNo"].ToString();
                txtHallTicket.Text = ds.Tables[0].Rows[0]["HallTicketNo"].ToString();
                txtRank.Text = ds.Tables[0].Rows[0]["Rank"].ToString();
                txtRegion.Text = ds.Tables[0].Rows[0]["Region"].ToString();
                txtAdmissionmDate.Text = ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[0]["AdmissionDate"].ToString()).ToShortDateString());
                txtfullname.Text = ds.Tables[0].Rows[0]["FullName"].ToString();
                txtdob.Text = ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[0]["DOB"].ToString()).ToShortDateString());
                ddlMotherTounge.SelectedValue = ds.Tables[0].Rows[0]["MotherTounge"].ToString();
                txtMandal.Text = ds.Tables[0].Rows[0]["Mandal"].ToString();
                txtNationality.Text = ds.Tables[0].Rows[0]["Nationality"].ToString();
                ddlstate.SelectedValue = ds.Tables[0].Rows[0]["State"].ToString();
                txtreligion.Text = ds.Tables[0].Rows[0]["Religion"].ToString();
                ddlJoinType.SelectedValue = ds.Tables[0].Rows[0]["JoiningType"].ToString();
                ddlPhysicallyChallanged.SelectedValue = ds.Tables[0].Rows[0]["PhysicallyChallenged"].ToString();
                ddlcaste.SelectedValue = ds.Tables[0].Rows[0]["Caste"].ToString();
                txtGamesPlayed.Text = ds.Tables[0].Rows[0]["Games"].ToString();
                txtPrevSchoolTc.Text = ds.Tables[0].Rows[0]["PreviousSchoolTCNo"].ToString();
                txtTcDate.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[0]["TCIssuedDate"].ToString()).ToShortDateString());
                ddlClass.SelectedValue = ds.Tables[0].Rows[0]["AdmittedInClass"].ToString();
                ddlMedium.SelectedValue = ds.Tables[0].Rows[0]["Medium"].ToString();
                txtRollNo.Text = ds.Tables[0].Rows[0]["RollNoAlloted"].ToString();
                ddlHouseAlloted.SelectedValue = ds.Tables[0].Rows[0]["HouseAlloted"].ToString();
                ddlSection.SelectedValue = ds.Tables[0].Rows[0]["Section"].ToString();
                ddlBatch.SelectedValue = ds.Tables[0].Rows[0]["BatchId"].ToString();
                //ddlGroup.SelectedValue= ds.Tables[0].Rows[0]["Group"].ToString();
                //txtAlphaCode.Text = ds.Tables[0].Rows[0]["AlphaCode"].ToString();
                ddlCurBatch.SelectedValue = ds.Tables[0].Rows[0]["CurrentBatch"].ToString();
                ddlCurClass.SelectedValue = ds.Tables[0].Rows[0]["CurrentClass"].ToString();
                ddlCurSection.SelectedValue = ds.Tables[0].Rows[0]["CurrentSection"].ToString();
                ddlCurGroup.SelectedValue = ds.Tables[0].Rows[0]["CurrentGroup"].ToString();
                if (ds.Tables[0].Rows[0]["Gender"].ToString() == "1")
                    rbmale.Checked = true;
                else
                    rbfemale.Checked = true;

                //Student Identification
                ds = objStud.GetStud_Identification(StudID);
                txtMoles1.Text = ds.Tables[0].Rows[0]["Mole1"].ToString();
                txtMoles2.Text = ds.Tables[0].Rows[0]["Mole2"].ToString();
                txtEmail.Text = ds.Tables[0].Rows[0]["Email"].ToString();
                //Student Contact Information
                ds = objStud.GetStud_ContactInfo(StudID);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        txtfathername.Text = ds.Tables[0].Rows[0]["FatherName"].ToString();
                        txtaddr1.Text = ds.Tables[0].Rows[0]["FatherAddress"].ToString();
                        txtteloffice.Text = ds.Tables[0].Rows[0]["FatherPhone"].ToString();
                        ddlQualFather.SelectedValue = ds.Tables[0].Rows[0]["FatherQual"].ToString();
                        txtoccupation.Text = ds.Tables[0].Rows[0]["FatherOccup"].ToString();
                        //txtAnnualIncome.Text = ds.Tables[0].Rows[0]["FatherAnnualIncome"].ToString();
                        ddlFatherAnnualIncome.SelectedValue = ds.Tables[0].Rows[0]["FatherAnnualIncome"].ToString();
                       // txtMotherName.Text = ds.Tables[0].Rows[0]["MotherName"].ToString();
                       // txtAddress2.Text = ds.Tables[0].Rows[0]["MotherAddress"].ToString();
                       // txtPhoneMother.Text = ds.Tables[0].Rows[0]["MotherPhone"].ToString();
                       // ddlQualMother.SelectedValue = ds.Tables[0].Rows[0]["MotherQual"].ToString();
                       // txtOccupationMother.Text = ds.Tables[0].Rows[0]["MotherOccup"].ToString();
                       //// txtMotherAnnualIncome.Text = ds.Tables[0].Rows[0]["MotherAnnualIncome"].ToString();
                       // ddlMotherAnnualIncome.SelectedValue = ds.Tables[0].Rows[0]["MotherAnnualIncome"].ToString();
                        //txtguardname.Text = ds.Tables[0].Rows[0]["GuardianName"].ToString();
                        //txtguardaddress.Text = ds.Tables[0].Rows[0]["GuardianAddress"].ToString();
                        //txtguardtel.Text = ds.Tables[0].Rows[0]["GuardianPhone"].ToString();
                        //txtguardmobile.Text = ds.Tables[0].Rows[0]["GuardianMobile"].ToString();
                    }
                }
                //Student_Extra
                ds = objStud.GetStud_Extra(StudID);
                ddlECA.SelectedValue = ds.Tables[0].Rows[0]["ExtraCurricularID"].ToString();
                txtJnvIssue.Text = ds.Tables[0].Rows[0]["TcIssuedByJnv"].ToString();
                txtDateOfIssue.Text =ChangeDateFormat(Convert.ToDateTime( ds.Tables[0].Rows[0]["DateOfIssue"].ToString()).ToShortDateString());

                //Student Education History
                ds = objStud.GetStud_EducHistory(StudID);
                if (ds.Tables.Count > 0)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            if (i == 0)
                            {
                                txtPrevSchool1.Text = ds.Tables[0].Rows[i]["PrevSchoolName"].ToString();
                                txtFrom1.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Fromdate"].ToString()).ToShortDateString());
                                txtTo1.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Todate"].ToString()).ToShortDateString());
                                ddlMed1.SelectedValue = ds.Tables[0].Rows[i]["Medium"].ToString();
                                txtrem1.Text = ds.Tables[0].Rows[i]["Remarks"].ToString();
                            }
                            if (i == 1)
                            {
                                txtPrevSchool2.Text = ds.Tables[0].Rows[i]["PrevSchoolName"].ToString();
                                txtFrom2.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Fromdate"].ToString()).ToShortDateString());
                                txtto2.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Todate"].ToString()).ToShortDateString());
                                ddlMed2.SelectedValue = ds.Tables[0].Rows[i]["Medium"].ToString();
                                txtrem2.Text = ds.Tables[0].Rows[i]["Remarks"].ToString();
                            }
                            if (i == 2)
                            {
                                txtPrevSchool3.Text = ds.Tables[0].Rows[i]["PrevSchoolName"].ToString();
                                txtFrom3.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Fromdate"].ToString()).ToShortDateString());
                                txtto3.Text =ChangeDateFormat(Convert.ToDateTime(ds.Tables[0].Rows[i]["Todate"].ToString()).ToShortDateString());
                                ddlMed3.SelectedValue = ds.Tables[0].Rows[i]["Medium"].ToString();
                                txtrem3.Text = ds.Tables[0].Rows[i]["Remarks"].ToString();
                            }
                        }
                    }
                }
                btnsave.Text = "Update";
                btnreset.Visible = false;
            }
        }
    }
    protected void ddlStudent_SelectedIndexChanged(object sender, EventArgs e)
    {
        BusinessLayer.StudentAdmissionBL objStudComm = new StudentAdmissionBL();
        ds = new DataSet();
        ds = objStudComm.GetStud_PhysicalState(Convert.ToInt32(ddlBatch.SelectedValue),Convert.ToInt32(ddlClasses.SelectedValue),Convert.ToInt32(ddlSections.SelectedValue), Convert.ToInt32(ddlStudent.SelectedValue));

        if (ds.Tables[0].Rows.Count > 0)
         {
            txtHeight.Text = ds.Tables[0].Rows[0]["height"].ToString();
            txtWeight.Text = ds.Tables[0].Rows[0]["weight"].ToString();
            txtChest.Text = ds.Tables[0].Rows[0]["ChestMeasurement"].ToString();
            txtEyesight.Text = ds.Tables[0].Rows[0]["eyesight"].ToString();
            txtBloodgroup.Text = ds.Tables[0].Rows[0]["bloodGroup"].ToString();
            txtDietPreferred.Text = ds.Tables[0].Rows[0]["dietPreferred"].ToString();
            txtAilments.Text = ds.Tables[0].Rows[0]["ailments"].ToString();
            txtAllergies.Text = ds.Tables[0].Rows[0]["allergies"].ToString();
            txtChronocDisease.Text = ds.Tables[0].Rows[0]["ChronicDiseases"].ToString();
            txtMedicalOPenion.Text = ds.Tables[0].Rows[0]["MedicalOpinion"].ToString();
            btnAdd.Text = "Update";
         }
        else
         {
            txtHeight.Text = "";
            txtWeight.Text = "";
            txtChest.Text = "";
            txtEyesight.Text = "";
            txtBloodgroup.Text = "";
            txtDietPreferred.Text = "";
            txtAilments.Text = "";
            txtAllergies.Text = "";
            txtChronocDisease.Text = "";
            txtMedicalOPenion.Text = "";
            btnAdd.Text = "Save";
        }
    }