/// <summary> /// 新建 子表单 /// </summary> public void InsertUserControl() { if (UserControlId.Trim().Length == 0 || UserControlId == null) throw new Exception("InsertUserControl方法错误,UserControlId 不能为空!"); if (ucCaption.Trim().Length == 0 || ucCaption == null) throw new Exception("InsertUserControl方法错误,ucCaption 不能为空!"); try { setInsertSql();//设定insert语句 setParameter();//设定参数 ClientDBAgent agent = new ClientDBAgent(); agent.ExecuteNonQuery(sqlDataItem); } catch (Exception ex) { throw ex; } }
/// <summary> /// 删除子表单隶属的组关系 /// </summary> /// <param name="userControlId"></param> /// <returns></returns> public static int DeleteMainCtrlsOfUser(string userControlId) { if (userControlId.Trim().Length == 0 || userControlId == null) throw new Exception("DeleteMainCtrlsOfUser方法错误,userControlId 不能为空!"); try { string sqlStr = "delete from UserControlsLink where userControlId=@userControlId"; SqlDataItem sqlItem = new SqlDataItem(); sqlItem.CommandText = sqlStr; sqlItem.AppendParameter("@userControlId", userControlId); ClientDBAgent agent = new ClientDBAgent(); return agent.ExecuteNonQuery(sqlItem); } catch (Exception ex) { throw ex; } }
public static int DeleteWorkFlow(string workflowId) { if (workflowId.Trim().Length == 0 || workflowId == null) throw new Exception("DeleteWorkFlow方法错误,workflowId 不能为空!"); try { SqlDataItem sqlItem = new SqlDataItem(); sqlItem.CommandText = "DeleteWorkflow"; sqlItem.CommandType = CommandType.StoredProcedure; sqlItem.AppendParameter("@WorkflowId", workflowId); ClientDBAgent agent = new ClientDBAgent(); return agent.ExecuteNonQuery(sqlItem); } catch (Exception ex) { throw ex; } }
/// <summary> /// 设置流程分类 /// </summary> /// <param name="workflowId">流程模板Id</param> /// <param name="wfclassid">流程分类Id</param> /// <returns></returns> public static int SetWorkflowClass(string workflowId,string wfclassid) { try { string tmpSql = "update workflow set wfclassId=@wfclassid where WorkFlowId=@workflowId"; SqlDataItem sqlItem = new SqlDataItem(); sqlItem.CommandText = tmpSql; sqlItem.AppendParameter("@workflowId", workflowId); sqlItem.AppendParameter("@wfclassid", wfclassid); ClientDBAgent agent = new ClientDBAgent(); return agent.ExecuteNonQuery(sqlItem); } catch (Exception ex) { throw ex; } }
/// <summary> /// 修改一个流程模板 /// </summary> public void UpdateWorkFlow() { if (WorkFlowId.Trim().Length==0||WorkFlowId==null) throw new Exception("UpdateWorkFlow方法错误,WorkFlowId 不能为空!"); try { setUpdateSql();//设定定Update语句 setParameter();//设定参数 ClientDBAgent agent = new ClientDBAgent(); agent.ExecuteNonQuery(sqlDataItem); } catch(Exception ex) { throw ex; } }