/// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(EccmMaintenanceOrderImplementModel model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into eccm_maintenance_order_implement(");
            strSql.Append("order_id,equCode,implement_content,implement_time,uid_handle,ext1,ext2,ext3)");
            strSql.Append(" values (");
            strSql.Append("@order_id,@equCode,@implement_content,@implement_time,@uid_handle,@ext1,@ext2,@ext3);");
            strSql.Append("select @@IDENTITY;");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@order_id",          MySqlDbType.Int32,     11),
                new MySqlParameter("@equCode",           MySqlDbType.VarChar,   50),
                new MySqlParameter("@implement_content", MySqlDbType.Text),
                new MySqlParameter("@implement_time",    MySqlDbType.DateTime),
                new MySqlParameter("@uid_handle",        MySqlDbType.Int32,     11),
                new MySqlParameter("@ext1",              MySqlDbType.VarChar,   50),
                new MySqlParameter("@ext2",              MySqlDbType.VarChar,   50),
                new MySqlParameter("@ext3",              MySqlDbType.VarChar, 50)
            };
            parameters[0].Value = model.order_id;
            parameters[1].Value = model.equCode;
            parameters[2].Value = model.implement_content;
            parameters[3].Value = model.implement_time;
            parameters[4].Value = model.uid_handle;
            parameters[5].Value = model.ext1;
            parameters[6].Value = model.ext2;
            parameters[7].Value = model.ext3;

            object obj = MySQLHelper.ExecuteScalar(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(EccmMaintenanceOrderImplementModel model)
 {
     return(_dal.Add(model));
 }