Beispiel #1
0
        /// <summary>
        /// 显示最后两件需要补货的卷烟
        /// </summary>
        private void ShowFinish()
        {
            Thread.Sleep(20000);
            int    indexno = GetCurrentInfo();
            InTask intask  = InTask.GetInTaskByIndex((indexno + 1).ToString());

            labindexno.Text  = intask.INDEXNO + "/" + maxtaskno;
            labbarcode.Text  = intask.BARCODE;
            labcigname.Text  = intask.CIGNAME;
            labnbarcode.Text = "无";
            labncigname.Text = "无";


            Thread.Sleep(20000);
            labindexno.Text  = "补货完成";
            labcigname.Text  = "补货完成";
            labbarcode.Text  = "补货完成";
            labnbarcode.Text = "补货完成";
            labncigname.Text = "补货完成";
            itemPanel1.BeginUpdate();
            itemPanel1.Items.Clear();
            itemPanel1.EndUpdate();
        }
Beispiel #2
0
        private void SetInTaskStatus(int status)
        {
            string indexcolname = "";
            string custcolname  = "";

            foreach (DataGridViewColumn column in dataGridViewXs[superTabControl1.SelectedTab.Name].Columns)
            {
                if (column.DataPropertyName.ToUpper() == "INDEXNO")
                {
                    indexcolname = column.Name;
                }
            }


            foreach (DataGridViewRow selectedRow in dataGridViewXs[superTabControl1.SelectedTab.Name].SelectedRows)
            {
                //改变任务状态
                string indexcolvalue = selectedRow.Cells[indexcolname].Value.ToString();

                InTask inTask = InTask.GetInTaskByIndex(indexcolvalue);
                inTask.Status = status;
                inTask.SaveInTaskProcess(inTask.ID);
            }
        }
Beispiel #3
0
        protected override void DataPortal_Update()
        {
            //PLC写入下达任务

            //throw new Exception("写入下达任务");


            using (BypassPropertyChecks)
            {
                using (var cn = new MySqlConnection(AppUtility.AppUtil._LocalConnectionString))
                {
                    cn.Open();
                    using (var tran = cn.BeginTransaction())
                    {
                        try
                        {
                            using (var cm = cn.CreateCommand())
                            {
                                cm.Transaction = tran;
                                StringBuilder SQL = new StringBuilder();
                                SQL.Append("UPDATE T_InTaskIssued ");
                                SQL.Append("    SET ID = @ID,PLCFLAG = @PLCFLAG,PLCTASKNO = @PLCTASKNO,SLOCATION = @SLOCATION,CIGCODE = @CIGCODE,BARCODE = @BARCODE,INQTY = @INQTY ");
                                SQL.Append("  WHERE ID = @ID");
                                cm.CommandText = SQL.ToString();
                                cm.Parameters.AddWithValue("@ID", ID);
                                cm.Parameters.AddWithValue("@PLCFLAG", PLCFLAG);

                                cm.Parameters.AddWithValue("@PLCTASKNO", PLCTASKNO);
                                cm.Parameters.AddWithValue("@SLOCATION", SLOCATION);
                                cm.Parameters.AddWithValue("@CIGCODE", CIGCODE);
                                cm.Parameters.AddWithValue("@BARCODE", BARCODE);
                                cm.Parameters.AddWithValue("@INQTY", INQTY);
                                cm.ExecuteNonQuery();
                            }
                            tran.Commit();

                            if (PLCTASKNO != "0" && SLOCATION != "0" && INQTY != 0)
                            {
                                m_inTask = InTask.GetInTaskByIndex(PLCTASKNO);
                                if (m_inTask != null)
                                {
                                    m_inTask.Status = 2;
                                    m_inTask.SaveInTaskProcess(PLCTASKNO);
                                }
                                MonitorLog monitorLog = MonitorLog.NewMonitorLog();
                                monitorLog.LOGNAME  = "PLC任务下达";
                                monitorLog.LOGINFO  = "PLCTASKNO:" + PLCTASKNO.PadRight(10);
                                monitorLog.LOGINFO += CIGCODE + ":" +
                                                      BARCODE + ":" +
                                                      INQTY + "  ";
                                monitorLog.LOGLOCATION = "PLC";
                                monitorLog.LOGTYPE     = 0;
                                monitorLog.Save();
                            }
                            //else
                            //{
                            //    m_sortingLineTask = SortingLineTask.GetSortingLineByIndex(PLCTASKNO);
                            //    if (m_sortingLineTask != null)
                            //    {
                            //        m_sortingLineTask.Status = 2;
                            //        m_sortingLineTask.SaveSortingTaskProcess(PLCTASKNO);
                            //    }
                            //}
                        }
                        catch (Exception)
                        {
                            tran.Rollback();
                            throw;
                        }
                    }
                }
            }
        }