Пример #1
0
		/// <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;
            }
		}
Пример #2
0
        /// <summary>
        /// 获得所有子表单
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllChildUserControls()
        {
            try
            {
                string tmpStr = "select * from UserControls order by ucCaption";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = tmpStr;
                ClientDBAgent agent = new ClientDBAgent();
                return agent.ExecuteDataTable(sqlItem);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        /// <summary>
        /// 获得子表单隶属的主表单
        /// </summary>
        /// <returns></returns>
        public static DataTable GetMainCtrlsOfChild(string userControlId)
        {
            try
            {
                string tmpStr = "select * from UserControlsView where UserControlId=@UserControlId order by mucCaption";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = tmpStr;
                sqlItem.AppendParameter("@userControlId", userControlId);
                ClientDBAgent agent = new ClientDBAgent();
                return agent.ExecuteDataTable(sqlItem);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #4
0
        /// <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;
            }
        }
Пример #5
0
 /// <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;
     }
 }
Пример #6
0
        public static bool Exists(string workFlowid)
        {
            string tmpSql = "select * from workflow where workflowId=@workFlowid";
            SqlDataItem sqlItem = new SqlDataItem();
            sqlItem.AppendParameter("@workFlowid", workFlowid);
            sqlItem.CommandText = tmpSql;
            ClientDBAgent agent = new ClientDBAgent();
            return agent.RecordExists(sqlItem);

        }
Пример #7
0
 /// <summary>
 /// 获得工作流模板信息
 /// </summary>
 /// <param name="workflowId">流程模板名称</param>
 /// <returns></returns>
 public static DataTable GetWorkflowsByCaption(string workflowCaption)
 {
    
     string tmpStr = "select * from workflow where FlowCaption like @workflowCaption";
     try
     {
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = tmpStr;
         sqlItem.AppendParameter("@workflowCaption", "%" + workflowCaption + "%");
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteDataTable(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
 public static DataTable GetWorkFlowAllControlsTable(string workflowId)
 {
     try
     {
         string tmpStr = "select  * from worktaskControls where WorkFlowId=@workflowId";
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = tmpStr;
         sqlItem.AppendParameter("@workflowId", workflowId);
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteDataTable(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #9
0
 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;
     }
 }
Пример #10
0
		/// <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;
			}

		}