예제 #1
0
        public override GestiuneBusiness.DataHelper.Kernel.PersistenceResult Save()
        {
            PersistenceResult result = new PersistenceResult();

            try
            {
                if (this.ID == 0)
                {
                    this.ID = FirmeDataHelper.GetInstance().Create(PropertiesNamesWithValues);
                    if (firmaList == null)
                    {
                        firmaList = new List <Firma>();
                    }
                    firmaList.Add(this);
                }
                else
                {
                    FirmeDataHelper.GetInstance().Update(PropertiesNamesWithValues, this.ID);
                }
                result.Status  = Enums.StatusEnum.Saved;
                result.Message = StringSaveSuccess;
            }
            catch (Exception ex)
            {
                result.Status            = Enums.StatusEnum.Errors;
                result.Message           = StringSaveFail;
                result.ExceptionOccurred = ex;
            }
            return(result);
        }
예제 #2
0
 //TODO: sa ma scot pe mine de aici ca firma de aici, dupa ce imi fac partea de autoidentificare
 public static List <Firma> GetAll()
 {
     try
     {
         if (firmaList == null)
         {
             firmaList = FirmeDataHelper.GetInstance().GetAll().Cast <Firma>().ToList();
         }
         return(firmaList);
     }
     catch (Exception)
     {
         return(null);
     }
 }