Example #1
0
        //////////////////  //Guardian  Save
        ///
        ///
        ///
        ///
        ///
        protected void btnsaveguardian_click(object sender, EventArgs e)
        {
            try
            {
                long result = 1;
                VmStudentRegistration objVmguardian = new VmStudentRegistration();

                objVmguardian.AdmissionNo = Convert.ToInt32(txtadmsnnum.Text.Trim());

                ///     //   father //////


                objVmguardian.Namef        = txtnamef.Text.Trim();
                objVmguardian.Nationalityf = ddlnationalityf.SelectedValue;

                objVmguardian.Maritalstatusf = ddlmaritalstatusf.SelectedValue;
                objVmguardian.Educationf     = txteduf.Text.Trim();


                objVmguardian.Occupationf   = txtoccf.Text.Trim();
                objVmguardian.Organizationf = txtorgf.Text.Trim();
                objVmguardian.Designationf  = txtdesignationf.Text.Trim();

                objVmguardian.Yearofservicef = txtserviceyearfather.Text.Trim();
                objVmguardian.Officeaddf     = txtofficeaddressfather.Text.Trim();
                objVmguardian.offtphonef     = txtofficephonef.Text.Trim();

                objVmguardian.residenceaddf = txtresidentialaddfather.Text.Trim();
                objVmguardian.preaddf       = txtpreaddfather.Text.Trim();
                objVmguardian.peraddf       = txtperaddressfather.Text.Trim();

                objVmguardian.tnof      = txttelephonefather.Text.Trim();
                objVmguardian.mobilef   = txtmobilefather.Text.Trim();
                objVmguardian.emailaddf = txtemailfather.Text.Trim();


                if (rbf1.Checked)
                {
                    objVmguardian.childresidewithfather = "YES";
                }
                else
                {
                    objVmguardian.childresidewithfather = "NO";
                }

                //          mother


                objVmguardian.Namem        = txtnamem.Text.Trim();
                objVmguardian.Nationalitym = ddlnationalitym.SelectedValue;

                objVmguardian.Maritalstatusm = ddlmaritalstatusm.SelectedValue;
                objVmguardian.Educationm     = txtedum.Text.Trim();


                objVmguardian.Occupationm   = txtoccm.Text.Trim();
                objVmguardian.Organizationm = txtorgm.Text.Trim();
                objVmguardian.Designationm  = txtdesignationm.Text.Trim();

                objVmguardian.Yearofservicem = txtserviceyearm.Text.Trim();
                objVmguardian.Officeaddm     = txtoffaddm.Text.Trim();
                objVmguardian.offtphonem     = txtofftelephonem.Text.Trim();

                objVmguardian.residenceaddm = txtresidencem.Text.Trim();
                objVmguardian.preaddm       = txtpreaddm.Text.Trim();
                objVmguardian.peraddm       = txtperaddm.Text.Trim();

                objVmguardian.tnom      = txttelephonem.Text.Trim();
                objVmguardian.mobilem   = txtmobilem.Text.Trim();
                objVmguardian.emailaddm = txtemailm.Text.Trim();


                if (rbm3.Checked)
                {
                    objVmguardian.childresidewithmother = "YES";
                }
                else
                {
                    objVmguardian.childresidewithmother = "NO";
                }



                //          guardian



                objVmguardian.nameg        = txtnameg.Text.Trim();
                objVmguardian.nationalityg = ddlnationalityg.SelectedValue;

                objVmguardian.Relationwstug = ddlrelwstu.SelectedValue;
                objVmguardian.residenceaddg = txtResAddG.Text.Trim();


                objVmguardian.preaddg = txtPreAddG.Text.Trim();
                objVmguardian.peraddg = txtPerAddG.Text.Trim();
                objVmguardian.tnog    = txtTelG.Text.Trim();

                objVmguardian.mobilenog = txtMobileG.Text.Trim();
                objVmguardian.emailg    = txtEmailG.Text.Trim();



                result = _objStudentRegisrationBll.SaveGuardianDetails(objVmguardian);

                if (result > 0)
                {
                    // btnupguardian.Visible = true;
                    btnsaveEmergencyContact.Enabled = true;
                    btnsaveguardian.Enabled         = false;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }