コード例 #1
0
        public override PersistenceResult Save()
        {
            var result = new PersistenceResult();

            try
            {
                if (this.ID == 0)
                {
                    this.ID = PlatiFacturiDataHelper.GetInstance().Create(PropertiesNamesWithValues);
                    if (plataFacturaList == null)
                    {
                        plataFacturaList = new List <PlataFactura>();
                    }
                    plataFacturaList.Add(this);
                }
                else
                {
                    PlatiFacturiDataHelper.GetInstance().Update(PropertiesNamesWithValues, this.ID);
                }
                result.Message = StringSaveSuccess;
                result.Status  = Enums.StatusEnum.Saved;
            }
            catch (Exception ex)
            {
                result.Message           = StringSaveFail;
                result.Status            = Enums.StatusEnum.Errors;
                result.ExceptionOccurred = ex;
            }
            return(result);
        }
コード例 #2
0
 public static List <PlataFactura> GetAll()
 {
     try
     {
         if (plataFacturaList == null)
         {
             plataFacturaList = PlatiFacturiDataHelper.GetInstance().GetAll().Cast <PlataFactura>().ToList();
         }
         return(plataFacturaList);
     }
     catch (Exception)
     {
         return(null);
     }
 }