Beispiel #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            Workflow_NodeOperatorDetailEntity _NodeOperatorDetailEntity = new Workflow_NodeOperatorDetailEntity();
            _NodeOperatorDetailEntity.RuleID = 0;
            _NodeOperatorDetailEntity.NodeID = DNTRequest.GetInt("id", 0);
            _NodeOperatorDetailEntity.RuleType = Convert.ToInt32(ddlOperatorTypeDetail.SelectedValue);
            _NodeOperatorDetailEntity.RuleCondition = "(1=1)";
            if (rblOperatorType.SelectedValue == "10")
            {
                _NodeOperatorDetailEntity.ObjectValue = txtObjectValue.Value;
                _NodeOperatorDetailEntity.RuleName = txtObjectValueN.Text;
            }
            else if (rblOperatorType.SelectedValue == "20" || rblOperatorType.SelectedValue == "30" || rblOperatorType.SelectedValue == "50")
            {
                _NodeOperatorDetailEntity.ObjectValue = ddlObjectValue.SelectedValue;
                _NodeOperatorDetailEntity.RuleName = ddlObjectValue.SelectedItem.Text;
            }
            else if (rblOperatorType.SelectedValue == "40")
            {
                _NodeOperatorDetailEntity.ObjectValue = "";
                _NodeOperatorDetailEntity.RuleName = ddlOperatorTypeDetail.SelectedItem.Text;
            }
            _NodeOperatorDetailEntity.RuleSeq = txtRuleSeq.Text != "" ? Convert.ToInt32(txtRuleSeq.Text) : 10;
            _NodeOperatorDetailEntity.SecurityStart = 0;
            _NodeOperatorDetailEntity.SecurityEnd = 100;
            _NodeOperatorDetailEntity.LevelStart = txtLevelS.Text != "" ? Convert.ToInt32(txtLevelS.Text) : 5;
            _NodeOperatorDetailEntity.LevelEnd = txtLevelE.Text != "" ? Convert.ToInt32(txtLevelE.Text) : 1;
            _NodeOperatorDetailEntity.SignType = chkSignType.Checked ? 1 : 0;
            DbHelper.GetInstance().AddWorkflow_NodeOperatorDetail(_NodeOperatorDetailEntity);

            string NodeID = DNTRequest.GetString("id");
            Workflow_FlowNodeEntity _FlowNodeEntity = DbHelper.GetInstance().GetWorkflow_FlowNodeEntityByKeyCol(NodeID);
            DbHelper.GetInstance().sp_GeneratorWorkflowCreatorList(_FlowNodeEntity.WorkflowID.ToString());

            BindGridView();
        }
Beispiel #2
0
 private Workflow_NodeOperatorDetailEntity GetWorkflow_NodeOperatorDetailFromIDataReader(DbDataReader dr)
 {
     Workflow_NodeOperatorDetailEntity dt = new Workflow_NodeOperatorDetailEntity();
     if (dr.FieldCount > 0)
     {
         if (dr["RuleID"].ToString() != "" || dr["RuleID"] != null) dt.RuleID = Int32.Parse(dr["RuleID"].ToString());
         if (dr["NodeID"].ToString() != "" || dr["NodeID"] != null) dt.NodeID = Int32.Parse(dr["NodeID"].ToString());
         if (dr["RuleType"].ToString() != "" || dr["RuleType"] != null) dt.RuleType = Int32.Parse(dr["RuleType"].ToString());
         dt.RuleCondition = dr["RuleCondition"].ToString();
         dt.ObjectValue = dr["ObjectValue"].ToString();
         dt.RuleName = dr["RuleName"].ToString();
         if (dr["RuleSeq"].ToString() != "" || dr["RuleSeq"] != null) dt.RuleSeq = Int32.Parse(dr["RuleSeq"].ToString());
         if (dr["SecurityStart"].ToString() != "" || dr["SecurityStart"] != null) dt.SecurityStart = Int32.Parse(dr["SecurityStart"].ToString());
         if (dr["SecurityEnd"].ToString() != "" || dr["SecurityEnd"] != null) dt.SecurityEnd = Int32.Parse(dr["SecurityEnd"].ToString());
         if (dr["LevelStart"].ToString() != "" || dr["LevelStart"] != null) dt.LevelStart = Int32.Parse(dr["LevelStart"].ToString());
         if (dr["LevelEnd"].ToString() != "" || dr["LevelEnd"] != null) dt.LevelEnd = Int32.Parse(dr["LevelEnd"].ToString());
         if (dr["SignType"].ToString() != "" || dr["SignType"] != null) dt.SignType = Int32.Parse(dr["SignType"].ToString());
         dr.Close();
         return dt;
     }
     dr.Close();
     return null;
 }
