예제 #1
0
파일: Plata.cs 프로젝트: uaandrei/G35T1UN3
        public override GestiuneBusiness.DataHelper.Kernel.PersistenceResult Save()
        {
            var result = new PersistenceResult();

            try
            {
                if (this.ID == 0)
                {
                    this.ID = PlatiDataHelper.GetInstance().Create(PropertiesNamesWithValues);
                    if (plataList == null)
                    {
                        plataList = new List <Plata>();
                    }
                    plataList.Add(this);
                }
                else
                {
                    PlatiDataHelper.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
파일: Plata.cs 프로젝트: uaandrei/G35T1UN3
 public static List <Plata> GetAll()
 {
     try
     {
         if (plataList == null)
         {
             plataList = PlatiDataHelper.GetInstance().GetAll().Cast <Plata>().ToList();
         }
         return(plataList);
     }
     catch (Exception)
     {
         return(null);
     }
 }