Example #1
0
        public static int Save(SchoolName schoolName)
        {
            var a = new SchoolName
            {
                SchoolNo        = schoolName.SchoolNo,
                SchoolName1     = schoolName.SchoolName1,
                SchoolShortName = schoolName.SchoolShortName,
                IsActive        = schoolName.IsActive,
                modifieddate    = schoolName.modifieddate
            };

            using (_d = new DataRepository <SchoolName>())
            {
                if (schoolName.SchoolNo > 0)
                {
                    _d.Update(a);
                }
                else
                {
                    _d.Add(a);
                }

                _d.SaveChanges();
            }

            return(a.SchoolNo);
        }
Example #2
0
        public static bool Delete(SchoolName schoolName)
        {
            using (_d = new DataRepository <SchoolName>())
            {
                _d.Delete(schoolName);
                _d.SaveChanges();
            }

            return(true);
        }
Example #3
0
        public void Constructor_Should_Throw_Exception_When_Name_Is_Null_Or_Empty(string value)
        {
            //Arrange
            var name          = new SchoolName(value);
            var schoolBuilder = _aSchool.But().With(name);

            //Act
            Action school = () => schoolBuilder.Build();

            //Assert
            school.Should().Throw <NullReferenceException>();
        }
 /// <summary>
 /// This method returns true if all required Parameters exits and has default values
 /// </summary>
 /// <returns></returns>
 public bool HasRecords()
 {
     if (!(string.IsNullOrEmpty(SchoolName.GetValue())) &&
         !(string.IsNullOrEmpty(EstablishmentNumber.GetValue())))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #5
0
 //重置
 protected void Reset_Click(object sender, EventArgs e)
 {
     try
     {
         UserInfoName.Reset();
         SchoolName.Reset();
         College.Reset();
         DatePickerEduTime.Reset();
         DropDownListDegree.Reset();
         Major.Reset();
         Series.Reset();
         DropDownListSecrecyLevel.Reset();
         DegreeNumber.Reset();
         GraduateNumber.Reset();
     }
     catch (Exception ex)
     {
         publicmethod.SaveError(ex, this.Request);
     }
 }
Example #6
0
        public School(SchoolId id, SchoolName name, SchoolCode code, SchoolRegion region, SchoolRound round,
                      SchoolContactInfo contactInfo,
                      int sex, string fields, int academicYear,
                      HeadMaster headMaster, SchoolTypeId schoolType, SchoolTermId schoolTerm, int nature,
                      string description, long studentsCount) : base(id)
        {
            Validate(name.Value, code.Value, region.Value, round.Value, academicYear, nature);

            Name          = name;
            Code          = code;
            Region        = region;
            Round         = round;
            Sex           = sex;
            Fields        = fields;
            AcademicYear  = academicYear;
            HeadMaster    = headMaster;
            SchoolType    = schoolType;
            SchoolTerm    = schoolTerm;
            Nature        = nature;
            Description   = description;
            StudentsCount = studentsCount;
            ContactInfo   = contactInfo;
        }
Example #7
0
 new School(SchoolName, ShortSchoolName,
            ZipCode, City, Street, Number, SecondNumber));
Example #8
0
 public SchoolTestBuilder With(SchoolName name)
 {
     Name = name;
     return(this);
 }