Ejemplo n.º 1
0
        public string SaveDepartment(DepartmentModel aDepartmetModel)
        {
            DepartmentGateway aDepartmentGateway = new DepartmentGateway();
            string            message            = "";

            if (aDepartmentGateway.IsDepartmentCodeExist(aDepartmetModel.DepartmentCode))
            {
                message = "Department Code Exists";
            }
            else if (aDepartmentGateway.IsDepartmentNameExist(aDepartmetModel.DepartmentName))
            {
                message = "Department Name Exists";
            }
            else
            {
                int rowAffected = aDepartmentGateway.SaveDepartment(aDepartmetModel);
                if (rowAffected > 0)
                {
                    message = "Department Saved Successfully";
                }
                else
                {
                    message = "Sorry! Department Save Failed !!";
                }
            }
            return(message);
        }
Ejemplo n.º 2
0
        public bool IsDepartmentCodeExist(string DeptCode)
        {
            DepartmentGateway aDepartmentGateway = new DepartmentGateway();

            return(aDepartmentGateway.IsDepartmentCodeExist(DeptCode));
        }