public void CheckIfUnique(DAO_Base dao) { if (!this.Anulat) { CheckNumar(dao); } }
public void CheckIfUnique(DAO_Base dao) { if (!this.Anulat) { CheckDenumire(dao); } }
public void CheckCanSave(DAO_Base dao) { //if (this.Denumire == "") //{ // Resources.Core.Culture = Thread.CurrentThread.CurrentCulture; // throw new Exception(Resources.Core.LipsaDenumireGrupa); //} //CheckIfUnique(dao); }
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); }
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!"); } }
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!"); } }
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); //} }
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!"); } }
public void CheckCanDelete(DAO_Base dao) { //Resources.Core.Culture = Thread.CurrentThread.CurrentCulture; //throw new Exception(Resources.Core.EroareStergereGrupa); throw new Exception("Eroare stergere ambalaj!"); }
private void CheckDenumire(DAO_Base dao) { }
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; } }
internal _BusinessBase() { dao = new DAO_Base(); }
//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); }
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; } }