Пример #1
0
        public override GestiuneBusiness.DataHelper.Kernel.PersistenceResult Save()
        {
            PersistenceResult persistenceResult = new PersistenceResult();

            try
            {
                if (this.ID == 0)
                {
                    // obiectul este nou, deci trebuie creat
                    this.ID = FacturiIntrareDataHelper.GetInstance().Create(PropertiesNamesWithValues);
                    if (facturaIntrareList == null)
                    {
                        facturaIntrareList = new List <FacturaIntrare>();
                    }
                    facturaIntrareList.Add(this);
                }

                else
                {
                    FacturiIntrareDataHelper.GetInstance().Update(PropertiesNamesWithValues, this.ID);
                }
                persistenceResult.Status  = Enums.StatusEnum.Saved;
                persistenceResult.Message = StringSaveSuccess;
            }
            catch (Exception ex)
            {
                persistenceResult.Status            = Enums.StatusEnum.Errors;
                persistenceResult.Message           = StringSaveFail;
                persistenceResult.ExceptionOccurred = ex;
            }
            return(persistenceResult);
        }
Пример #2
0
 public static List <FacturaIntrare> GetAll()
 {
     try
     {
         if (facturaIntrareList == null)
         {
             facturaIntrareList = FacturiIntrareDataHelper.GetInstance().GetAll().Cast <FacturaIntrare>().ToList();
         }
         return(facturaIntrareList);
     }
     catch (Exception)
     {
         return(null);
     }
 }