/// <summary> /// 改SMTIO表中指定备料表头编号的状态 /// </summary> /// <param name="masterId"></param> /// <param name="woId"></param> /// <param name="status"></param> public void EditSmtIOStatus(string masterId, string woId, SmtIOStatus status) { //MySqlCommand cmd = new MySqlCommand(); //cmd.CommandText = "update SFCR.T_SMT_IO set status=@status where masterId=@masterId and woId=@woId"; //cmd.Parameters.Add("status", MySqlDbType.Int32).Value = (int)status; //cmd.Parameters.Add("masterId", MySqlDbType.VarChar).Value = masterId; //cmd.Parameters.Add("woId", MySqlDbType.VarChar).Value = woId; //BLL.BllMsSqllib.Instance.ExecteNonQuery(cmd); IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN); IDictionary <string, object> mst = new Dictionary <string, object>(); mst.Add("STATUS", (int)status); mst.Add("MASTERID", masterId); mst.Add("WOID", woId); dp.UpdateData("SFCR.T_SMT_IO", new string[] { "MASTERID", "WOID" }, mst); }
/// <summary> /// 获取SMTIO中指定机器的当前状态(理想值:一台机器的在生产状态同时只存在一次) /// </summary> /// <param name="machineId"></param> /// <param name="status"></param> /// <returns></returns> public System.Data.DataSet GetSmtIOMachineIdStatus(string machineId, SmtIOStatus status) { //MySqlCommand cmd = new MySqlCommand(); //cmd.CommandText = "select masterId,woId,machineId from SFCR.T_SMT_IO where machineId=@machineId and status=@status"; //cmd.Parameters.Add("machineId", MySqlDbType.VarChar).Value = machineId; //cmd.Parameters.Add("status", MySqlDbType.Int32).Value = (int)status; //return BLL.BllMsSqllib.Instance.ExecuteDataSet(cmd); string table = "SFCR.T_SMT_IO"; string fieldlist = "masterId,woId,machineId".ToUpper(); int count = 0; IAdminProvider dp = (IAdminProvider)DpFactory.Create(typeof(IAdminProvider), DpFactory.ADMIN); IDictionary <string, object> mst = new Dictionary <string, object>(); mst.Add("MACHINEID", machineId); mst.Add("STATUS", (int)status); return(dp.GetData(table, fieldlist, mst, out count)); }