Пример #1
0
        private Student GetUpdatedStudent()
        {
            Student s = new Student();

            s.Id   = EditableStudent.Id;
            s.Name = EsName;
            if (SexIndex == 0)
            {
                s.Sex = "M";
            }
            else if (SexIndex == 1)
            {
                s.Sex = "F";
            }
            s.StudyingClass = EsClass;

            s.StartSessionYear = EsSessionStartYear;
            s.EndSessionYear   = EsSessionEndYear;

            s.Section = EsSection[EsSectionIndex];
            s.Roll    = EditableStudent.Roll;
            s.Dob     = new DateTime(YYYY[DobYYIndex], DobMMIndex + 1, DD[DobDDIndex]);
            if (s.StudyingClass == "V")
            {
            }

            if (s.StudyingClass == "XI" || s.StudyingClass == "XII")
            {
                // StreamIndex = Array.IndexOf(Stream, EditableStudent.Stream);
                // s.Stream = EditableStudent.Stream;
                if (StreamIndex > -1)
                {
                    s.Stream = Stream[StreamIndex];
                }

                /*
                 * if (s.Stream == "ARTS")
                 * {
                 *  s.HsSub1 = HsActiveSubs1[HsSub1Index];
                 *  s.HsSub2 = HsActiveSubs2[HsSub2Index];
                 *  s.HsSub3 = HsActiveSubs3[HsSub3Index];
                 *  s.HsAdlSub = HsActiveSubs4[HsSub4Index];
                 *
                 * }
                 * else if (s.Stream == "SCIENCE")
                 * {
                 *  s.HsSub1 = HsActiveSubs1[HsSub1Index];
                 *  s.HsSub2 = HsActiveSubs2[HsSub2Index];
                 *  s.HsSub3 = HsActiveSubs3[HsSub3Index];
                 *  s.HsAdlSub = HsActiveSubs4[HsSub4Index];
                 * }
                 */
                if (HsSub1Index > -1)
                {
                    s.HsSub1 = HsActiveSubs1[HsSub1Index];
                }
                if (HsSub2Index > -1)
                {
                    s.HsSub2 = HsActiveSubs2[HsSub2Index];
                }
                if (HsSub3Index > -1)
                {
                    s.HsSub3 = HsActiveSubs3[HsSub3Index];
                }
                if (HsSub4Index > -1)
                {
                    s.HsAdlSub = HsActiveSubs4[HsSub4Index];
                }
            }

            if (!string.IsNullOrEmpty(EsAadhaar))
            {
                s.Aadhar = EsAadhaar.Trim();
            }

            if (EsReligionIndex != -1)
            {
                s.Religion = EsReligion[EsReligionIndex];
            }

            if (SocialCatIndex != -1)
            {
                s.SocialCategory = SocialCatList[SocialCatIndex];
            }

            if (BloodGroupIndex != -1)
            {
                s.BloodGroup = BloodGroups[BloodGroupIndex];
            }

            if (IsEsBpl)
            {
                s.IsBpl = true;
                s.BplNo = EsBplNo;
            }
            else
            {
                s.IsBpl = false;
                s.BplNo = string.Empty;
            }

            if (IsEsPH)
            {
                s.IsPH   = true;
                s.PhType = EsPhType;
            }
            else
            {
                s.IsPH   = false;
                s.PhType = string.Empty;
            }

            s.FatherName         = EsFather;
            s.MotherName         = EsMother;
            s.GuardianName       = EsGuardian;
            s.GuardianRelation   = EsGuardianRel;
            s.GuardianOccupation = EsGuardianOccu;
            // aadhaar
            //
            s.GuardianEpic = EsGuardianEpic;

            s.PstAddrLane1 = EsAddr1;
            s.PstAddrLane2 = EsAddr2;
            s.PstAddrPO    = EsAddrPO;
            s.PstAddrPS    = EsAddrPS;
            s.PstAddrDist  = EsAddrDist;
            s.PstAddrPin   = EsAddrPIN;

            s.PmtAddrLane1 = EsPaddr1;
            s.PmtAddrLane2 = EsPaddr2;
            s.PmtAddrPO    = EsPaddrPO;
            s.PmtAddrPS    = EsPaddrPS;
            s.PmtAddrDist  = EsPaddrDist;
            s.PmtAddrPin   = EsPaddrPIN;


            // mobile use regex
            if (!string.IsNullOrEmpty(EsMobile))
            {
                s.Mobile = EsMobile.Trim();
            }
            if (!string.IsNullOrEmpty(EsGuardianMobile))
            {
                s.GuardianMobile = EsGuardianMobile.Trim();
            }
            s.Email = EsEmail;

            s.BankAcc    = EsBankAccNo;
            s.BankName   = EsBankName;
            s.BankBranch = EsBankBranch;
            s.Ifsc       = EsBankIfsc;
            s.MICR       = EsBankMicr;

            s.LastSchool = EsLastSchool;
            // last board
            s.TC = EsTC;
            // qualified exam
            if (QualifiedClassIndex != -1)
            {
            }

            // full marks qualified
            // mark obt in qualified

            s.AdmissionNo = EsAdmissionNo;
            if (EsAdmittedClassIndex != -1)
            {
                s.AdmittedClass = EsSchoolClass[EsAdmittedClassIndex];
            }

            s.RegistrationNoMp = MpRegisNo;
            s.BoardRoll        = MpRoll;
            s.BoardNo          = MpNo;

            s.RegistrationNoHs = HsRegisNo;
            s.CouncilRoll      = HsRoll;
            s.CouncilNo        = HsNo;

            //   s.StartSessionYear = EditableStudent.StartSessionYear;
            //  s.EndSessionYear = EditableStudent.EndSessionYear;

            return(s);
        }
