Exemplo n.º 1
0
        /// <summary>
        /// 添加工作流模板信息
        /// </summary>
        /// <param name="workflowTemplate">工作流模板信息</param>
        /// <returns>返回工作流模板信息</returns>
        public BusinessWorkflowTemplate AddWorkflowTemplate(BusinessWorkflowTemplate workflowTemplate)
        {
            SqlParameterCollection spc = DB.CreateSqlParameterCollection();

            spc.Add("@SystemName", workflowTemplate.SystemName);
            spc.Add("@ModuleName", workflowTemplate.ModuleName);
            spc.Add("@CategoryName", workflowTemplate.CategoryName);

            spc.Add("@TemplateContent", workflowTemplate.TemplateContent);
            spc.Add("@TemplateDesc", workflowTemplate.TemplateDesc);

            workflowTemplate.CreateDateTime = DateTime.Now;
            workflowTemplate.ModifyDateTime = DateTime.Now;

            spc.Add("@CreateDateTime", workflowTemplate.CreateDateTime);
            spc.Add("@ModifyDateTime", workflowTemplate.ModifyDateTime);

            workflowTemplate.TemplateID = getNewTemplateID();
            spc.Add("@TemplateID", workflowTemplate.TemplateID.ToString());

            string sql = "insert into g_BusinessWorkflowTemplate(SystemName, ModuleName, CategoryName, TemplateID, TemplateContent, TemplateDesc, CreateDateTime, ModifyDateTime)"
                         + "values(@SystemName, @ModuleName, @CategoryName, @TemplateID, @TemplateContent, @TemplateDesc, @CreateDateTime, @ModifyDateTime)";

            DB.ExecuteNonQuerySql(sql, spc);

            return(workflowTemplate);
        }
Exemplo n.º 2
0
        private BusinessWorkflowTemplate DataRow2WorkflowTemplate(DataRow dr)
        {
            BusinessWorkflowTemplate template = new BusinessWorkflowTemplate();

            template.SystemName   = dr["SystemName"].ToString();
            template.ModuleName   = dr["ModuleName"].ToString();
            template.CategoryName = dr["CategoryName"].ToString();

            template.TemplateID      = dr["TemplateID"].ToGuid();
            template.TemplateContent = dr["TemplateContent"].ToString();
            template.TemplateDesc    = dr["TemplateDesc"].ToString();

            template.CreateDateTime = dr["CreateDateTime"].ToDateTime();
            template.ModifyDateTime = dr["ModifyDateTime"].ToDateTime();
            return(template);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新工作流模板信息
        /// </summary>
        /// <param name="workflowTemplate">工作流模板信息</param>
        public void UpdateWorkflowTemplate(BusinessWorkflowTemplate workflowTemplate)
        {
            SqlParameterCollection spc = DB.CreateSqlParameterCollection();

            spc.Add("@SystemName", workflowTemplate.SystemName);
            spc.Add("@ModuleName", workflowTemplate.ModuleName);
            spc.Add("@CategoryName", workflowTemplate.CategoryName);

            spc.Add("@TemplateContent", workflowTemplate.TemplateContent);
            spc.Add("@TemplateDesc", workflowTemplate.TemplateDesc);

            workflowTemplate.ModifyDateTime = DateTime.Now;

            spc.Add("@ModifyDateTime", workflowTemplate.ModifyDateTime);

            spc.Add("@TemplateID", workflowTemplate.TemplateID.ToString());

            string sql = "update g_BusinessWorkflowTemplate set SystemName=@SystemName, ModuleName=@ModuleName, CategoryName=@CategoryName, TemplateContent=@TemplateContent, TemplateDesc=@TemplateDesc, ModifyDateTime=@ModifyDateTime where TemplateID=@TemplateID";

            DB.ExecuteNonQuerySql(sql, spc);
        }