Exemplo n.º 1
0
        public override PersistenceResult Save()
        {
            var persistenceResult = new PersistenceResult();

            try
            {
                if (this.ID == 0)
                {
                    this.ID = RoluriDrepturiDataHelper.GetInstance().Create(PropertiesNamesWithValues);
                    if (rolDreptList == null)
                    {
                        rolDreptList = new List <RolDrept>();
                    }
                    rolDreptList.Add(this);
                }
                else
                {
                    RoluriDrepturiDataHelper.GetInstance().Update(PropertiesNamesWithValues, this.ID);
                }
                persistenceResult.Message = StringSaveSuccess;
                persistenceResult.Status  = StatusEnum.Saved;
            }
            catch (Exception ex)
            {
                persistenceResult.Message           = StringSaveFail;
                persistenceResult.Status            = StatusEnum.Errors;
                persistenceResult.ExceptionOccurred = ex;
            }
            return(persistenceResult);
        }
Exemplo n.º 2
0
 public static List <RolDrept> GetAll()
 {
     try
     {
         if (rolDreptList == null)
         {
             rolDreptList = RoluriDrepturiDataHelper.GetInstance().GetAll().Cast <RolDrept>().ToList();
         }
         return(rolDreptList);
     }
     catch (Exception)
     {
         return(null);
     }
 }