Ejemplo n.º 1
0
        //insert only
        public int InsertEmsOutput(EmsOutputRecordRow o)
        {
            int aff = 0;

            string sqlCmd = "INSERT INTO [EMS].[OutputRecord]" +
                            "([RohmDate],[ProcessName],[MCNo],[LotNo],[TotalGood],[TotalNG],[StandardRPM])" +
                            " VALUES (@RohmDate,@ProcessName,@MCNo,@LotNo,@TotalGood,@TotalNG,@StandardRPM)";

            using (SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = sqlCmd;
                cmd.Parameters.Add("@RohmDate", SqlDbType.Date);
                cmd.Parameters.Add("@ProcessName", SqlDbType.VarChar, 10);
                cmd.Parameters.Add("@MCNo", SqlDbType.VarChar, 15);
                cmd.Parameters.Add("@LotNo", SqlDbType.VarChar, 10);
                cmd.Parameters.Add("@TotalGood", SqlDbType.Int);
                cmd.Parameters.Add("@TotalNG", SqlDbType.Int);
                cmd.Parameters.Add("@StandardRPM", SqlDbType.Float);

                cmd.Parameters[0].Value = o.RohmDate;
                cmd.Parameters[1].Value = o.ProcessName;
                cmd.Parameters[2].Value = o.MCNo;
                cmd.Parameters[3].Value = o.LotNo;
                cmd.Parameters[4].Value = o.TotalGood;
                cmd.Parameters[5].Value = o.TotalNG;
                cmd.Parameters[6].Value = o.StandardRPM;

                aff = ExecuteNonQuery(cmd);
            }

            return(aff);
        }
Ejemplo n.º 2
0
 public EmsOutputRecordBLL(EmsOutputRecordRow data)
 {
     m_ID          = data.ID;
     m_RohmDate    = data.RohmDate;
     m_ProcessName = data.ProcessName;
     m_MCNo        = data.MCNo;
     m_LotNo       = data.LotNo;
     m_TotalGood   = data.TotalGood;
     m_TotalNG     = data.TotalNG;
     m_StandardRPM = data.StandardRPM;
 }
Ejemplo n.º 3
0
        public void ReportOutput(EmsOutputRecordBLL output)
        {
            if (output == null)
            {
                return;
            }

            try
            {
                EmsOutputRecordRow row = new EmsOutputRecordRow(output);
                m_DB.InsertEmsOutput(row);
            }
            catch (Exception ex)
            {
                //raise error
                RaiseErrorCatchedEvent("ReportOutput-001", ex, ex.StackTrace);
            }
        }
Ejemplo n.º 4
0
        public EmsOutputRecordRow[] LoadOutputRecord(string processName, string mcNo, DateTime rohmDate)
        {
            List <EmsOutputRecordRow> outputRows = new List <EmsOutputRecordRow>();

            string sqlCmd2 = "SELECT * FROM EMS.OutputRecord WHERE RohmDate = '" +
                             rohmDate.ToString("yyyy/MM/dd") + "' AND ProcessName = '" +
                             processName + "' AND MCNo = '" + mcNo + "'";

            using (DataTable dt2 = ExecuteDataTable(sqlCmd2))
            {
                foreach (DataRow row in dt2.Rows)
                {
                    EmsOutputRecordRow eor = new EmsOutputRecordRow(row);
                    outputRows.Add(eor);
                }
            }
            return(outputRows.ToArray());
        }