Esempio n. 1
0
 public void CheckIfUnique(DAO_Base dao)
 {
     if (!this.Anulat)
     {
         CheckNumar(dao);
     }
 }
Esempio n. 2
0
 public void CheckIfUnique(DAO_Base dao)
 {
     if (!this.Anulat)
     {
         CheckDenumire(dao);
     }
 }
Esempio n. 3
0
        public void CheckCanSave(DAO_Base dao)
        {
            //if (this.Denumire == "")
            //{
            //    Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
            //    throw new Exception(Resources.Core.LipsaDenumireGrupa);
            //}

            //CheckIfUnique(dao);
        }
Esempio n. 4
0
        public void CheckCanSave(DAO_Base dao)
        {
            if (this.Denumire == "")
            {
                //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
                //throw new Exception(Resources.Core.LipsaDenumireGrupa);
                throw new Exception("Denumirea nu poate fi goala!");
            }

            CheckIfUnique(dao);
        }
Esempio n. 5
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. 6
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. 7
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, Resources.Core.GrupaDublata);
            //}
        }
Esempio n. 8
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. 9
0
 public void CheckCanDelete(DAO_Base dao)
 {
     //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture;
     //throw new Exception(Resources.Core.EroareStergereGrupa);
     throw new Exception("Eroare stergere ambalaj!");
 }
Esempio n. 10
0
 private void CheckDenumire(DAO_Base dao)
 {
 }
Esempio n. 11
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. 12
0
 internal _BusinessBase()
 {
     dao = new DAO_Base();
 }
Esempio n. 13
0
 //public string Parse()
 //{
 //    string ret = "";
 //    if (this.Anulat)
 //    {
 //        ret = this.Id + "#";
 //    }
 //    else
 //    {
 //        ret = this.Id + "#" + this.Denumire + "#" + this.Greutate;
 //    }
 //    return ret;
 //}
 //public string ParseAnulat()
 //{
 //    string ret = "";
 //    ret = this.Id + "##";
 //    return ret;
 //}
 public void CheckIfUnique(DAO_Base dao)
 {
     CheckDenumire(dao);
 }
Esempio n. 14
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;
     }
 }