/// <summary> /// 增加一条数据 /// </summary> public bool Add(TB_Batch_IndexModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TB_Batch_Index("); strSql.Append("Tf_BatchID,Tf_Batchtype,Tf_TrayCount,Tf_CellCount)"); strSql.Append(" values ("); strSql.Append("@Tf_BatchID,@Tf_Batchtype,@Tf_TrayCount,@Tf_CellCount)"); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Batchtype", SqlDbType.Int, 4), new SqlParameter("@Tf_TrayCount", SqlDbType.Int, 4), new SqlParameter("@Tf_CellCount", SqlDbType.Int, 4) }; parameters[0].Value = model.Tf_BatchID; parameters[1].Value = model.Tf_Batchtype; parameters[2].Value = model.Tf_TrayCount; parameters[3].Value = model.Tf_CellCount; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(TB_Batch_IndexModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TB_Batch_Index set "); strSql.Append("Tf_Batchtype=@Tf_Batchtype,"); strSql.Append("Tf_TrayCount=@Tf_TrayCount,"); strSql.Append("Tf_CellCount=@Tf_CellCount"); strSql.Append(" where Tf_BatchID=@Tf_BatchID "); SqlParameter[] parameters = { new SqlParameter("@Tf_Batchtype", SqlDbType.Int, 4), new SqlParameter("@Tf_TrayCount", SqlDbType.Int, 4), new SqlParameter("@Tf_CellCount", SqlDbType.Int, 4), new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32) }; parameters[0].Value = model.Tf_Batchtype; parameters[1].Value = model.Tf_TrayCount; parameters[2].Value = model.Tf_CellCount; parameters[3].Value = model.Tf_BatchID; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(string batchID, string Tf_TrayId, string Tf_CellSn) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TB_After_GradeData "); strSql.Append(" where Tf_BatchID =@Tf_BatchID and Tf_TrayId=@Tf_TrayId and Tf_CellSn=@Tf_CellSn "); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32), new SqlParameter("@Tf_TrayId", SqlDbType.VarChar, 32), new SqlParameter("@Tf_CellSn", SqlDbType.VarChar, 32) }; parameters[0].Value = batchID; parameters[1].Value = Tf_TrayId; parameters[2].Value = Tf_CellSn; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(string Tf_TrayId, int usingState) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TB_Tray_index "); strSql.Append(" where Tf_TrayId=@Tf_TrayId and tf_traystat=@tf_traystat "); SqlParameter[] parameters = { new SqlParameter("@Tf_TrayId", SqlDbType.VarChar, 32), new SqlParameter("@tf_traystat", SqlDbType.Int) }; parameters[0].Value = Tf_TrayId; parameters[1].Value = usingState; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 批量删除数据 /// </summary> public bool DeleteList(string Tf_BatchIDlist) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TB_Batch_Index "); strSql.Append(" where Tf_BatchID in (" + Tf_BatchIDlist + ") "); int rows = DbHelperSQL2.ExecuteSql(strSql.ToString()); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(TB_After_GradeDataModel model, string oldTrayID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TB_After_GradeData set "); strSql.Append("Tf_TrayId=@Tf_TrayId,"); strSql.Append("Tf_BatchID=@Tf_BatchID,"); strSql.Append("Tf_Batchtype=@Tf_Batchtype,"); strSql.Append("Tf_ChannelNo=@Tf_ChannelNo,"); strSql.Append("Tf_CellSn=@Tf_CellSn,"); strSql.Append("Tf_Pick=@Tf_Pick,"); strSql.Append("Tf_Tag=@Tf_Tag"); strSql.Append(" where Tf_TrayId='" + oldTrayID + "' and Tf_CellSn=@Tf_CellSn "); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Batchtype", SqlDbType.Int, 4), new SqlParameter("@Tf_ChannelNo", SqlDbType.Int, 4), new SqlParameter("@Tf_TrayId", SqlDbType.VarChar, 32), new SqlParameter("@Tf_CellSn", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Pick", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Tag", SqlDbType.Int, 4) }; parameters[0].Value = model.Tf_BatchID; parameters[1].Value = model.Tf_Batchtype; parameters[2].Value = model.Tf_ChannelNo; parameters[3].Value = model.Tf_TrayId; parameters[4].Value = model.Tf_CellSn; parameters[5].Value = model.Tf_Pick; parameters[6].Value = model.Tf_Tag; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 删除一条数据 /// </summary> public bool Delete(string Tf_BatchID) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TB_Batch_Index "); strSql.Append(" where Tf_BatchID=@Tf_BatchID "); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32) }; parameters[0].Value = Tf_BatchID; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(TB_Tray_indexModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TB_Tray_index set "); strSql.Append("Tf_BatchID=@Tf_BatchID,"); strSql.Append("Tf_Batchtype=@Tf_Batchtype,"); strSql.Append("Tf_CellCount=@Tf_CellCount,"); strSql.Append("tf_CheckInTime=@tf_CheckInTime,"); strSql.Append("tf_traystat=@tf_traystat"); strSql.Append(" where Tf_TrayId=@Tf_TrayId and tf_traystat=1"); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Batchtype", SqlDbType.Int, 4), new SqlParameter("@Tf_CellCount", SqlDbType.Int, 4), new SqlParameter("@tf_CheckInTime", SqlDbType.DateTime), new SqlParameter("@Tf_TrayId", SqlDbType.VarChar, 32), new SqlParameter("@tf_traystat", SqlDbType.Int, 4) }; parameters[0].Value = model.Tf_BatchID; parameters[1].Value = model.Tf_Batchtype; parameters[2].Value = model.Tf_CellCount; parameters[3].Value = model.tf_CheckInTime; parameters[4].Value = model.Tf_TrayId; parameters[5].Value = model.tf_traystat; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(TB_After_GradeDataModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TB_After_GradeData("); strSql.Append("Tf_BatchID,Tf_Batchtype,Tf_TrayId,Tf_ChannelNo,Tf_CellSn,Tf_Pick,Tf_Tag)"); strSql.Append(" values ("); strSql.Append("@Tf_BatchID,@Tf_Batchtype,@Tf_TrayId,@Tf_ChannelNo,@Tf_CellSn,@Tf_Pick,@Tf_Tag)"); SqlParameter[] parameters = { new SqlParameter("@Tf_BatchID", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Batchtype", SqlDbType.Int, 4), new SqlParameter("@Tf_TrayId", SqlDbType.VarChar, 32), new SqlParameter("@Tf_ChannelNo", SqlDbType.Int, 4), new SqlParameter("@Tf_CellSn", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Pick", SqlDbType.VarChar, 32), new SqlParameter("@Tf_Tag", SqlDbType.Int, 4) }; parameters[0].Value = model.Tf_BatchID; parameters[1].Value = model.Tf_Batchtype; parameters[2].Value = model.Tf_TrayId; parameters[3].Value = model.Tf_ChannelNo; parameters[4].Value = model.Tf_CellSn; parameters[5].Value = model.Tf_Pick; parameters[6].Value = model.Tf_Tag; int rows = DbHelperSQL2.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }