Ejemplo n.º 1
0
 public void Merge(Student student)
 {
     this.FirstName = student.FirstName.Or(this.FirstName);
     this.LastName = student.LastName.Or(this.LastName);
     this.Image = student.Image.Or(this.Image);
 }
Ejemplo n.º 2
0
        private void HandleSudentLine(IList<string> line)
        {
            var student = new Student()
            {
                FirstName = line.Col(FirstName),
                IsMale = true,
                LastName = line.Col(SecondName)
            };
            student.Group = GetGroup(line);
            if (student.Group == null)
            {
                this.Info.Scipped.Add(line.Join("  "));
                return;
            }

            var fatherName = line.Col(FatherName);
            if (!fatherName.IsEmpty() && fatherName != "*")
                student.FirstName += ' ' + fatherName;
            if (StudentManager.MergeOrCreate(student))
                this.Info.New++;
        }
Ejemplo n.º 3
0
 private JsonResult CreateErrorResponse(IEnumerable<string> errors, Student student)
 {
     var sb = new StringBuilder(("An error occured while reseting key for user {0}" + Environment.NewLine + "Errors: ").FormatWith(student.Id));
     foreach (var l in errors)
         sb.AppendLine(l);
     return Json(sb.ToString(), 505);
 }