Esempio n. 1
0
        private void CheckNumar(DAO_Base dao)
        {
            int count = 0;

            if (this.Numar != 0)
            {
                count = dao.ExecuteHql("select p.Id from Persoana p " +
                    "where p.Numar=" + this.Numar + " and p.Anulat=0 and p.Id<>" + this.Id, null).Count;
                CheckCount(count, "Numarul "+this.Numar+" este deja alocat altei persoane!");
            }
        }
Esempio n. 2
0
        private void CheckDenumire(DAO_Base dao)
        {
            int count = 0;

            if (this.Denumire != "")
            {
                count = dao.ExecuteHql("select f.Id from Functie f " +
                    "where f.Anulat=0 and f.Denumire='" + this.Denumire + "' and f.Id<>" + this.Id, null).Count;
                //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
                CheckCount(count, "Mai aveti o functie cu aceeasi denumire!");
            }
        }
Esempio n. 3
0
        private void CheckDenumire(DAO_Base dao)
        {
            int count = 0;

            if (this.Denumire != "")
            {
                count = dao.ExecuteHql("select a.Id from Ambalaj a " +
                    "where a.Anulat=0 and a.Denumire='" + this.Denumire + "' and a.Id<>" + this.Id, null).Count;
                //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
                CheckCount(count, "Mai aveti un ambalaj cu aceeasi denumire!");
                //throw new Exception("Mai aveti un ambalaj cu aceeasi denumire!");
            }
        }
Esempio n. 4
0
 private void CheckIfContainPersoana(DAO_Base dao)
 {
     IList list = null;
     try
     {
         list = dao.ExecuteHql("select p from Persoana p inner join p.Firma f " +
         " where f.Id=" + Id + " and p.Anulat=0", null);
         if (list.Count != 0)
         {
             //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
             //throw new Exception(string.Format(Resources.Core.EroareAnulareGrupa, list.Count.ToString()));
             throw new Exception(string.Format("Firma nu poate fi anulata! Aveti " + list.Count.ToString() + " persoane alocate!"));
         }
     }
     finally
     {
         list = null;
     }
 }
Esempio n. 5
0
 private void CheckIfContainCelula(DAO_Base dao)
 {
     IList list = null;
     try
     {
         list = dao.ExecuteHql("select c from Celula c inner join c.Hala h " +
         " where h.Id=" + Id + " and c.Anulat=0", null);
         if (list.Count != 0)
         {
             //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
             //throw new Exception(string.Format(Resources.Core.EroareAnulareGrupa, list.Count.ToString()));
             throw new Exception(string.Format("Hala nu poate fi anulata! Aveti "+list.Count.ToString()+ " celule alocate!"));
         }
     }
     finally
     {
         list = null;
     }
 }