Example #1
0
 public static YearDim GetDefault(Session session)
 {
     if (_Default == null)
     {
         _Default = session.FindObject <YearDim>(new BinaryOperator("Name", DEFAULT));
     }
     return(_Default);
 }
Example #2
0
 public static void Populate()
 {
     using (UnitOfWork uow = XpoHelper.GetNewUnitOfWork())
     {
         YearDim defaultYearDim = uow.FindObject <YearDim>(new BinaryOperator("Name", DEFAULT));//check is Exist
         if (defaultYearDim == null)
         {
             defaultYearDim = new YearDim(uow) //Create new record
             {
                 Name        = DEFAULT,        //DEFAUL="2014"
                 Description = "DEFAUL",
                 RowStatus   = 1
             };
             uow.CommitChanges();//Save
         }
     }
 }