示例#1
0
文件: Avtor.cs 项目: TabVV/Sklad1C
        private void AfterConstruct(MainF xF)
        {
            xNSI    = xF.xNSI;
            xSm     = xF.xSm;
            nCurReg = (int)xF.xDLLPars;

            // центровка формы
            Rectangle screen = Screen.PrimaryScreen.Bounds;

            this.Location = new Point((screen.Width - this.Width) / 2,
                                      (screen.Height - this.Height) / 2);

            SetBindSmenaPars();
            SetAvtFields();

            if (xMF.evReadNSI != null)
            {// загрузку НСИ выполнять параллельно авторизации
                xTh          = new Thread(new ThreadStart(ReadLocNSI));
                xTh.Priority = ThreadPriority.Lowest;
                xTh.Start();
            }
            if (nCurReg != AppC.AVT_PARS)
            {// парметры изменяются только с клавиатуры
                ehScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanBage);
                xMF.xBCScanner.BarcodeScan += ehScan;
            }
            else
            {
                xOldSm.nSklad  = xSm.nSklad;
                xOldSm.nUch    = xSm.nUch;
                xOldSm.sDatDoc = xSm.DocData;
                xOldSm.nReg    = xSm.RegApp;
            }
            BeginEditAvt(nCurReg);
        }
示例#2
0
        // разбор параметров от главной формы
        private void AfterConstruct(object xx)
        {
            object[]
            x = (object[])xx;

            try
            {
                xMF       = (MainF)(x[0]);
                bAutoMark = (bool)(x[1]);
            }
            catch { }

            xNSI = xMF.xNSI;

            //ehOldScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanPL);
            ehOldScan = new BarcodeScanner.BarcodeScanEventHandler(OnScan);
            xMF.xBCScanner.BarcodeScan += ehOldScan;
            xHelpS  = new Srv.HelpShow(this);
            lstHelp = new List <string>(new string[] {
                xMF.xFuncs.TryGetFuncKeys(AppC.F_UPLD_DOC).PadRight(CMD_SIGHN) + " - выгрузка сведений",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_CHG_REC).PadRight(CMD_SIGHN) + " - новая паллетта",
                "->,<-".PadRight(CMD_SIGHN) + " - смена емкости",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_EASYEDIT).PadRight(CMD_SIGHN) + " - новый документ",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_LOAD_DOC).PadRight(CMD_SIGHN) + " - стрейчевание",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_A4MOVE).PadRight(CMD_SIGHN) + " - режим стрейч",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_KMCINF).PadRight(CMD_SIGHN) + " - без WMS",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_QUIT).PadRight(CMD_SIGHN) + " - выход",
                xMF.xFuncs.TryGetFuncKeys(AppC.F_MARKWMS).PadRight(CMD_SIGHN) + " - возврат в главную"
            });
            //System.Reflection.AssemblyName xAN = System.Reflection.Assembly.GetExecutingAssembly().GetName();
            //string sV = xAN.Version.ToString();
            //int nPoint = sV.LastIndexOf(".");
            //lHelp.Text = String.Format("<F1> - помощь           v{0}", sV.Substring(nPoint));
            xMF.CheckNSIState(false);

            this.Tag = null;

            // номер ID-точки
            tDevID.Text = sDevID = Smena.EnterPointID;

            chNewDoc.Checked = (sDevID.Length > 0)?false:true;

            enWrapMode = xMF.xPars.WrapMode;
            SetWrapp();

            if (xMF.xPars.CanEditIDNum)
            {
                tDevID.Focus();
            }
            else
            {
                tDevID.Enabled = false;
                if (sDevID.Length > 0)
                {
                    MainCycleStart(sDevID, false);
                }
            }
        }
示例#3
0
        public void AfterConstruct(MainF xM)
        {
            xMainF = xM;
            xNSI   = xM.xNSI;
            // каждый раз все по-новой
            xMainF.aAvtoPark = null;
            nRegFixing       = (int)xMainF.xDLLPars;

            xPark  = new ParkA(nRegFixing);
            dvAvto = xNSI.DT[NSI.BD_SOTG].dt.DefaultView;

            SetBindShlyuz();

            // Настройки грида
            dgShlyuz.SuspendLayout();
            dgShlyuz.DataSource = bsSh;
            ShlzStyle(dgShlyuz);
            dgShlyuz.ResumeLayout();

            ehOldScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanPL);
            xMainF.xBCScanner.BarcodeScan += ehOldScan;
            if (xMainF.xSm.urCur >= Smena.USERRIGHTS.USER_BOSS_SKLAD)
            {
                tPropusk.Enabled = true;
                tShlAddr.Enabled = true;
            }
            if (xMainF.aAvtoPark == null)
            {// по умолчанию - прибытие
                //lHeadP.SuspendLayout();
                lHeadP.BackColor = colCome;
                //lHeadP.ResumeLayout();
                if (nRegFixing == AppC.FX_PTLST)
                {
                    BeginEditP(null);
                }
            }
            else
            {// последней была операция прибытия
                xPark.DRCome           = dvAvto.Table.NewRow();
                xPark.DRCome.ItemArray = xMainF.aAvtoPark;
                bsSh.Filter            = string.Format("ID={0}", xPark.DRCome["ID"]);
                bsSh.ResetBindings(false);
                dgShlyuz.Focus();
                // сейчас предлагается убытие
                xPark.NShl     = (int)xPark.DRCome["NSH"];
                xPark.NPtvList = (int)xPark.DRCome["ND"];
                xPark.NSm      = int.Parse((string)xPark.DRCome["KSMEN"]);
                tNDoc.DataBindings[0].ReadValue();
                tSm.DataBindings[0].ReadValue();
                tShlAddr.DataBindings[0].ReadValue();
                tIn.Text   = "Прибыл  " + (string)xPark.DRCome["DTP"];
                tAvto.Text = (string)xPark.DRCome["KAVT"];
                IOChange(IO_GOUT);
                IsParkAvail();
            }
        }
示例#4
0
        // вход в режим ввода/корректировки параметров
        public void EditPars(int nReg, DocPars x, CTRL1ST FirstEd, AppC.VerifyEditFields dgVer, EditParsOver dgEnd)
        {
            bool
                bEnField = true;

            xDP = x;
            if (x != null)
            {
                //bQuitEdPars = false;
                nCurFunc = nReg;
                //bWorkWithDocPars = true;
                //ServClass.dgVerEd = new AppC.VerifyEditFields(dgVer);
                dgOver = new EditParsOver(dgEnd);
                SetParFields(xDP);

                oldKeyH    = ehCurrFunc;
                ehCurrFunc = new Srv.CurrFuncKeyHandler(PPars_KeyDown);

                //xBCScanner.BarcodeScan -= ehScan;
                ehParScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanPar);
                xBCScanner.BarcodeScan += ehParScan;

                //BeginEditPars(FirstEd, dgVer);

                aEdVvod = new AppC.EditListC(dgVer);

                if (nReg == AppC.F_LOAD_DOC)
                {
                    if (xDP.sBC_Doc.Length > 0)
                    {
                        bEnField = false;
                    }
                }
                aEdVvod.AddC(tKT_p, bEnField);
                aEdVvod.AddC(tNom_p, bEnField);
                aEdVvod.AddC(tBCDoc);

                if (FirstEd == CTRL1ST.START_EMPTY)
                {
                    aEdVvod.SetCur(0);
                }
                else
                {
                    aEdVvod.SetCur(tBCDoc);
                }
                SetEditMode(true);
            }
        }
示例#5
0
文件: Shlyuz.cs 项目: TabVV/Sklad1C
        public void AfterConstruct(MainF xM, string e, int nKrKMC, bool bSelectEAN)
        {
            xMainF = xM;
            xNSI   = xM.xNSI;
            sEAN   = e;

            dvAvto = xNSI.DT[NSI.NS_MC].dt.DefaultView;

            bsSh            = new BindingSource();
            bsSh.DataSource = dvAvto;
            if (bSelectEAN)
            {
                lEAN.Text = String.Format("EAN13 = <{0}>", sEAN);
            }
            else
            {
                lEAN.Text = String.Format("Краткий код = <{0}>", nKrKMC);
            }


            // Настройки грида
            dgShlyuz.SuspendLayout();
            dgShlyuz.DataSource = bsSh;
            ShlzStyle(dgShlyuz);
            dgShlyuz.ResumeLayout();

            if (bSelectEAN)
            {
                bsSh.Filter = string.Format("EAN13='{0}'", sEAN);
            }
            else
            {
                bsSh.Filter = string.Format("KRKMC={0}", nKrKMC);
            }
            bsSh.Sort = "KSK";
            bsSh.ResetBindings(false);
            dgShlyuz.Focus();

            ehOldScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanPL);
            xMainF.xBCScanner.BarcodeScan += ehOldScan;
        }
示例#6
0
        // вход в режим ввода/корректировки параметров
        public void EditPars(int nReg, DocPars x, CTRL1ST FirstEd, AppC.VerifyEditFields dgVer, EditParsOver dgEnd)
        {
            xDP = x;
            if (x != null)
            {
                //bQuitEdPars = false;
                nCurFunc         = nReg;
                bWorkWithDocPars = true;
                //ServClass.dgVerEd = new AppC.VerifyEditFields(dgVer);
                dgOver = new EditParsOver(dgEnd);
                SetParFields(xDP);

                oldKeyH                 = ehCurrFunc;
                ehCurrFunc              = new Srv.CurrFuncKeyHandler(PPars_KeyDown);
                ehParScan               = new BarcodeScanner.BarcodeScanEventHandler(OnScanPar);
                xBCScanner.BarcodeScan -= ehScan;
                xBCScanner.BarcodeScan += ehParScan;

                BeginEditPars(FirstEd, dgVer);
            }
        }
示例#7
0
        private bool AfterConstruct(MainF x)
        {
            int
                nTotM_ZVK = 0,
                nTotM_TTN = 0;
            string
                sRf;
            DataView
                dvM;

            xMF  = x;
            xNSI = xMF.xNSI;

            bDocIsKMPL = ((int)x.xCDoc.drCurRow["TYPOP"] == AppC.TYPOP_KMPL) ? true : false;
            //if (bDocIsKMPL)
            //{
            //    bWillMark = xMF.IsZkzReady(true);
            //    if (!bWillMark)
            //        return (false);
            //}

            ehOldScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanPL);
            xMF.xBCScanner.BarcodeScan += ehOldScan;

            //xFuncs = x.xFuncs;
            nNomPodd = x.xCDoc.xNPs.Current;

            //tNomPoddon.Text = (xMF.xCDoc.nCurNomPodd + 1).ToString();
            tSSCC.Text = "";

            if (bDocIsKMPL)
            {
                this.Text       = String.Format("Текущий поддон {0}", x.xCDoc.xNPs.Current);
                tNomPoddon.Text = xMF.xCDoc.xNPs.TryNext(false, true).ToString();
                lNomsAvail.Text = "(" + xMF.xCDoc.xNPs.RangeN() + ")";

                sRf = xMF.xCDoc.DefDetFilter() + String.Format(" AND (NPODDZ={0})", x.xCDoc.xNPs.Current);
            }
            else
            {
                this.Text       = String.Format("Текущий поддон {0}", x.xCDoc.xNPs.Current + 1);
                lNomPodd.Text   = "";
                tNomPoddon.Text = "";
                lNomsAvail.Text = "";

                sRf = xMF.xCDoc.DefDetFilter();
                if ((int)xMF.xCDoc.drCurRow["CHKSSCC"] <= 0)
                {
                    sRf += " AND (LEN(SSCC)<>20)";
                }
            }

            dvM = new DataView(xNSI.DT[NSI.BD_DOUTD].dt, sRf, "", DataViewRowState.CurrentRows);
            foreach (DataRowView drv in dvM)
            {
                nTotM_TTN += (int)drv.Row["KOLM"];
            }
            if (x.bZVKPresent)
            {
                if (!bDocIsKMPL)
                {
                    sRf = xMF.xCDoc.DefDetFilter();
                }
                dvM = new DataView(xNSI.DT[NSI.BD_DIND].dt, sRf, "", DataViewRowState.CurrentRows);
                foreach (DataRowView drv in dvM)
                {
                    nTotM_ZVK += (int)drv.Row["KOLM"];
                }
            }

            lMestOnPodd.Text = String.Format("Мест = {0} (заказ = {1})", nTotM_TTN, nTotM_ZVK);

            return(true);
        }
示例#8
0
        private bool AfterConstruct(MainF xF)
        {
            bool
                cbAvail = true,
                ret     = false;
            int
                i;

            xNSI    = xF.xNSI;
            xSm     = xF.xSm;
            nCurReg = (int)xF.xDLLPars;

            // центровка формы
            Rectangle screen = Screen.PrimaryScreen.Bounds;

            this.Location = new Point((screen.Width - this.Width) / 2,
                                      (screen.Height - this.Height) / 2);

            SetBindSmenaPars();

            i = WhatNextMode(ref cbAvail, 1);
            if (i < 0)
            {
                Srv.ErrorMsg("Запуск программы запрещен!");
            }
            else
            {
                cbReg.SelectedValue = xSm.RegApp = i;
                SetAvtFields();

                if (xMF.evReadNSI != null)
                {// загрузку НСИ выполнять параллельно авторизации
                    xTh          = new Thread(new ThreadStart(ReadLocNSI));
                    xTh.Priority = ThreadPriority.Lowest;
                    xTh.Start();
                }
                if (nCurReg != AppC.AVT_PARS)
                {// парметры изменяются только с клавиатуры
                    ehScan = new BarcodeScanner.BarcodeScanEventHandler(OnScanBage);
                    xMF.xBCScanner.BarcodeScan += ehScan;
                }
                else
                {
                    xOldSm.nSklad  = xSm.nSklad;
                    xOldSm.nUch    = xSm.nUch;
                    xOldSm.sDatDoc = xSm.DocData;
                    xOldSm.nReg    = xSm.RegApp;
                }

                //if ( i < 0 )
                //{
                //    Srv.ErrorMsg("Нет разрешенных режимов!");
                //    this.DialogResult = DialogResult.Cancel;
                //}
                //else
                //    BeginEditAvt(nCurReg, i);

                BeginEditAvt(nCurReg, cbAvail);
                ret = true;
            }
            return(ret);
        }