Ejemplo n.º 1
0
        public bool Add(CustomerEmployee item)
        {
            bool result = false;

            if (_user.RoleID == 1)
            {
                if (item != null)
                {
                    if (string.IsNullOrEmpty(item.FirstName.Trim()))
                    {
                        throw new Exception("İsim olmadan kayıt yapılamaz!");
                    }
                    if (string.IsNullOrEmpty(item.LastName.Trim()))
                    {
                        throw new Exception("Soyisim olmadan kayıt oluşturulamaz!");
                    }
                    if (string.IsNullOrEmpty(item.Phone.Trim()))
                    {
                        throw new Exception("Telefon bilgisi olmadan kayıt oluşturulamaz.");
                    }
                    _uof.CustomerEmployeeRepository.Add(item);
                    return(_uof.ApplyChanges());
                }
            }
            else
            {
                throw new Exception("Bu işlemi yapmaya yetkiniz yok!");
            }
            return(result);
        }
Ejemplo n.º 2
0
        public bool Add(Customer item)
        {
            bool result = false;

            if (_user.RoleID == 1)
            {
                if (item != null)
                {
                    if (string.IsNullOrEmpty(item.CompanyName.Trim()))
                    {
                        throw new Exception("Müşterinin Şirketi seçilmek zorundadır");
                    }
                    if (string.IsNullOrEmpty(item.Country.Trim()))
                    {
                        throw new Exception("Müşterinin Ülkesi boş geçilemez");
                    }
                    if (string.IsNullOrEmpty(item.City.Trim()))
                    {
                        throw new Exception("Müşterinin Şehri boş geçilemez");
                    }
                    if (item.Contacts == null)
                    {
                        throw new Exception("Contact kısmını boş geçtiniz");
                    }
                    if (item.Projects == null)
                    {
                        throw new Exception("Müşterinin Proje kısmını boş bıraktınız");
                    }
                    _ouf.CustomerRepository.Add(item);
                    return(_ouf.ApplyChanges());
                }
            }
            return(result);
        }
Ejemplo n.º 3
0
 public bool Add(TaskStatus item)
 {
     // Employee Role Proje Yöneticisi
     if (!string.IsNullOrEmpty(item.Name))
     {
         _uof.TaskStatusRepository.Add(item);
         return(_uof.ApplyChanges());
     }
     return(false);
 }
Ejemplo n.º 4
0
        //Kullanıcıların kontrolleri yapılmadı.
        public bool Add(Employee item)
        {
            bool result = false;

            if (_user.RoleID == 1)
            {
                if (item != null)
                {
                    if (string.IsNullOrEmpty(item.FirstName.Trim()))
                    {
                        throw new Exception("Çalışan İsmini girmediniz");
                    }
                    if (string.IsNullOrEmpty(item.LastName.Trim()))
                    {
                        throw new Exception("Çalışan Soyadını girmediniz");
                    }
                    if (string.IsNullOrEmpty(item.HireDate.ToString()))
                    {
                        throw new Exception("Hiredate bölümü boş bırakılamaz");
                    }
                    if (string.IsNullOrEmpty(item.Email.Trim()))
                    {
                        throw new Exception("Email kısmı boş Bırakılamaz");
                    }
                    if (string.IsNullOrEmpty(item.Password.Trim()))
                    {
                        throw new Exception("Şifrenizi Secmediniz");
                    }
                    if (item.Password.Length < 8 && item.Password.Length > 20)
                    {
                        throw new Exception("Şifreniniz 8 ila 20 karakter arasında olmalıdır");
                    }
                    if (item.RoleID == null)
                    {
                        throw new Exception("RolID kısmı bos bırakılamaz");
                    }
                    _uof.EmployeeRepository.Add(item);
                    return(_uof.ApplyChanges());
                }
                else
                {
                    return(result);
                }
            }
            else
            {
                throw new Exception("İşlemi yapma yetkiniz yok.");
            }
        }
Ejemplo n.º 5
0
        public bool Add(RequestType item)
        { // Employee Role takım lideri veya iş analisti ise
            if (_user.RoleID == 2 || _user.RoleID == 3)
            {
                if (!string.IsNullOrEmpty(item.Name))
                {
                    _uof.RequestTypeRepository.Add(item);
                    return(_uof.ApplyChanges());
                }
                else
                {
                    throw new Exception("Lütfen istek çeşit ismini giriniz.");
                }
            }

            return(false);
        }
Ejemplo n.º 6
0
 public bool Add(Role item)
 {
     if (!string.IsNullOrEmpty(item.Name))
     {
         // Employee Role takım lideri
         if (_user.RoleID == 1 || _user.RoleID == 2 || _user.RoleID == 3)
         {
             _uof.RoleRepository.Add(item);
             return(_uof.ApplyChanges());
         }
         else
         {
             throw new Exception("Rol ekleme yetkiniz yok.");
         }
     }
     else
     {
         throw new Exception("Lütfen rol adını giriniz.");
     }
 }
Ejemplo n.º 7
0
 public bool Add(Task item)
 {
     // İş analisti müşteri isteğini(request) işe çevirdiyse
     if (!string.IsNullOrEmpty(item.Description))
     {
         // Takım Lideri, Proje Yöneticisi, İş Analisti
         if (_user.RoleID == 1 || _user.RoleID == 2 || _user.RoleID == 3)
         {
             _uof.TaskRepository.Add(item);
             return(_uof.ApplyChanges());
         }
         else
         {
             throw new Exception("İş ekleme yetkiniz yok. ");
         }
     }
     else
     {
         throw new Exception("Lütfen açıklama kısmını doldurunuz.");
     }
 }
Ejemplo n.º 8
0
        //Proje ekleme ve silme işlemini sadece proje yöneticisi yapabiliyor
        public bool Add(Project item)
        {
            bool result = false;

            if (_user.RoleID == 1)
            {
                if (item != null)

                {
                    if (item.Name == null)
                    {
                        throw new Exception("Projenizin Bir ismi olmalı");
                    }
                    if (item.EndDate == null)
                    {
                        throw new Exception("Proje Bitiş Tarihi secmediniz");
                    }
                    if (item.StartDate == null)
                    {
                        item.StartDate = DateTime.Now;
                    }
                    if (item.CustomerID == null)
                    {
                        throw new Exception("CustomerID kısmı boç bırakılamaz");
                    }
                    _uof.ProjectRepository.Add(item);
                    return(_uof.ApplyChanges());
                }
                else
                {
                    return(result);
                }
            }
            else
            {
                throw new Exception("İşlemi yapabilmek için yetkiniz yok");
            }
        }
Ejemplo n.º 9
0
        public bool Add(Request item)
        {
            // Employee Role takım lideri veya iş analisti ise
            if (_user.RoleID == 2 || _user.RoleID == 3)
            {
                if (string.IsNullOrEmpty(item.RequestTypeID.ToString()))
                {
                    throw new Exception("Lütfen istek tipini seçiniz.");
                }


                if (string.IsNullOrEmpty(item.ProjectID.ToString()))
                {
                    throw new Exception("Lütfen projeyi seçiniz.");
                }

                _uof.RequestRepository.Add(item);
                return(_uof.ApplyChanges());
            }
            else
            {
                throw new Exception("İstek ekleme yetkiniz yok.");
            }
        }
Ejemplo n.º 10
0
 public bool Add(TaskLog item)
 {
     _uof.TaskLogRepository.Add(item);
     return(_uof.ApplyChanges());
 }