コード例 #1
0
ファイル: WorkFlowClass.cs プロジェクト: s7loves/mypowerscgl
        /// <summary>
        /// 删除流程分类
        /// </summary>
        /// <param name="workflowClassId">流程分类Id</param>
        /// <returns></returns>
        public static int DeleteWorkflowClass(string workflowClassId)
        {
            try
            {
                //string tmpSql = " where WFClassId=@WFClassId";
                
                //SqlDataItem sqlItem = new SqlDataItem();
                //sqlItem.CommandText = tmpSql;
                //sqlItem.AppendParameter("@WFClassId", workflowClassId);
                //ClientDBAgent agent = new ClientDBAgent();
                WF_WorkFlowClass wf = new WF_WorkFlowClass();
                wf.WFClassId = workflowClassId;
                return MainHelper.PlatformSqlMap.Delete <WF_WorkFlowClass>(wf);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
ファイル: WorkFlowClass.cs プロジェクト: s7loves/mypowerscgl
        //private void setParameter()
        //{
        //    sqlDataItem.ParameterList.Clear();
        //    sqlDataItem.AppendParameter("@WFClassId", WorkflowClassId);
        //    sqlDataItem.AppendParameter("@Caption", WorkflowClassCaption);
        //    sqlDataItem.AppendParameter("@FatherId", WorkflowFatherClassId);
        //    sqlDataItem.AppendParameter("@Description", Description);
        //    sqlDataItem.AppendParameter("@cllevel", clLevel,typeof(int));
        //    sqlDataItem.AppendParameter("@clMgrUrl", MgrUrl);



        //}
        //private void setInsertSql()
        //{
        //    string tmpValueList = "";
        //    string tmpFieldName = "";
        //    sqlString = "insert into " + tableName + "(";
        //    int tmpInt = this.fieldList.Length;
        //    for (int i = 0; i < tmpInt - 1; i++)
        //    {
        //        tmpFieldName = fieldList[i].ToString();
        //        sqlString = sqlString + tmpFieldName + ",";
        //        tmpValueList = tmpValueList + "@" + tmpFieldName + ",";

        //    }
        //    tmpFieldName = this.fieldList[tmpInt - 1].ToString();
        //    sqlString = sqlString + tmpFieldName;
        //    tmpValueList = tmpValueList + "@" + tmpFieldName;
        //    this.sqlString = sqlString + ")values(" + tmpValueList + ")";
        //    sqlDataItem.CommandText = sqlString;
        //}
        //private void setUpdateSql()
        //{
        //    string tmpFieldName = "";
        //    int tmpInt = this.fieldList.Length;
        //    sqlString = "update " + tableName + " set ";
        //    for (int i = 0; i < tmpInt - 1; i++)
        //    {
        //        tmpFieldName = this.fieldList[i].ToString();
        //        sqlString = sqlString + tmpFieldName + "=@" + tmpFieldName + ",";

        //    }
        //    tmpFieldName = fieldList[tmpInt - 1].ToString();
        //    sqlString = sqlString + tmpFieldName + "=@" + tmpFieldName;
        //    sqlString = sqlString + " where " + keyField + "=@" + this.keyField;
        //    sqlDataItem.CommandText = sqlString;
        //}

        /// <summary>
        /// 新建 一个流程模板
        /// </summary>
        public void InsertWorkflowClass()
        {
            if (WorkflowClassId.Trim().Length == 0 || WorkflowClassId == null)
                throw new Exception("InsertWorkFlowClass方法错误,WorkflowClassId 不能为空!");

            try
            {
                //setInsertSql();//设定insert语句
                //setParameter();//设定参数
                //ClientDBAgent agent = new ClientDBAgent();
                //agent.ExecuteNonQuery(sqlDataItem);
                WF_WorkFlowClass wf = new WF_WorkFlowClass();
                
                wf.WFClassId=WorkflowClassId;
                wf.Caption=WorkflowClassCaption;
                wf.FatherId= WorkflowFatherClassId;
                wf.Description=Description;
                wf.clLevel= clLevel;
                wf.clMgrUrl= MgrUrl;
                MainHelper.PlatformSqlMap.Create<WF_WorkFlowClass>(wf);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }