Esempio n. 1
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(MobileSoft.Model.WorkFlow.Tb_WorkFlow_FlowNode model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@InfoId",                                     SqlDbType.Int,         4),
                new SqlParameter("@Tb_WorkFlow_Instance_InfoId",                SqlDbType.Int,         4),
                new SqlParameter("@FlowNodeName",                               SqlDbType.VarChar,   100),
                new SqlParameter("@FlowSort",                                   SqlDbType.Int,         4),
                new SqlParameter("@TimeOutDay",                                 SqlDbType.Int,         4),
                new SqlParameter("@TimeOutDays",                                SqlDbType.Int,         4),
                new SqlParameter("@Tb_Dictionary_NodeOprMethod_DictionaryCode", SqlDbType.NVarChar,   20),
                new SqlParameter("@Tb_Dictionary_NodeOprType_DictionaryCode",   SqlDbType.NVarChar,   20),
                new SqlParameter("@JumpFlowSort",                               SqlDbType.Int,         4),
                new SqlParameter("@IsUpdateFlow",                               SqlDbType.Int,         4),
                new SqlParameter("@Tb_Dictionary_OprState_DictionaryCode",      SqlDbType.NVarChar,   20),
                new SqlParameter("@IsPrint",                                    SqlDbType.Int,         4),
                new SqlParameter("@IsStartUser",                                SqlDbType.Int,         4),
                new SqlParameter("@WorkFlowStartDate",                          SqlDbType.DateTime),
                new SqlParameter("@ReturnNode",                                 SqlDbType.Int,         4),
                new SqlParameter("@CheckLevel",                                 SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.Tb_WorkFlow_Instance_InfoId;
            parameters[2].Value     = model.FlowNodeName;
            parameters[3].Value     = model.FlowSort;
            parameters[4].Value     = model.TimeOutDay;
            parameters[5].Value     = model.TimeOutDays;
            parameters[6].Value     = model.Tb_Dictionary_NodeOprMethod_DictionaryCode;
            parameters[7].Value     = model.Tb_Dictionary_NodeOprType_DictionaryCode;
            parameters[8].Value     = model.JumpFlowSort;
            parameters[9].Value     = model.IsUpdateFlow;
            parameters[10].Value    = model.Tb_Dictionary_OprState_DictionaryCode;
            parameters[11].Value    = model.IsPrint;
            parameters[12].Value    = model.IsStartUser;
            parameters[13].Value    = model.WorkFlowStartDate;
            parameters[14].Value    = model.ReturnNode;
            parameters[15].Value    = model.CheckLevel;

            DbHelperSQL.RunProcedure("Proc_Tb_WorkFlow_FlowNode_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Esempio n. 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.WorkFlow.Tb_WorkFlow_FlowNode GetModel(int InfoId)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@InfoId", SqlDbType.Int, 4)
            };
            parameters[0].Value = InfoId;

            MobileSoft.Model.WorkFlow.Tb_WorkFlow_FlowNode model = new MobileSoft.Model.WorkFlow.Tb_WorkFlow_FlowNode();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_WorkFlow_FlowNode_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["InfoId"].ToString() != "")
                {
                    model.InfoId = int.Parse(ds.Tables[0].Rows[0]["InfoId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Tb_WorkFlow_Instance_InfoId"].ToString() != "")
                {
                    model.Tb_WorkFlow_Instance_InfoId = int.Parse(ds.Tables[0].Rows[0]["Tb_WorkFlow_Instance_InfoId"].ToString());
                }
                model.FlowNodeName = ds.Tables[0].Rows[0]["FlowNodeName"].ToString();
                if (ds.Tables[0].Rows[0]["FlowSort"].ToString() != "")
                {
                    model.FlowSort = int.Parse(ds.Tables[0].Rows[0]["FlowSort"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TimeOutDay"].ToString() != "")
                {
                    model.TimeOutDay = int.Parse(ds.Tables[0].Rows[0]["TimeOutDay"].ToString());
                }
                if (ds.Tables[0].Rows[0]["TimeOutDays"].ToString() != "")
                {
                    model.TimeOutDays = int.Parse(ds.Tables[0].Rows[0]["TimeOutDays"].ToString());
                }
                model.Tb_Dictionary_NodeOprMethod_DictionaryCode = ds.Tables[0].Rows[0]["Tb_Dictionary_NodeOprMethod_DictionaryCode"].ToString();
                model.Tb_Dictionary_NodeOprType_DictionaryCode   = ds.Tables[0].Rows[0]["Tb_Dictionary_NodeOprType_DictionaryCode"].ToString();
                if (ds.Tables[0].Rows[0]["JumpFlowSort"].ToString() != "")
                {
                    model.JumpFlowSort = int.Parse(ds.Tables[0].Rows[0]["JumpFlowSort"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsUpdateFlow"].ToString() != "")
                {
                    model.IsUpdateFlow = int.Parse(ds.Tables[0].Rows[0]["IsUpdateFlow"].ToString());
                }
                model.Tb_Dictionary_OprState_DictionaryCode = ds.Tables[0].Rows[0]["Tb_Dictionary_OprState_DictionaryCode"].ToString();
                if (ds.Tables[0].Rows[0]["IsPrint"].ToString() != "")
                {
                    model.IsPrint = int.Parse(ds.Tables[0].Rows[0]["IsPrint"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsStartUser"].ToString() != "")
                {
                    model.IsStartUser = int.Parse(ds.Tables[0].Rows[0]["IsStartUser"].ToString());
                }
                if (ds.Tables[0].Rows[0]["WorkFlowStartDate"].ToString() != "")
                {
                    model.WorkFlowStartDate = DateTime.Parse(ds.Tables[0].Rows[0]["WorkFlowStartDate"].ToString());
                }
                if (ds.Tables[0].Rows[0]["ReturnNode"].ToString() != "")
                {
                    model.ReturnNode = int.Parse(ds.Tables[0].Rows[0]["ReturnNode"].ToString());
                }
                if (ds.Tables[0].Rows[0]["CheckLevel"].ToString() != "")
                {
                    model.CheckLevel = int.Parse(ds.Tables[0].Rows[0]["CheckLevel"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }