Beispiel #1
0
        public string SaveStudent(Student aStudent)
        {
            if (aStudent.RegNo.Length > 5)
            {
                bool isRegNoExist = CheckRegNo(aStudent);

                if (isRegNoExist)
                {
                    return("This Reg. No. is already exist! Please use another Reg. No.");
                }
                else
                {
                    var rowAffected = gateway.AddStudent(aStudent);

                    if (rowAffected > 0)
                    {
                        return("Saved Successfully!");
                    }
                    else
                    {
                        return("Save Failed!");
                    }
                }
            }
            else
            {
                return("Invalid Reg. No.! it must be at least 6 characters.");
            }
        }
 public string AddStudent(Student aStudent)
 {
     if (aStudentGateway.IsExitsMail(aStudent.Email))
     {
         return("Email Already Exits");
     }
     return(aStudentGateway.AddStudent(aStudent));
 }
 public int AddStudent(Student student)
 {
     return(_studentGateway.AddStudent(student));
 }