using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Reflection; using System.Text; using MESClassLibrary.BLL.Log; using MESClassLibrary.Model; namespace MESClassLibrary.DAL.ZPPlan { public class BadZPDAL { public bool AddInfo(BadZPModel md) { try { string sql = @"insert into tb_Bad_ZP (ID,PlanID,BadPosition,BadReason) values(@ID,@PlanID,@BadPosition,@BadReason)"; SqlParameter[] param=new SqlParameter[4]; param[0] = new SqlParameter("@ID", SqlDbType.VarChar); param[0].Value = md.ID; param[1] = new SqlParameter("@PlanID", SqlDbType.VarChar); param[1].Value = md.PlanID; param[2] = new SqlParameter("@BadPosition", SqlDbType.VarChar); param[2].Value = md.BadPosition; param[3] = new SqlParameter("@BadReason", SqlDbType.VarChar); param[3].Value = md.BadReason; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); return true; } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } } }