Example #1
0
        private void GetSerialBasicInfo(string serial)
        {
            WcfCaller.GetModuleInfo(
                (o, ex) =>
            {
                if (ex == null)
                {
                    m_objModuleInfo = o;

                    ChangeState(SystemState.ShowModuleInfo, o);
                }
                else
                {
                    MessageBox.Show(ex.Message);
                }
            },
                new string[] { serial, "" }
                );
        }
Example #2
0
        private void btnWrite_Click(object sender, EventArgs e)
        {
            if (m_objModuleInfo == null)
            {
                MessageBox.Show("没有数据");
                return;
            }

            m_strTagUID = ReaderConfig._rfidReader.ReadTagID();

            if (m_strTagUID == "")
            {
                MessageBox.Show("没有找到标签");
                return;
            }

            #region chech region state

            if (string.IsNullOrEmpty(m_objModuleInfo.ProductType))
            {
                MessageBox.Show("产品类型不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.CellDate))
            {
                MessageBox.Show("电池片生产日期不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.PackedDate))
            {
                MessageBox.Show("包装时间不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.Pmax))
            {
                MessageBox.Show("Pmax不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.Voc))
            {
                MessageBox.Show("Voc不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.Vpm))
            {
                MessageBox.Show("Vpm不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.Ipm))
            {
                MessageBox.Show("Ipm不能为空");
                return;
            }
            if (string.IsNullOrEmpty(m_objModuleInfo.Isc))
            {
                MessageBox.Show("Isc不能为空");
                return;
            }
            #endregion

            byte[] m_aryData2Write = TagDataFormat.CreateByteArray(m_objModuleInfo);

            string m_strModuleBasicInfo = m_objModuleInfo.ProductType + "|" + m_objModuleInfo.PackedDate.Replace("-", ".") + "|"
                                          + m_objModuleInfo.Pivf + "|" + m_objModuleInfo.Module_ID + "|" + m_objModuleInfo.CellDate.Replace("-", ".") + "|3";

            if (ReaderConfig._rfidReader.WriteTagBuff(m_aryData2Write))
            {
                ReaderConfig._rfidReader.PlaySound();

                WcfCaller.WriteLog(ex =>
                {
                    if (ex == null)
                    {
                        m_objModuleInfo = null;
                        ChangeState(SystemState.ResetAll, null);
                        PlaySound();
                    }
                    else
                    {
                        MessageBox.Show(ex.Message);
                    }
                }, new string[] { m_strTagUID, m_strModuleID, m_strModuleBasicInfo });
            }
            else
            {
                MessageBox.Show("烧录失败");
            }
        }