/// <summary> /// 执行 /// </summary> /// <returns>返回执行结果</returns> public override object Do() { FrmLines ens = new FrmLines(); ens.RetrieveAllFromDBSource(); string sql = ""; foreach (FrmLine item in ens) { sql = "DELETE FROM " + item.EnMap.PhysicsTable + " WHERE FK_MapData='" + item.FK_MapData + "' AND x1=" + item.X1 + " and x2=" + item.X2 + " and y1=" + item.Y1 + " and y2=" + item.Y2; DBAccess.RunSQL(sql); item.MyPK = BP.DA.DBAccess.GenerOIDByGUID().ToString(); item.Insert(); } FrmLabs labs = new FrmLabs(); labs.RetrieveAllFromDBSource(); foreach (FrmLab item in labs) { sql = "DELETE FROM " + item.EnMap.PhysicsTable + " WHERE FK_MapData='" + item.FK_MapData + "' and x=" + item.X + " and y=" + item.Y + " and Text='" + item.Text + "'"; DBAccess.RunSQL(sql); item.MyPK = BP.DA.DBAccess.GenerOIDByGUID().ToString(); item.Insert(); } return("删除成功"); }
public void FillGrid(FrmLabs frmLab, int LabID) { var trainees = (from t in context.Trainee where t.LabID == LabID select t).ToList();//).firstordefault(); frmLab.dgTrainee.ItemsSource = trainees; frmLab.dgTrainee.IsReadOnly = true; }
public void FillCombo(FrmLabs frmLab) { var Labs = from L in context.Lab select L; foreach (var item in Labs) { frmLab.CmBoxLab.DisplayMemberPath = "Name"; frmLab.CmBoxLab.SelectedValuePath = "ID"; frmLab.CmBoxLab.Items.Add(item); } }
/// <summary> /// 生成所有表单元素. /// </summary> /// <returns></returns> public string CCForm_AllElements_ResponseJson() { try { DataSet ds = new DataSet(); MapData mapData = new MapData(this.FK_MapData); //属性. MapAttrs attrs = new MapAttrs(this.FK_MapData); attrs.Retrieve(MapAttrAttr.FK_MapData, this.FK_MapData, MapAttrAttr.UIVisible, 1); ds.Tables.Add(attrs.ToDataTableField("Sys_MapAttr")); FrmBtns btns = new FrmBtns(this.FK_MapData); ds.Tables.Add(btns.ToDataTableField("Sys_FrmBtn")); FrmRBs rbs = new FrmRBs(this.FK_MapData); ds.Tables.Add(rbs.ToDataTableField("Sys_FrmRB")); FrmLabs labs = new FrmLabs(this.FK_MapData); ds.Tables.Add(labs.ToDataTableField("Sys_FrmLab")); FrmLinks links = new FrmLinks(this.FK_MapData); ds.Tables.Add(links.ToDataTableField("Sys_FrmLink")); FrmImgs imgs = new FrmImgs(this.FK_MapData); ds.Tables.Add(imgs.ToDataTableField("Sys_FrmImg")); FrmImgAths imgAths = new FrmImgAths(this.FK_MapData); ds.Tables.Add(imgAths.ToDataTableField("Sys_FrmImgAth")); FrmAttachments aths = new FrmAttachments(this.FK_MapData); ds.Tables.Add(aths.ToDataTableField("Sys_FrmAttachment")); MapDtls dtls = new MapDtls(this.FK_MapData); ds.Tables.Add(dtls.ToDataTableField("Sys_MapDtl")); FrmLines lines = new FrmLines(this.FK_MapData); ds.Tables.Add(lines.ToDataTableField("Sys_FrmLine")); BP.Sys.FrmUI.MapFrameExts mapFrameExts = new BP.Sys.FrmUI.MapFrameExts(this.FK_MapData); ds.Tables.Add(mapFrameExts.ToDataTableField("Sys_MapFrame")); //组织节点组件信息. string sql = ""; if (this.FK_Node > 100) { sql += "select '轨迹图' AS Name,'FlowChart' AS No,FrmTrackSta Sta,FrmTrack_X X,FrmTrack_Y Y,FrmTrack_H H,FrmTrack_W W from WF_Node WHERE nodeid=" + SystemConfig.AppCenterDBVarStr + "nodeid"; sql += " union select '审核组件'AS Name, 'FrmCheck'AS No,FWCSta Sta,FWC_X X,FWC_Y Y,FWC_H H, FWC_W W from WF_Node WHERE nodeid=" + SystemConfig.AppCenterDBVarStr + "nodeid"; sql += " union select '子流程' AS Name,'SubFlowDtl'AS No,SFSta Sta,SF_X X,SF_Y Y,SF_H H, SF_W W from WF_Node WHERE nodeid=" + SystemConfig.AppCenterDBVarStr + "nodeid"; sql += " union select '子线程' AS Name, 'ThreadDtl'AS No,FrmThreadSta Sta,FrmThread_X X,FrmThread_Y Y,FrmThread_H H,FrmThread_W W from WF_Node WHERE nodeid=" + SystemConfig.AppCenterDBVarStr + "nodeid"; sql += " union select '流转自定义' AS Name,'FrmTransferCustom' AS No,FTCSta Sta,FTC_X X,FTC_Y Y,FTC_H H,FTC_W W FROM WF_Node WHERE nodeid=" + SystemConfig.AppCenterDBVarStr + "nodeid"; Paras ps = new Paras(); ps.SQL = sql; ps.Add("nodeid", this.FK_Node); DataTable dt = null; try { dt = DBAccess.RunSQLReturnTable(ps); } catch (Exception ex) { FrmSubFlow sb = new FrmSubFlow(); sb.CheckPhysicsTable(); TransferCustom tc = new TransferCustom(); tc.CheckPhysicsTable(); FrmThread ft = new FrmThread(); ft.CheckPhysicsTable(); FrmTrack ftd = new FrmTrack(); ftd.CheckPhysicsTable(); FrmTransferCustom ftd1 = new FrmTransferCustom(); ftd1.CheckPhysicsTable(); throw ex; } dt.TableName = "FigureCom"; if (SystemConfig.AppCenterDBType == DBType.Oracle || SystemConfig.AppCenterDBType == DBType.PostgreSQL) { // figureComCols = "Name,No,Sta,X,Y,H,W"; dt.Columns[0].ColumnName = "Name"; dt.Columns[1].ColumnName = "No"; dt.Columns[2].ColumnName = "Sta"; dt.Columns[3].ColumnName = "X"; dt.Columns[4].ColumnName = "Y"; dt.Columns[5].ColumnName = "H"; dt.Columns[6].ColumnName = "W"; } ds.Tables.Add(dt); } return(BP.Tools.Json.ToJson(ds)); } catch (Exception ex) { return("err@" + ex.Message); } }