示例#1
0
        public static List <CourseId> getCourseDescription()
        {
            List <CourseId> courseList = new List <CourseId>();

            CourseId course1 = new CourseId();

            course1.courseId   = 10;
            course1.courseDesc = "COEN 252-Computer Forensics";

            CourseId course2 = new CourseId();

            course2.courseId   = 12;
            course2.courseDesc = "COEN 285-Software Engineering";

            CourseId course3 = new CourseId();

            course3.courseId   = 13;
            course3.courseDesc = "COEN 285-Software Engineering";



            courseList.Add(course1);
            courseList.Add(course2);
            courseList.Add(course3);


            return(courseList);
        }
示例#2
0
public override int GetHashCode()
{
    int hashCourseId  = CourseId.GetHashCode();
    int hashTrainerId = TrainerId.GetHashCode();

    return(hashCourseId ^ hashTrainerId);
}
示例#3
0
        private void FatchTest()
        {
            try
            {
                EWA_UploadResult objEWA = new EWA_UploadResult();
                BL_UploadResult  objBL  = new BL_UploadResult();
                objEWA.OrgId      = Session["OrgId"].ToString();
                objEWA.CourseId   = CourseId.ToString();
                objEWA.BranchId   = BranchId.ToString();
                objEWA.ClassId    = ClassId.ToString();
                objEWA.SemesterId = ddlSemester.SelectedValue.ToString();

                DataSet ds = objBL.FatchTest_BL(objEWA);

                ddlTest.DataSource = ds;
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ddlTest.DataTextField  = "TestName";
                    ddlTest.DataValueField = "TestId";
                    ddlTest.DataBind();
                }
                else
                {
                    ddlTest.Items.Clear();
                }

                ddlTest.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
示例#4
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((CourseId.GetHashCode() * 397) ^ CourseId2.GetHashCode());
     }
 }
示例#5
0
        public void Increment(CourseId courseId)
        {
            this.Total = this.Total.Increment();
            this.ExistingCourses.Add(courseId);

            this.Record(new CoursesCounterIncrementedDomainEvent(this.Id.Value, this.Total.Value));
        }
        public async Task Create(CourseId id, CourseName name, CourseDuration duration)
        {
            var course = Course.Create(id, name, duration);

            await _repository.Save(course);

            await _eventBus.Publish(course.PullDomainEvents());
        }
示例#7
0
        public static Course Create(CourseId id, CourseName name, CourseDuration duration)
        {
            Course course = new Course(id, name, duration);

            course.Record(new CourseCreatedDomainEvent(id.Value, name.Value, duration.Value));

            return(course);
        }
示例#8
0
        public Course search(CourseId id)
        {
            CourseEfCoreModel courseModel = this.Context.Courses.FirstOrDefault(c => c.Id.Equals(id.Value));

            return(courseModel != null
                ? new Course(new CourseId(courseModel.Id), new CourseName(courseModel.Name), new CourseDuration(courseModel.Duration))
                : null);
        }
示例#9
0
 /// <summary>
 /// get the course id text
 /// </summary>
 /// <returns>text</returns>
 public string GetCourseId()
 {
     CourseId.Wait(2);
     if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
     {
         CourseId.Text = FakeText;
     }
     return(CourseId.Text);
 }
示例#10
0
        public override int GetHashCode()
        {
            unchecked
            {
                int result = (Constants.HashComputePrime) ^ CourseId.GetHashCode();

                return(result);
            }
        }
        public async Task Increment(CourseId id)
        {
            var counter = await _repository.Search() ?? InitializeCounter();

            if (!counter.HasIncremented(id))
            {
                counter.Increment(id);

                await _repository.Save(counter);
            }
        }
示例#12
0
        public override int GetHashCode()
        {
            var hashCode = From.GetHashCode();

            hashCode = (hashCode * 397) ^ To.GetHashCode();
            hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ (Instructor?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ (CourseId?.GetHashCode() ?? 0);
            hashCode = (hashCode * 397) ^ (GetType()?.GetHashCode() ?? 0);
            return(hashCode);
        }
示例#13
0
 public override bool Equals(object obj)
 {
     return(obj is Block block &&
            BlockType == block.BlockType &&
            CourseId.Equals(block.CourseId) &&
            Day == block.Day &&
            StartHour == block.StartHour &&
            Duration == block.Duration &&
            Room == block.Room &&
            Teacher == block.Teacher);
 }
        public async Task <Course> Search(CourseId id)
        {
            if (File.Exists(FileName(id.Value)))
            {
                var text = await File.ReadAllTextAsync(FileName(id.Value));

                return(JsonConvert.DeserializeObject <Course>(text));
            }

            return(null);
        }
示例#15
0
        public bool Equals(CourseNode other)
        {
            if (other == null)
            {
                return(false);
            }

            bool result = CourseId.Equals(other.CourseId, StringComparison.Ordinal);

            return(result);
        }
示例#16
0
    public bool Equals(CourseTrainer other)
{
    if (ReferenceEquals(other, null))
    {
        return(false);
    }
    if (ReferenceEquals(this, other))
    {
        return(true);
    }
    return(CourseId.Equals(other.CourseId) && TrainerId.Equals(other.TrainerId));
}
示例#17
0
        public async Task Invoke(CreateCourseRequest request)
        {
            var id       = new CourseId(request.Id);
            var name     = new CourseName(request.Name);
            var duration = new CourseDuration(request.Duration);

            Course course = Course.Create(id, name, duration);

            await this._repository.Save(course);

            await this._eventBus.Publish(course.PullDomainEvents());
        }
        public void Invoke(CourseId courseId)
        {
            var counter = this.Repository.Search() ?? this.InitializeCounter();

            if (!counter.HasIncremented(courseId))
            {
                counter.HasIncremented(courseId);

                this.Repository.Save(counter);

                this.Publisher.Publish(counter.PullDomainEvent());
            }
        }
示例#19
0
        public Course(CourseId id, string name, string description, string category, DateTime createdAt,
                      IEnumerable <Module> modules, IEnumerable <Author> authors)
        {
            Id = id;
            SetName(name);
            SetDescription(description);
            SetCategory(category);
            Modules   = modules ?? throw new EmptyModulesException(id);
            Authors   = authors ?? throw new EmptyAuthorsException(id);
            CreatedAt = createdAt;

            AddDomainEvent(new CourseCreated(this));
        }