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