예제 #1
0
 ///<summary>Includes all attached fields.  Intelligently inserts, updates, or deletes old fields.</summary>
 ///<param name="isOldSheetDuplicate">True if the sheetDef being created is a copy of a custom sheet that has a DateTCreated of 0001-01-01.
 ///DateTCreated determines whether or not text fields will be shifted up 5 pixels when PDF is created from sheet to fix bug job B16020.</param>
 public static long InsertOrUpdate(SheetDef sheetDef, bool isOldSheetDuplicate = false)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         sheetDef.SheetDefNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sheetDef, isOldSheetDuplicate);
         return(sheetDef.SheetDefNum);
     }
     if (sheetDef.IsNew)
     {
         if (!isOldSheetDuplicate)
         {
             sheetDef.DateTCreated = MiscData.GetNowDateTime();
         }
         sheetDef.SheetDefNum = Crud.SheetDefCrud.Insert(sheetDef);
     }
     else
     {
         Crud.SheetDefCrud.Update(sheetDef);
     }
     foreach (SheetFieldDef field in sheetDef.SheetFieldDefs)
     {
         field.SheetDefNum = sheetDef.SheetDefNum;
     }
     SheetFieldDefs.Sync(sheetDef.SheetFieldDefs, sheetDef.SheetDefNum);
     return(sheetDef.SheetDefNum);
 }
예제 #2
0
 ///<summary>Includes all attached fields.  Intelligently inserts, updates, or deletes old fields.</summary>
 public static long InsertOrUpdate(SheetDef sheetDef)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         sheetDef.SheetDefNum = Meth.GetLong(MethodBase.GetCurrentMethod(), sheetDef);
         return(sheetDef.SheetDefNum);
     }
     if (sheetDef.IsNew)
     {
         sheetDef.SheetDefNum = Crud.SheetDefCrud.Insert(sheetDef);
     }
     else
     {
         Crud.SheetDefCrud.Update(sheetDef);
     }
     foreach (SheetFieldDef field in sheetDef.SheetFieldDefs)
     {
         field.SheetDefNum = sheetDef.SheetDefNum;
     }
     SheetFieldDefs.Sync(sheetDef.SheetFieldDefs, sheetDef.SheetDefNum);
     return(sheetDef.SheetDefNum);
 }