Exemple #1
0
        public string SaveDepartment(Department aDepartment)
        {
            if (aDepartment.Code.Length > 3)
            {
                bool isDepartmentCodeExist = CheckDepartmentCode(aDepartment);

                if (isDepartmentCodeExist)
                {
                    return("This Code number is already exist! Please use another Code number");
                }
                else
                {
                    var rowAffected = gateway.AddDepartment(aDepartment);

                    if (rowAffected > 0)
                    {
                        return("Saved Successfully!");
                    }
                    else
                    {
                        return("Save Failed!");
                    }
                }
            }
            else
            {
                return("Invalid Department Code! it must be at least 4 characters.");
            }
        }
Exemple #2
0
 public string AddDepartment(Department aDepartment)
 {
     if (aDepartmentGateway.SearchDepartment(aDepartment))
     {
         return("Duplicate Department");
     }
     aDepartmentGateway.AddDepartment(aDepartment);
     return("Insert Succesfull");
 }
Exemple #3
0
 public bool AddDepartment(Department department)
 {
     return(_departmentGateway.AddDepartment(department));
 }