public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Department; hashCode = (hashCode * 397) ^ (Specialty != null ? Specialty.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)EducationForm; hashCode = (hashCode * 397) ^ Course; hashCode = (hashCode * 397) ^ Semester; hashCode = (hashCode * 397) ^ НедельВСем; hashCode = (hashCode * 397) ^ (Flow != null ? Flow.GetHashCode() : 0); hashCode = (hashCode * 397) ^ GroupsCount; hashCode = (hashCode * 397) ^ SubgroupsCount; hashCode = (hashCode * 397) ^ ГруппВПотоке; hashCode = (hashCode * 397) ^ (Численность != null ? Численность.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Трудоемкость.GetHashCode(); hashCode = (hashCode * 397) ^ ТрудоемкостьГода.GetHashCode(); hashCode = (hashCode * 397) ^ (Lectures != null ? Lectures.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Laboratory != null ? Laboratory.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Practical != null ? Practical.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Exam.GetHashCode(); hashCode = (hashCode * 397) ^ Test.GetHashCode(); hashCode = (hashCode * 397) ^ (int)CourseDesigning; hashCode = (hashCode * 397) ^ (PlannedLoad != null ? PlannedLoad.GetHashCode() : 0); return(hashCode); } }
protected bool Equals(Load load) { return(Id == load.Id && Lectures.Equals(load.Lectures) && Laboratory.Equals(load.Laboratory) && Practical.Equals(load.Practical) && Test.Equals(load.Test) && Consultations.Equals(load.Consultations) && Exams.Equals(load.Exams) && Nir.Equals(load.Nir) && CourseDesigning.Equals(load.CourseDesigning) && Vkr.Equals(load.Vkr) && Gek.Equals(load.Gek) && Gak.Equals(load.Gak) && Rma.Equals(load.Rma) && Rmp.Equals(load.Rmp)); }
public PracticalsViewData(Practical practical) { Theme = practical.Theme; PracticalId = practical.Id; Duration = practical.Duration; SubjectId = practical.SubjectId; Order = practical.Order; PathFile = practical.Attachments; ShortName = practical.ShortName; Attachments = FilesManagementService.GetAttachments(practical.Attachments); }
private bool RegisterPracticalQuestion(irQmDbContext db) { var list = ucPracticalAnswer1.CheckList; if (list.Count == 0) { lblMessage.Text = "چک لیست خالی است"; lblMessage.ForeColor = Color.Red; return(false); } var q = new Practical(); q.Id = Guid.NewGuid().ToString(); q.Face = rbFace.Rtf; q.RegisterTime = DateTime.UtcNow; var tagsInBox = tagsBox1.Tags; var tags = db.Tags.Select(t => t.Value).ToArray(); foreach (var tg in tagsInBox.Where(t => !(tags.Contains(t)))) { var tag = new Tag(); tag.Value = tg; db.Tags.Add(tag); } foreach (var t in tagsInBox) { TagInQuestion <Practical> tagInQuestion = new TagInQuestion <Practical>(); tagInQuestion.QuestionId = q.Id; tagInQuestion.TagId = t; db.TagInPractical.Add(tagInQuestion); } q.CheckList = list; q.LessonName = comboLesson.Text.Trim(); q.CreatorUserId = Globals.CurrentUser.UserId; db.PracticalQuestions.Add(q); db.SaveChanges(); ucPracticalAnswer1.New(new List <StringItem>() { new StringItem(1), new StringItem(2), new StringItem(3) }); return(true); }
public Practical SavePractical(Practical practical, IList <Attachment> attachments, int userId) { using (var repositoriesContainer = new LmPlatformRepositoriesContainer()) { if (!string.IsNullOrEmpty(practical.Attachments)) { var deleteFiles = repositoriesContainer.AttachmentRepository.GetAll( new Query <Attachment>(e => e.PathName == practical.Attachments)).ToList() .Where(e => attachments.All(x => x.Id != e.Id)).ToList(); foreach (var attachment in deleteFiles) { FilesManagementService.DeleteFileAttachment(attachment); } } else { practical.Attachments = GetGuidFileName(); } FilesManagementService.SaveFiles(attachments.Where(e => e.Id == 0), practical.Attachments); foreach (var attachment in attachments) { if (attachment.Id == 0) { attachment.PathName = practical.Attachments; repositoriesContainer.AttachmentRepository.Save(attachment); } } repositoriesContainer.PracticalRepository.Save(practical); repositoriesContainer.ApplyChanges(); if (practical.IsNew && practical.Subject.SubjectModules.Any(m => m.Module.ModuleType == ModuleType.Practical)) { ConceptManagementService.AttachFolderToLabSection(practical.Theme, userId, practical.SubjectId); } } return(practical); }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ Lectures.GetHashCode(); hashCode = (hashCode * 397) ^ Laboratory.GetHashCode(); hashCode = (hashCode * 397) ^ Practical.GetHashCode(); hashCode = (hashCode * 397) ^ Test.GetHashCode(); hashCode = (hashCode * 397) ^ Consultations.GetHashCode(); hashCode = (hashCode * 397) ^ Exams.GetHashCode(); hashCode = (hashCode * 397) ^ Nir.GetHashCode(); hashCode = (hashCode * 397) ^ CourseDesigning.GetHashCode(); hashCode = (hashCode * 397) ^ Vkr.GetHashCode(); hashCode = (hashCode * 397) ^ Gek.GetHashCode(); hashCode = (hashCode * 397) ^ Gak.GetHashCode(); hashCode = (hashCode * 397) ^ Rma.GetHashCode(); hashCode = (hashCode * 397) ^ Rmp.GetHashCode(); return(hashCode); } }
protected void btnCSV_Click(object sender, EventArgs e) { Practical.GenerateCSVFile(); }
public void Update(object sender, EventArgs args) { Practical practical = (Practical)sender; // do something with practical }
public Staff(Practical practical) { practical.FnChanged += Update; }
public Student(Practical practical) { practical.QnChanged += Update; }