Esempio n. 1
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(CardCenter.Entity.FlowInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into FlowInfo(");
            strSql.Append("Guid,JobID,FlowID,SubmitDate,SubmitUser,Content,IsDelete,Remark)");
            strSql.Append(" values (");
            strSql.Append("@Guid,@JobID,@FlowID,@SubmitDate,@SubmitUser,@Content,@IsDelete,@Remark)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Guid",       SqlDbType.NVarChar,   64),
                new SqlParameter("@JobID",      SqlDbType.NVarChar,   64),
                new SqlParameter("@FlowID",     SqlDbType.Int,         4),
                new SqlParameter("@SubmitDate", SqlDbType.DateTime),
                new SqlParameter("@SubmitUser", SqlDbType.NVarChar,   64),
                new SqlParameter("@Content",    SqlDbType.NVarChar,  512),
                new SqlParameter("@IsDelete",   SqlDbType.Bit,         1),
                new SqlParameter("@Remark",     SqlDbType.NVarChar, 512)
            };
            parameters[0].Value = model.Guid;
            parameters[1].Value = model.JobID;
            parameters[2].Value = model.FlowID;
            parameters[3].Value = model.SubmitDate;
            parameters[4].Value = model.SubmitUser;
            parameters[5].Value = model.Content;
            parameters[6].Value = model.IsDelete;
            parameters[7].Value = model.Remark;

            TranHelper.AddTran(strSql, parameters);
        }
Esempio n. 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(CardCenter.Entity.FlowInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update FlowInfo set ");
            strSql.Append("JobID=@JobID,");
            strSql.Append("FlowID=@FlowID,");
            strSql.Append("SubmitDate=@SubmitDate,");
            strSql.Append("SubmitUser=@SubmitUser,");
            strSql.Append("Content=@Content,");
            strSql.Append("IsDelete=@IsDelete,");
            strSql.Append("Remark=@Remark");
            strSql.Append(" where Guid=@Guid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@JobID",      SqlDbType.NVarChar,   64),
                new SqlParameter("@FlowID",     SqlDbType.Int,         4),
                new SqlParameter("@SubmitDate", SqlDbType.DateTime),
                new SqlParameter("@SubmitUser", SqlDbType.NVarChar,   64),
                new SqlParameter("@Content",    SqlDbType.NVarChar,  512),
                new SqlParameter("@IsDelete",   SqlDbType.Bit,         1),
                new SqlParameter("@Remark",     SqlDbType.NVarChar,  512),
                new SqlParameter("@Guid",       SqlDbType.NVarChar, 64)
            };
            parameters[0].Value = model.JobID;
            parameters[1].Value = model.FlowID;
            parameters[2].Value = model.SubmitDate;
            parameters[3].Value = model.SubmitUser;
            parameters[4].Value = model.Content;
            parameters[5].Value = model.IsDelete;
            parameters[6].Value = model.Remark;
            parameters[7].Value = model.Guid;

            TranHelper.AddTran(strSql, parameters);
        }
Esempio n. 3
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public CardCenter.Entity.FlowInfo DataRowToModel(DataRow row)
 {
     CardCenter.Entity.FlowInfo model = new CardCenter.Entity.FlowInfo();
     if (row != null)
     {
         if (row["Guid"] != null)
         {
             model.Guid = row["Guid"].ToString();
         }
         if (row["JobID"] != null)
         {
             model.JobID = row["JobID"].ToString();
         }
         if (row["FlowID"] != null && row["FlowID"].ToString() != "")
         {
             model.FlowID = int.Parse(row["FlowID"].ToString());
         }
         if (row["SubmitDate"] != null && row["SubmitDate"].ToString() != "")
         {
             model.SubmitDate = DateTime.Parse(row["SubmitDate"].ToString());
         }
         if (row["SubmitUser"] != null)
         {
             model.SubmitUser = row["SubmitUser"].ToString();
         }
         if (row["Content"] != null)
         {
             model.Content = row["Content"].ToString();
         }
         if (row["IsDelete"] != null && row["IsDelete"].ToString() != "")
         {
             if ((row["IsDelete"].ToString() == "1") || (row["IsDelete"].ToString().ToLower() == "true"))
             {
                 model.IsDelete = true;
             }
             else
             {
                 model.IsDelete = false;
             }
         }
         if (row["Remark"] != null)
         {
             model.Remark = row["Remark"].ToString();
         }
     }
     return(model);
 }
Esempio n. 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddEx(CardCenter.Entity.FlowInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into FlowInfo(");
            strSql.Append("Guid,JobID,FlowID,SubmitDate,SubmitUser,Content,IsDelete,Remark)");
            strSql.Append(" values (");
            strSql.Append("@Guid,@JobID,@FlowID,@SubmitDate,@SubmitUser,@Content,@IsDelete,@Remark)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Guid",       SqlDbType.NVarChar,   64),
                new SqlParameter("@JobID",      SqlDbType.NVarChar,   64),
                new SqlParameter("@FlowID",     SqlDbType.Int,         4),
                new SqlParameter("@SubmitDate", SqlDbType.DateTime),
                new SqlParameter("@SubmitUser", SqlDbType.NVarChar,   64),
                new SqlParameter("@Content",    SqlDbType.NVarChar,  512),
                new SqlParameter("@IsDelete",   SqlDbType.Bit,         1),
                new SqlParameter("@Remark",     SqlDbType.NVarChar, 512)
            };
            parameters[0].Value = model.Guid;
            parameters[1].Value = model.JobID;
            parameters[2].Value = model.FlowID;
            parameters[3].Value = model.SubmitDate;
            parameters[4].Value = model.SubmitUser;
            parameters[5].Value = model.Content;
            parameters[6].Value = model.IsDelete;
            parameters[7].Value = model.Remark;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public CardCenter.Entity.FlowInfo GetModel(string Guid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 Guid,JobID,FlowID,SubmitDate,SubmitUser,Content,IsDelete,Remark from FlowInfo ");
            strSql.Append(" where Guid=@Guid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Guid", SqlDbType.NVarChar, 64)
            };
            parameters[0].Value = Guid;

            CardCenter.Entity.FlowInfo model = new CardCenter.Entity.FlowInfo();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }