Ejemplo n.º 1
0
 /// <summary>
 /// 就绪
 /// </summary>
 public void SetReady(int idNo, string idCard, List <string> serialNo)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <int, string, List <string> >(SetReady), idNo, idCard, serialNo);
     }
     else
     {
         labIdCard.Text      = idCard;
         labIdCard.ForeColor = Color.Blue;
         labStatus.Text      = CLanguage.Lan("治具到位就绪,等待测试.");
         labStatus.ForeColor = Color.Blue;
         for (int i = 0; i < serialNo.Count; i++)
         {
             int uutNo = idNo * serialNo.Count + i;
             labSn[uutNo].Text      = serialNo[i];
             labSn[uutNo].ForeColor = Color.Black;
             labResult[uutNo].Text  = "";
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 读取设备小板版本
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        private bool readChildVersion(int addr, int childMax, out string er)
        {
            er = string.Empty;

            try
            {
                _syncLock.AcquireWriterLock(-1);

                List <int> childVer = null;

                Thread.Sleep(_delayMs);

                if (!_devFMB.ReadChildVersion(addr, childMax, out childVer, out er))
                {
                    Thread.Sleep(_delayMs);

                    if (!_devFMB.ReadChildVersion(addr, childMax, out childVer, out er))
                    {
                        er = _Mon[addr].ToString() + CLanguage.Lan("设备小板") + ";";
                        return(false);
                    }
                }

                for (int i = 0; i < childVer.Count; i++)
                {
                    _Mon[addr].Base.childVer[i] = ((double)childVer[i] / 10).ToString("0.0");
                }

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
            finally
            {
                _syncLock.ReleaseWriterLock();
            }
        }
Ejemplo n.º 3
0
        public void SetStatus(int ready, string idCard, string model, List <string> serialNos)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new Action <int, string, string, List <string> >(SetStatus), ready, idCard, model, serialNos);
            }
            else
            {
                if (ready == 0)
                {
                    labReady.Text      = CLanguage.Lan("治具未就绪");
                    labReady.ForeColor = Color.Red;
                    labModel.Text      = "----";
                    labIdCard.Text     = "----";
                }
                else
                {
                    if (ready == 1)
                    {
                        labReady.Text = CLanguage.Lan("前工位");
                    }
                    else
                    {
                        labReady.Text = CLanguage.Lan("后工位");
                    }

                    labReady.ForeColor = Color.Blue;

                    labIdCard.Text = idCard;

                    labModel.Text = model;

                    for (int i = 0; i < serialNos.Count; i++)
                    {
                        string sn = CLanguage.Lan("条码") + "【" + (i + 1).ToString() + "】:" + serialNos[i] + ";\r\n";
                        rtbSnList.AppendText(sn);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 读取条码
        /// </summary>
        /// <param name="serailNo"></param>
        /// <param name="er"></param>
        /// <param name="timeOut"></param>
        /// <returns></returns>
        public bool Read(out string serailNo, out string er, int rLen = 0, int timeOut = 1000)
        {
            serailNo = string.Empty;

            er = string.Empty;

            try
            {
                if (_rs232 == null)
                {
                    er = CLanguage.Lan("串口未打开");
                    return(false);
                }

                Stopwatch watcher = new Stopwatch();

                watcher.Start();

                if (!Send("\x02LON\x03", "\x02LOFF\x03", 0x02, 0x03, 0x0d, out serailNo, out er, timeOut))
                {
                    return(false);
                }

                if (rLen != 0 && serailNo.Length != rLen)
                {
                    return(false);
                }

                watcher.Stop();

                er = "耗时:" + watcher.ElapsedMilliseconds.ToString() + "ms";

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Ejemplo n.º 5
0
        private void btnVer_Click(object sender, EventArgs e)
        {
            try
            {
                btnVer.Enabled = false;

                if (!checkSystem())
                {
                    return;
                }

                int addr = System.Convert.ToInt16(txtAddr.Text);

                string er = string.Empty;

                string name = string.Empty;

                labVersion.Text = "";

                string ver = string.Empty;

                if (!comMon.ReadVersion(addr, out ver, out er))
                {
                    showInfo(CLanguage.Lan("读取设备版本地址") + "[" + addr.ToString("D2") + "]" + CLanguage.Lan("错误") + ":" + er, true);
                    return;
                }

                labVersion.Text = ver;

                showInfo(CLanguage.Lan("读取设备版本地址") + "[" + addr.ToString("D2") + "]OK");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                btnVer.Enabled = true;
            }
        }
Ejemplo n.º 6
0
        public static Boolean ValidateTextBox(Label lbl, TextBox tb, Boolean AllowEmpty, InputDataType dt)
        {
            String str = CLanguage.getValue("ERROR_TEXT_VALIDATE");
            String fmt = String.Format(str, lbl.Content);

            if (tb.IsEnabled)
            {
                if (AllowEmpty)
                {
                    return(true);
                }

                if (tb.Text.Trim().Equals(""))
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    tb.Focus();
                    return(false);
                }

                Regex regex = null;
                if (dt == InputDataType.InputTypeZeroPossitiveDecimal)
                {
                    regex = new Regex(@"^\d+(\.\d{1,2})?$");
                }
                else if (dt == InputDataType.InputTypeZeroPossitiveInt)
                {
                    regex = new Regex(@"^\d+$");
                }

                Boolean result = regex.IsMatch(tb.Text);
                if (!result)
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    tb.Focus();
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 读取快充板电压值
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        private bool readVolt(int addr, out string er)
        {
            er = string.Empty;

            try
            {
                _syncLock.AcquireWriterLock(-1);

                Thread.Sleep(_delayMs);

                List <double> Volt = null;

                if (!_devFMB.ReadVolt(addr, out Volt, out er, _synC, _voltMode))
                {
                    Thread.Sleep(_delayMs);

                    if (!_devFMB.ReadVolt(addr, out Volt, out er, _synC, _voltMode))
                    {
                        er = _Mon[addr].ToString() + CLanguage.Lan("读电压");
                        return(false);
                    }
                }

                for (int i = 0; i < Volt.Count; i++)
                {
                    _Mon[addr].Para.Volt[i] = Volt[i];
                }

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
            finally
            {
                _syncLock.ReleaseWriterLock();
            }
        }
Ejemplo n.º 8
0
        private void showEditWindow()
        {
            String caption = CLanguage.getValue("sale_quotation");

            if (!CHelper.VerifyAccessRight("SALE_QUOTATION_VIEW"))
            {
                return;
            }

            MAuxilaryDoc v = (MAuxilaryDoc)currentObj;

            WinAddEditQuotation w = new WinAddEditQuotation("E", itemSources, v, docType, "2");

            w.Caption = CLanguage.getValue("edit") + " " + caption;
            w.ShowDialog();

            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpSaleQuotation", getDocumentObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// 空治具
 /// </summary>
 /// <param name="idCard"></param>
 public void SetNull(string idCard)
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <string>(SetNull), idCard);
     }
     else
     {
         txtSnPress.ReadOnly = true;
         txtSnPress.Text     = "";
         labIdCard.Text      = idCard;
         labIdCard.ForeColor = Color.Blue;
         labStatus.Text      = CLanguage.Lan("空治具准备过站.");
         labStatus.ForeColor = Color.Blue;
         for (int i = 0; i < _uutMax; i++)
         {
             labSn[i].Text       = "";
             labUUT[i].BackColor = Color.White;
         }
         panelUUT.Visible = true;
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 空闲状态
 /// </summary>
 public void SetFree()
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action(SetFree));
     }
     else
     {
         txtSnPress.ReadOnly = true;
         txtSnPress.Text     = "";
         txtSnPress.Enabled  = false;
         labIdCard.Text      = "";
         labStatus.Text      = CLanguage.Lan("等待治具到位.");
         labStatus.ForeColor = Color.Blue;
         for (int i = 0; i < _uutMax; i++)
         {
             labUUT[i].BackColor = Color.White;
             labSn[i].Text       = "";
         }
         panelUUT.Visible = false;
     }
 }
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            //MSalePurchaseHistory mp = model as MSalePurchaseHistory;
            //mp.Category = eType;

            CTable tb = model.GetDbObject();

            items = OnixWebServiceAPI.GetCashTransactionList(tb);
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

            foreach (CTable o in items)
            {
                MCashDoc v = new MCashDoc(o);
                v.IsEnabled = false;

                if (idx == 0)
                {
                    //Create one for balance forward
                    MCashDoc bfw = new MCashDoc(new CTable(""));
                    bfw.IsEnabled = false;

                    bfw.DocumentNo   = CLanguage.getValue("balance_forward");
                    bfw.DocumentDate = v.DocumentDate;
                    bfw.EndAmount    = v.BeginAmount;
                    itemSources.Add(bfw);
                }

                v.RowIndex = idx;
                itemSources.Add(v);
                idx++;
            }

            Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources);

            return(tuple);
        }
Ejemplo n.º 12
0
        private void _UpdatePlayerTexts()
        {
            for (int p = 0; p < CSettings.MaxNumPlayer; ++p)
            {
                _Texts[_TextChannelPlayer[p]].Text     = "–";
                _Texts[_TextChannelPlayer[p]].Selected = _Buttons[_ButtonsPlayer[p]].Selected;
                _Texts[_TextDevicePlayer[p]].Text      = CLanguage.Translate("TR_SCREENORECORD_PRESS_TO_CONFIGURE");
                _Texts[_TextDevicePlayer[p]].Selected  = _Buttons[_ButtonsPlayer[p]].Selected;
            }

            foreach (CRecordDevice device in _Devices)
            {
                for (int c = 0; c < device.Channels; c++)
                {
                    if (device.PlayerChannel[c] > 0)
                    {
                        _Texts[_TextChannelPlayer[device.PlayerChannel[c] - 1]].Text = CConfig.Config.Record.MicConfig[device.PlayerChannel[c] - 1].Channel.ToString();
                        _Texts[_TextDevicePlayer[device.PlayerChannel[c] - 1]].Text  = CConfig.Config.Record.MicConfig[device.PlayerChannel[c] - 1].DeviceName;
                    }
                }
            }
        }
Ejemplo n.º 13
0
        public static void ShowEditWindow(String type, ObservableCollection <MBaseModel> items, MBaseModel defDat)
        {
            if (!CHelper.VerifyAccessRight("CASH_CHEQUE_VIEW"))
            {
                return;
            }

            MCheque cheque;

            if ((defDat is MCheque))
            {
                cheque = (MCheque)defDat;
            }
            else
            {
                MAccountDoc ad = (MAccountDoc)defDat;
                cheque          = new MCheque(new CTable(""));
                cheque.ChequeID = ad.ChequeID;
            }

            String        caption = "";
            CWinLoadParam param   = new CWinLoadParam();

            if (type.Equals("1"))
            {
                caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("receivable_cheque");
            }
            else
            {
                caption = CLanguage.getValue("edit") + " " + CLanguage.getValue("payable_cheque");
            }

            param.Caption           = caption;
            param.GenericType       = type;
            param.Mode              = "E";
            param.ActualView        = cheque;
            param.ParentItemSources = items;
            FactoryWindow.ShowWindow("WinAddEditCheque", param);
        }
Ejemplo n.º 14
0
        private void showEditWindow()
        {
            String caption = CLanguage.getValue("purchase_po");

            if (!CHelper.VerifyAccessRight("PURCHASE_PO_VIEW"))
            {
                return;
            }

            MAuxilaryDoc v = (MAuxilaryDoc)currentObj;

            WinAddEditPurchaseOrder w = new WinAddEditPurchaseOrder("E", itemSources, v, docType);

            w.Caption = CLanguage.getValue("edit") + " " + caption;
            w.ShowDialog();

            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getPurchaseOrderObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
Ejemplo n.º 15
0
        private void btnRTrigger_Click(object sender, EventArgs e)
        {
            if (comMon == null)
            {
                labStatus.Text      = CLanguage.Lan("请确定串口是否打开?");
                labStatus.ForeColor = Color.Red;
                return;
            }
            if (txtAddr.Text == "")
            {
                labStatus.Text      = CLanguage.Lan("请输入模块地址");
                labStatus.ForeColor = Color.Red;
                return;
            }
            string er = string.Empty;

            int idAddr = System.Convert.ToInt32(txtAddr.Text);

            bool rTrigger = false;

            if (comMon.GetTriggerSignal(idAddr, out rTrigger, out er))
            {
                if (rTrigger)
                {
                    labTrigger.ImageKey = "H";
                }
                else
                {
                    labTrigger.ImageKey = "L";
                }
                labStatus.Text      = CLanguage.Lan("读取模块触发信号成功");
                labStatus.ForeColor = Color.Blue;
            }
            else
            {
                labStatus.Text      = CLanguage.Lan("读取模块触发信号失败") + ":" + er;
                labStatus.ForeColor = Color.Red;
            }
        }
Ejemplo n.º 16
0
 private void FrmIDCard_Load(object sender, EventArgs e)
 {
     string[] com = System.IO.Ports.SerialPort.GetPortNames();
     cmbCOM.Items.Clear();
     for (int i = 0; i < com.Length; i++)
     {
         cmbCOM.Items.Add(com[i]);
     }
     if (com.Length > 0)
     {
         cmbCOM.Text = com[0];
     }
     cmbVer.Items.Clear();
     cmbVer.Items.Add(CLanguage.Lan("旧版本A"));
     cmbVer.Items.Add(CLanguage.Lan("新版本B"));
     cmbVer.SelectedIndex = 1;
     cmdMode.Items.Clear();
     cmdMode.Items.Add(CLanguage.Lan("模式") + "A");
     cmdMode.Items.Add(CLanguage.Lan("模式") + "B");
     cmdMode.Items.Add(CLanguage.Lan("模式") + "C");
     cmdMode.SelectedIndex = 0;
 }
Ejemplo n.º 17
0
        /// <summary>
        /// 写入IO信号
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        private bool writeIO(int addr, out string er)
        {
            er = string.Empty;

            try
            {
                _syncLock.AcquireWriterLock(-1);

                foreach (EFMB_wIO ioType in _Mon[addr].Para.wIO.Keys)
                {
                    if (_Mon[addr].Para.wIO[ioType].op == EOP.写入)
                    {
                        Thread.Sleep(_delayMs);

                        if (!_devFMB.SetIO(addr, ioType, _Mon[addr].Para.wIO[ioType].ioVal, out er))
                        {
                            Thread.Sleep(_delayMs);

                            if (!_devFMB.SetIO(addr, ioType, _Mon[addr].Para.wIO[ioType].ioVal, out er))
                            {
                                er = _Mon[addr].ToString() + CLanguage.Lan("写信号") + "[" + ioType.ToString() + "];";
                                return(false);
                            }
                        }
                        _Mon[addr].Para.wIO[ioType].op = EOP.写入OK;
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
            finally
            {
                _syncLock.ReleaseWriterLock();
            }
        }
Ejemplo n.º 18
0
        private void snFailView_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                string Sn = snFailView.Rows[e.RowIndex].Cells[0].Value.ToString();

                string ReportPath = snFailView.Rows[e.RowIndex].Cells[7].Value.ToString();

                if (MessageBox.Show(CLanguage.Lan("确定要打开机型测试报表") + "SN[" + Sn + "]?", "Tip", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
                {
                    return;
                }

                if (!File.Exists(ReportPath))
                {
                    MessageBox.Show(CLanguage.Lan("找不到测试报表") + "[" + ReportPath + "]," + CLanguage.Lan("请检查是否删除?"), "Tip", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                Process.Start(ReportPath);
            }
        }
Ejemplo n.º 19
0
        public override void LoadTheme()
        {
            base.LoadTheme();

            int max = CSettings.MaxNumPlayer + 1;

            if (max > 7)
            {
                max = 7;
            }

            SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].NumVisible = max;
            SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].NumVisible = max;

            SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(CLanguage.Translate("TR_CONFIG_OFF"));
            SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(CLanguage.Translate("TR_CONFIG_OFF"));

            for (int i = 1; i <= CSettings.MaxNumPlayer; i++)
            {
                SelectSlides[htSelectSlides(SelectSlideRecordChannel1)].AddValue(i.ToString());
                SelectSlides[htSelectSlides(SelectSlideRecordChannel2)].AddValue(i.ToString());
            }

            for (int i = 0; i < 26; i++)
            {
                SelectSlides[htSelectSlides(SelectSlideDelay)].AddValue((i * 20).ToString() + " ms");
            }

            ChannelEnergy = new float[StaticEnergyChannel.Length];

            for (int i = 0; i < ChannelEnergy.Length; i++)
            {
                Statics[htStatics(StaticEnergyChannel[i])].Visible = false;
                ChannelEnergy[i] = 0f;
            }

            Equalizers[htEqualizer(EqualizerChannel1)].ScreenHandles = true;
            Equalizers[htEqualizer(EqualizerChannel2)].ScreenHandles = true;
        }
        private void manipulateRow(CTable o)
        {
            String  payeeName   = o.GetFieldValue("CHEQUE_ENTITY_NAME");
            String  entityName  = o.GetFieldValue("ENTITY_NAME");
            Boolean balanceFlag = o.GetFieldValue("BALANCE_FLAG").Equals("Y");
            int     status      = CUtil.StringToInt(o.GetFieldValue("DOCUMENT_STATUS"));

            String statusDesc = CUtil.InvDocStatusToString((InventoryDocumentStatus)status);

            o.SetFieldValue("DOCUMENT_STATUS_DESC", statusDesc);

            o.SetFieldValue("DESCRIPTION", payeeName);
            if (payeeName.Equals(""))
            {
                o.SetFieldValue("DESCRIPTION", entityName);
            }

            if (balanceFlag)
            {
                o.SetFieldValue("DOCUMENT_NO", CLanguage.getValue("balance_forward"));
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// 设置治具使用次数和不良次数
 /// </summary>
 /// <param name="ttNum"></param>
 /// <param name="failNum"></param>
 public void SetFixUseNumAndFailNum(int ttNum, int failNum, string status = "")
 {
     if (this.InvokeRequired)
     {
         this.Invoke(new Action <int, int, string>(SetFixUseNumAndFailNum), ttNum, failNum, status);
     }
     else
     {
         labTTNum.Text       = ttNum.ToString();
         labFailNum.Text     = failNum.ToString();
         labStatus.ForeColor = Color.Blue;
         if (status == "")
         {
             labStatus.Text = CLanguage.Lan("检查治具状态OK.");
         }
         else
         {
             labStatus.Text      = status;
             labStatus.ForeColor = Color.Red;
         }
     }
 }
Ejemplo n.º 22
0
        private void mnuLocationAdd_Click(object sender, RoutedEventArgs e)
        {
            if (!CHelper.VerifyAccessRight("INVENTORY_LOCATION_ADD"))
            {
                return;
            }

            ObservableCollection <MBaseModel> arr = new ObservableCollection <MBaseModel>();

            String        caption = CLanguage.getValue("add") + " " + CLanguage.getValue("location");
            CWinLoadParam param   = new CWinLoadParam();

            param.Caption           = caption;
            param.Mode              = "A";
            param.ParentItemSources = arr;
            Boolean refresh = FactoryWindow.ShowWindow("WinAddEditLocation", param);

            if (refresh)
            {
                CMasterReference.LoadLocation(true, null);
            }
        }
Ejemplo n.º 23
0
        public static Boolean ValidatePasswordBox(Label lbl, PasswordBox tb, Boolean AllowEmpty)
        {
            String str = CLanguage.getValue("ERROR_TEXT_VALIDATE");
            String fmt = String.Format(str, lbl.Content);

            if (tb.IsEnabled)
            {
                if (AllowEmpty)
                {
                    return(true);
                }

                if (tb.Password.Trim().Equals(""))
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    tb.Focus();
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 24
0
        public static Boolean ValidateLookup(Label lbl, ULookupSearch2 ulk, Boolean AllowEmpty)
        {
            String str = CLanguage.getValue("ERROR_TEXT_VALIDATE");
            String fmt = String.Format(str, lbl.Content);

            if (ulk.IsEnabled)
            {
                if (AllowEmpty)
                {
                    return(true);
                }

                if (ulk.IsEmpty())
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    ulk.Focus();
                    return(false);
                }
            }

            return(true);
        }
        public override Tuple <CTable, ObservableCollection <MBaseModel> > QueryData()
        {
            CTable tb = model.GetDbObject();

            tb.SetFieldValue("CATEGORY", eType);

            items = OnixWebServiceAPI.GetArApTransactionList(tb);
            lastObjectReturned = OnixWebServiceAPI.GetLastObjectReturned();

            itemSources.Clear();
            int idx = 0;

            foreach (CTable o in items)
            {
                MArApTransaction v = new MArApTransaction(o);
                v.IsEnabled = false;

                if (idx == 0)
                {
                    //Create one for balance forward
                    MArApTransaction bfw = new MArApTransaction(new CTable(""));
                    bfw.IsEnabled = false;

                    bfw.IsBalanceForward     = true;
                    bfw.DocumentMovementNo   = CLanguage.getValue("balance_forward");
                    bfw.DocumentDateMovement = v.DocumentDateMovement;
                    bfw.EndAmount            = v.BeginAmount;
                    itemSources.Add(bfw);
                }

                v.RowIndex = idx;
                itemSources.Add(v);
                idx++;
            }

            Tuple <CTable, ObservableCollection <MBaseModel> > tuple = new Tuple <CTable, ObservableCollection <MBaseModel> >(lastObjectReturned, itemSources);

            return(tuple);
        }
Ejemplo n.º 26
0
        private void btnFail_Click(object sender, EventArgs e)
        {
            if (CGlobalPara.LogLevel[0] == 0)
            {
                MessageBox.Show(CLanguage.Lan("当前用户权限不够解除报警"), "Tip", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (MessageBox.Show(CLanguage.Lan("确认为【不良产品】,治具将直接过站?"), "Tip", MessageBoxButtons.YesNo, MessageBoxIcon.Question) !=
                DialogResult.Yes)
            {
                return;
            }

            result = 1;

            if (dlg != null)
            {
                dlg.Dispose();
                dlg = null;
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 设置状态
        /// </summary>
        /// <param name="addr"></param>
        /// <param name="status"></param>
        /// <param name="er"></param>
        /// <returns></returns>
        public bool Request_WriteMonStatus(int addr, ESTATUS status, out string er)
        {
            er = string.Empty;

            try
            {
                if (!_Mon.ContainsKey(addr))
                {
                    er = "[" + addr.ToString("D2") + "]" + CLanguage.Lan("不存在");
                    return(false);
                }

                _Mon[addr].Base.status = status;

                return(true);
            }
            catch (Exception ex)
            {
                er = ex.ToString();
                return(false);
            }
        }
Ejemplo n.º 28
0
        private static Boolean ValidateComboBox(String strMsg, Label lbl, ComboBox cb, Boolean AllowEmpty)
        {
            String lb = "";

            if (lbl != null)
            {
                lb = lbl.Content.ToString();
            }

            String str = CLanguage.getValue("ERROR_TEXT_VALIDATE");
            String fmt = "";

            if (!lb.Equals(""))
            {
                fmt = String.Format(str, lbl.Content);
            }
            else if (!strMsg.Equals(""))
            {
                fmt = String.Format(str, strMsg);
            }

            if (cb.IsEnabled)
            {
                if (AllowEmpty)
                {
                    return(true);
                }

                if (cb.Text.Trim().Equals(""))
                {
                    CMessageBox.Show(fmt, "ERROR", MessageBoxButton.OK, MessageBoxImage.Error);
                    cb.Focus();
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 29
0
        private void mnuContextMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu  = (sender as MenuItem);
            string   name = mnu.Name;

            if (name.Equals("mnuEdit"))
            {
                showEditWindow();
            }
            else if (name.Equals("mnuCorrection"))
            {
                MLogImportIssue v    = (MLogImportIssue)currentObj;
                int             type = CUtil.StringToInt(v.DocumentType);

                String caption = "";

                if (type == (int)AccountDocumentType.AcctDocCashSale)
                {
                    caption = CLanguage.getValue("sale_cash_saling");
                    if (!CHelper.VerifyAccessRight("SALE_CSHSALE_ADD"))
                    {
                        return;
                    }
                }
                else if (type == (int)AccountDocumentType.AcctDocDebtSale)
                {
                    caption = CLanguage.getValue("sale_debt_saling");
                    if (!CHelper.VerifyAccessRight("SALE_DBTSALE_MENU"))
                    {
                        return;
                    }
                }

                WinAddEditAccountSaleDoc w = new WinAddEditAccountSaleDoc("E", (AccountDocumentType)type, null, v);
                w.Caption = CLanguage.getValue("bill_correction") + " " + caption;
                w.ShowDialog();
            }
        }
Ejemplo n.º 30
0
        protected Boolean verifyData()
        {
            if (!validateData())
            {
                return(false);
            }

            CUtil.EnableForm(false, this);
            CTable newobj = OnixWebServiceAPI.SubmitObjectAPI(verifyAPIName, vw.GetDbObject());

            CUtil.EnableForm(true, this);

            if (newobj == null)
            {
                //Error here
                CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null);
                return(false);
            }

            MInventoryDoc vcd = new MInventoryDoc(newobj);

            vcd.InitErrorItem();
            if (vcd.ErrorItems.Count > 0)
            {
                WinErrorDetails w = new WinErrorDetails(vcd.ErrorItems, "InventoryDoc");
                w.Title = CLanguage.getValue("approve_error");
                w.ShowDialog();

                return(false);
            }
            else
            {
                String msg = CLanguage.getValue("VERIFY_SUCCESS");
                CMessageBox.Show(msg, "SUCCESS", MessageBoxButton.OK, MessageBoxImage.Information);
            }

            return(true);
        }