public void saveData(FBDataSource model) { try { base.Db.BeginTransaction(); base.Db.Save <FBDataSource>(model); base.Db.Execute(new Sql(@" delete from FBDataSourceCols where DSID =@0 ", model.ID)); foreach (FBDataSourceCols col in model.ColList) { if (string.IsNullOrEmpty(col.ID)) { col.ID = Guid.NewGuid().ToString(); } col.DSID = model.ID; base.Db.Save <FBDataSourceCols>(col); } FBMeta.UpdateMeataInfo(model.Name, model.Code, model.ID, base.Db);//更新元数据编号 this.Db.CompleteTransaction(); } catch (Exception ex) { base.Db.AbortTransaction(); throw ex; } }
public void saveData(FBSmartHelp model) { try { base.Db.BeginTransaction(); base.Db.Save <FBSmartHelp>(model); base.Db.Execute(new Sql(@" delete from FBSmartHelpCols where HelpID =@0 ", model.ID)); int i = 1; foreach (FBSmartHelpCols col in model.ColList) { if (string.IsNullOrEmpty(col.ID)) { col.ID = Guid.NewGuid().ToString(); } col.HelpID = model.ID; col.Ord = i.ToString(); base.Db.Save <FBSmartHelpCols>(col); i++; } saveDependence(model.ID, base.Db); FBMeta.UpdateMeataInfo(model.Name, model.Code, model.ID, base.Db);//更新元数据编号 this.Db.CompleteTransaction(); } catch (Exception ex) { base.Db.AbortTransaction(); throw ex; } }
public void SaveAttr(FBDataModel model) { try { base.Db.BeginTransaction(); base.Db.Save <FBDataModel>(model); FBMeta.UpdateMeataInfo(model.Name, model.Code, model.ID, base.Db);//更新元数据编号 this.Db.CompleteTransaction(); } catch (Exception ex) { base.Db.AbortTransaction(); throw ex; } }
public void saveData(FBComponent model) { try { base.Db.BeginTransaction(); base.Db.Save <FBComponent>(model); base.Db.Execute(new Sql(@" delete from FBCMPMethod where CMPID =@0 ", model.ID)); foreach (FBCMPMethod col in model.MethodList) { if (string.IsNullOrEmpty(col.ID)) { col.ID = Guid.NewGuid().ToString(); } col.CMPID = model.ID; base.Db.Save <FBCMPMethod>(col); base.Db.Execute(new Sql(@" delete from FBCMPPara where MethodID =@0 ", col.ID)); foreach (FBCMPPara para in col.ParaList) { if (string.IsNullOrEmpty(para.ID)) { para.ID = Guid.NewGuid().ToString(); } para.CMPID = model.ID; para.MethodID = col.ID; base.Db.Save <FBCMPPara>(para); } } FBMeta.UpdateMeataInfo(model.Name, model.Code, model.ID, base.Db);//更新元数据编号 this.Db.CompleteTransaction(); } catch (Exception ex) { base.Db.AbortTransaction(); throw ex; } }
public void AddData(FBDataObject model) { try { base.BeginTransaction(); if (string.IsNullOrEmpty(model.TableName)) { model.TableName = model.Code; } base.Save(model); var list = model.ColList; if (string.IsNullOrEmpty(model.ID)) { model.ID = Guid.NewGuid().ToString(); } base.Db.Execute(new Sql("delete from FBDataObjectCols where ObjectID=@0", model.ID)); int i = 0; foreach (FBDataObjectCols col in list) { if (string.IsNullOrEmpty(col.ID)) { col.ID = Guid.NewGuid().ToString(); col.ObjectID = model.ID; } col.Ord = i.ToString(); i++; this.Db.Save <FBDataObjectCols>(col); } FBMeta.UpdateMeataInfo(model.AiasName, model.Code, model.ID, base.Db);//更新元数据编号 this.CompleteTransaction(); } catch (Exception ex) { this.AbortTransaction(); throw ex; } }