Beispiel #3
0
 /// <summary>
 /// 修改信息
 /// </summary>
 /// <param name="_Workflow_NodeOperatorDetailEntity"></param>
 /// <returns>返回string "-1"表示该已经存在,否则成功 </returns>
 public string UpdateWorkflow_NodeOperatorDetail(Workflow_NodeOperatorDetailEntity _Workflow_NodeOperatorDetailEntity)
 {
     DbParameter[] pramsUpdate = {
                                MakeInParam("@RuleID",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.RuleID ),
                                MakeInParam("@NodeID",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.NodeID ),
                                MakeInParam("@RuleType",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.RuleType ),
                                MakeInParam("@RuleCondition",(DbType)SqlDbType.VarChar,2000,_Workflow_NodeOperatorDetailEntity.RuleCondition ),
                                MakeInParam("@ObjectValue",(DbType)SqlDbType.VarChar,2000,_Workflow_NodeOperatorDetailEntity.ObjectValue ),
                                MakeInParam("@RuleName",(DbType)SqlDbType.VarChar,200,_Workflow_NodeOperatorDetailEntity.RuleName ),
                                MakeInParam("@RuleSeq",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.RuleSeq ),
                                MakeInParam("@SecurityStart",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SecurityStart ),
                                MakeInParam("@SecurityEnd",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SecurityEnd ),
                                MakeInParam("@LevelStart",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.LevelStart ),
                                MakeInParam("@LevelEnd",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.LevelEnd ),
                                MakeInParam("@SignType",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SignType ),
                                      };
     StringBuilder sb = new StringBuilder();
     sb.Append("Update [dbo].[Workflow_NodeOperatorDetail]");
     sb.Append(" set ");
     sb.Append(" [NodeID]=@NodeID,");
     sb.Append(" [RuleType]=@RuleType,");
     sb.Append(" [RuleCondition]=@RuleCondition,");
     sb.Append(" [ObjectValue]=@ObjectValue,");
     sb.Append(" [RuleName]=@RuleName,");
     sb.Append(" [RuleSeq]=@RuleSeq,");
     sb.Append(" [SecurityStart]=@SecurityStart,");
     sb.Append(" [SecurityEnd]=@SecurityEnd,");
     sb.Append(" [LevelStart]=@LevelStart,");
     sb.Append(" [LevelEnd]=@LevelEnd,");
     sb.Append(" [SignType]=@SignType ");
     sb.Append(" where [RuleID]=@RuleID ");
     return ExecuteNonQuery(CommandType.Text, sb.ToString(), pramsUpdate).ToString();
 }
Beispiel #4
0
 /// <summary>
 /// 新增信息
 /// </summary>
 /// <param name="_Workflow_NodeOperatorDetailEntity"></param>
 /// <returns>返回string "-1"表示该已经存在,否则成功 </returns>
 public string AddWorkflow_NodeOperatorDetail(Workflow_NodeOperatorDetailEntity _Workflow_NodeOperatorDetailEntity)
 {
     DbParameter[] pramsInsert = {
                                MakeInParam("@NodeID",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.NodeID ),
                                MakeInParam("@RuleType",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.RuleType ),
                                MakeInParam("@RuleCondition",(DbType)SqlDbType.VarChar,2000,_Workflow_NodeOperatorDetailEntity.RuleCondition ),
                                MakeInParam("@ObjectValue",(DbType)SqlDbType.VarChar,2000,_Workflow_NodeOperatorDetailEntity.ObjectValue ),
                                MakeInParam("@RuleName",(DbType)SqlDbType.VarChar,200,_Workflow_NodeOperatorDetailEntity.RuleName ),
                                MakeInParam("@RuleSeq",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.RuleSeq ),
                                MakeInParam("@SecurityStart",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SecurityStart ),
                                MakeInParam("@SecurityEnd",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SecurityEnd ),
                                MakeInParam("@LevelStart",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.LevelStart ),
                                MakeInParam("@LevelEnd",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.LevelEnd ),
                                MakeInParam("@SignType",(DbType)SqlDbType.Int,4,_Workflow_NodeOperatorDetailEntity.SignType ),
                                  };
     StringBuilder sb = new StringBuilder();
     sb.Append("INSERT INTO [dbo].[Workflow_NodeOperatorDetail]");
     sb.Append("(");
     sb.Append(" [NodeID]");
     sb.Append(",[RuleType]");
     sb.Append(",[RuleCondition]");
     sb.Append(",[ObjectValue]");
     sb.Append(",[RuleName]");
     sb.Append(",[RuleSeq]");
     sb.Append(",[SecurityStart]");
     sb.Append(",[SecurityEnd]");
     sb.Append(",[LevelStart]");
     sb.Append(",[LevelEnd]");
     sb.Append(",[SignType]");
     sb.Append(") ");
     sb.Append(" VALUES (");
     sb.Append("@NodeID,");
     sb.Append("@RuleType,");
     sb.Append("@RuleCondition,");
     sb.Append("@ObjectValue,");
     sb.Append("@RuleName,");
     sb.Append("@RuleSeq,");
     sb.Append("@SecurityStart,");
     sb.Append("@SecurityEnd,");
     sb.Append("@LevelStart,");
     sb.Append("@LevelEnd,");
     sb.Append("@SignType )");
     sb.Append("select @@identity;");
     return ExecuteScalar(CommandType.Text, sb.ToString(), pramsInsert).ToString();
 }