Пример #2
0
        private bool HasError()
        {
            // class
            if (Array.IndexOf(GlobalVar.SchoolClasses, EsClass) == -1)
            {
                System.Windows.MessageBox.Show("Sorry! Class has some invalid entries.");
                return(true);
            }
            // section
            bool valSection = EsSectionIndex != -1;

            if (!valSection)
            {
                System.Windows.MessageBox.Show("Sorry! Section is not correct.");
                return(true);
            }
            // roll
            bool valRoll = EsRoll > 0;

            if (!valRoll)
            {
                System.Windows.MessageBox.Show("Sorry! Roll is not correct.");
                return(true);
            }
            // date of birth
            try
            {
                DateTime valDob = new DateTime(YYYY[DobYYIndex], DobMMIndex + 1, DD[DobDDIndex]);
            }
            catch (Exception exdob)
            {
                System.Windows.MessageBox.Show("Sorry! Date of Birth is not correct.");
                return(true);
            }

            // aadhaar
            if (!string.IsNullOrEmpty(EsAadhaar))
            {
                string pattern = @"^\d{12}$";
                Match  match   = Regex.Match(EsAadhaar.Trim(), pattern);
                if (!match.Success)
                {
                    System.Windows.MessageBox.Show("Please enter correct Aadhaar no.");
                    return(true);
                }
            }

            // mobile
            if (!string.IsNullOrEmpty(EsMobile))
            {
                string pattern = @"^\d{10}$";
                Match  match   = Regex.Match(EsMobile.Trim(), pattern);
                if (!match.Success)
                {
                    System.Windows.MessageBox.Show("Please enter correct mobile no.");
                    return(true);
                }
            }

            if (!string.IsNullOrEmpty(EsGuardianMobile))
            {
                string pattern = @"^\d{10}$";
                Match  match   = Regex.Match(EsGuardianMobile.Trim(), pattern);
                if (!match.Success)
                {
                    System.Windows.MessageBox.Show("Please enter guardian's correct mobile no.");
                    return(true);
                }
            }
            // email

            return(false);
        }