Example #1
0
 public void CheckIfUnique(DAO_Base dao)
 {
     if (!this.Anulat)
     {
         CheckNumar(dao);
     }
 }
Example #2
0
 public void CheckIfUnique(DAO_Base dao)
 {
     if (!this.Anulat)
     {
         CheckDenumire(dao);
     }
 }
Example #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);
        }
Example #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);
        }
Example #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!");
            }
        }
Example #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!");
            }
        }
Example #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);
            //}
        }
Example #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!");
            }
        }
Example #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!");
 }
Example #10
0
 private void CheckDenumire(DAO_Base dao)
 {
 }
Example #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;
     }
 }
Example #12
0
 internal _BusinessBase()
 {
     dao = new DAO_Base();
 }
Example #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);
 }
Example #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;
     }
 }