private void addGlobalRow(String key, String value) { GlobalsDO newGlobal = new GlobalsDO(cdDAL); newGlobal.Block = "CruiseDesign"; newGlobal.Key = key; newGlobal.Value = value; newGlobal.Save(); }
private static void SetLastMergeDate(DAL db, string dateStr) { GlobalsDO data = new GlobalsDO(db) { Block = "Comp", Key = "LastMerge", Value = dateStr }; data.Save(FMSC.ORM.Core.SQL.OnConflictOption.Replace); }
public void SetValues(GlobalsDO obj) { if(obj == null) { return; } Block = obj.Block; Key = obj.Key; Value = obj.Value; }
public GlobalsDO(GlobalsDO obj) : this() { SetValues(obj); }
protected void MakeComponents(DAL parentDB, int numComponents) { //start up the progress bar int totalSteps = numComponents + 4; View.InitializeAndShowProgress(totalSteps); if (!_doesMasterExist) { //initialize a master component file //create a master component by creating a copy of the parent parentDB.CopyTo(_masterPath); MasterDAL = new DAL(_masterPath); ////clean the master file, any field data from the original file will be removed //ClearFieldData(masterDAL); } View.StepProgressBar();///////////////////////////////////////////////// //insert component records into the master file List<ComponentDO> componentInfo = BuildMasterComponentTable(MasterDAL, numComponents); View.StepProgressBar();///////////////////////////////////////////////// int curCompNum = 1; String saveDir = GetSaveDir(MasterDAL.Path); foreach (ComponentDO comp in componentInfo) { String compPath = string.Format("{0}\\{1}", saveDir, comp.FileName);//extrapolate the path of the comp file if (!File.Exists(compPath)) { CreateComponent(MasterDAL, curCompNum++, comp, compPath); } View.StepProgressBar();////////////////////////////////////////////// } //create count record copies in the master for each component MasterDAL.Execute(SQL.MAKE_COUNTS_FOR_COMPONENTS); View.StepProgressBar();///////////////////////////////////////////////// //add some meta data to the master GlobalsDO lastMergeEntry = new GlobalsDO(MasterDAL) { Block = "Comp", Key = "LastMerge", Value = string.Empty }; lastMergeEntry.Save(OnConflictOption.Ignore); GlobalsDO numCompEntry = new GlobalsDO(MasterDAL) { Block = "Comp", Key = "ChildComponents", Value = numComponents.ToString() }; numCompEntry.Save(OnConflictOption.Replace); View.StepProgressBar();///////////////////////////////////////////////// View.HideProgressBar(); }