Esempio n. 1
0
 public void Init(int ID, string WPT, IRole uvo, SummonVO svo)
 {
     PickedProduct = ProductFactory.Create(ID, WPT);
     textBox1.Text = PickedProduct.GetName();
     this.UVO      = uvo;
     this.SVO      = svo;
 }
Esempio n. 2
0
        public void Paint(string IDSUMMON)
        {
            SummonVO SVO = SummonVO.SummonVOByID(IDSUMMON);

            tslBillPayedColor.BackColor = (SVO.BILLPAYED) ? Color.Green : Color.Red;
            tslDocsReadyColor.BackColor = (SVO.DOCSREADY) ? Color.Green : Color.Red;
            switch (ROLE)
            {
            //case Roles.Manager: case Roles.Buhgalter:
            //SummonVO SVO = SummonVO.SummonVOByID(IDSUMMON);
            //tslBillPayedColor.BackColor = (SVO.BILLPAYED) ? Color.Green : Color.Red;
            //tslDocsReadyColor.BackColor = (SVO.DOCSREADY) ? Color.Green : Color.Red;
            //break;
            case Roles.Ozis:
                DBPURCHASEDMATERIALS dbpm_s = new DBPURCHASEDMATERIALS();
                PurchMaterials       pm_s;
                pm_s = dbpm_s.Get(IDSUMMON);
                tslConnectorsForOrder.BackColor      = (pm_s.CONNECTORSFORORDER) ? Color.Green : Color.Red;
                tslConnectorsInStock.BackColor       = (pm_s.CONNECTORSINSTOCK) ? Color.Green : Color.Red;
                tslFastenersForOrder.BackColor       = (pm_s.MATERIALSANDFASTENERSFORORDER) ? Color.Green : Color.Red;
                tslFastenersInStock.BackColor        = (pm_s.MATERIALSANDFASTENERSINSTOCK) ? Color.Green : Color.Red;
                tslHardwareForeignForOrder.BackColor = (pm_s.HARWAREFOREIGNFORORDER) ? Color.Green : Color.Red;
                tslHardwareForeignInStock.BackColor  = (pm_s.HARWAREFOREIGNINSTOCK) ? Color.Green : Color.Red;
                tslHardwareForOrder.BackColor        = (pm_s.HARDWAREFORORDER) ? Color.Green : Color.Red;
                tslHardwareInStock.BackColor         = (pm_s.HARDWAREINSTOCK) ? Color.Green : Color.Red;
                tslPackingForOrder.BackColor         = (pm_s.PACKINGFORORDER) ? Color.Green : Color.Red;
                tslPackingInStock.BackColor          = (pm_s.PACKINGINSTOCK) ? Color.Green : Color.Red;
                tslShildForOrder.BackColor           = (pm_s.SHILDSFORORDER) ? Color.Green : Color.Red;
                tslShildInStock.BackColor            = (pm_s.SHILDSINSTOCK) ? Color.Green : Color.Red;
                break;
            }
        }
Esempio n. 3
0
        public void Init(string path, bool req, bool enbl, bool reqvis, bool reqenbl, Roles resprole, string access_mode, IRole UVO_, string docname, SummonVO SVO_, IProduct product)
        {
            //this.PATH = path;
            //tbPath.Tag = path;
            this.UVO                = UVO_;
            this.SVO                = SVO_;
            this.PRODUCT            = product;
            this.DOCUMENTNAME       = docname;
            this.ACCESSMODE         = access_mode;
            this.ResposibleRole     = resprole;
            this.Tag                = ResposibleRole;
            this.CurrentRole        = UVO_.Role;
            this.FullPath           = path;
            this.Required           = req;
            this.RequiredVisible    = reqvis;
            this.chRequired.Enabled = reqenbl;
            this.Enabled            = enbl;
            tt = new ToolTip();
            tt.SetToolTip(this.tbPath, this.FullPath);
            tt = new ToolTip();
            tt.SetToolTip(this.bRemark, "Добавить замечание");

            //если путь пустой - то выключить замечание нужно в Init
            //эта фича не нужна оказывается...(
            //if (FullPath == "<нет>")
            //{
            //    bRemark.Enabled = false;
            //    bRemark.BackgroundImage = Resources.exclamation_disable;
            //}
            //else
            //{
            //    SetRemarkIcons();

            //}
            SetRemarkIcons();
            SetYellow();
            if ((this.ACCESSMODE == "NEW") || (this.ACCESSMODE == "NEWCLONE"))
            {
                bRemark.Enabled = false;
            }


            //this.tbPath.
            //tbPath.Text = this.FileName;
            //SetIcons();
        }
Esempio n. 4
0
        public void SaveSummon(ShowSummon ss)
        {
            if (ss.tbQUANTITY.Value == 0)
            {
                MessageBox.Show("Введите количество изделий!");
                return;
            }
            if (ss.cbCustDept.SelectedValue == null)
            {
                MessageBox.Show("Добавьте отдел заказчика!");
                return;
            }
            DBSummon dbs = new DBSummon();
            SummonVO SVO = new SummonVO();

            SVO     = SummonVO.SummonVOByID(ss.SVO.ID);
            SVO.ID  = ss.SVO.ID;
            SVO.IDS = ss.tbIDS.Text;
            //SVO.ACCEPTANCE = ss.cbAccept.Text;
            SVO.CONTRACT       = ss.tbCONTRACT.Text;
            SVO.CREATED        = ss.SVO.CREATED;
            SVO.DELIVERY       = ss.tbDELIVERY.Text;
            SVO.IDCUSTOMER     = ss.cbCustomers.SelectedValue.ToString();
            SVO.IDCUSTOMERDEPT = (int)ss.cbCustDept.SelectedValue;
            SVO.PAYSTATUS      = ss.tbPayStatus.Text;
            SVO.IDSTATUS       = 1;//тута просто фейковую единичку ставим, потом при занесении в базу проставится нормальный статус
            SVO.PTIME          = ss.dtpPTIME.Value;
            SVO.QUANTITY       = (int)ss.tbQUANTITY.Value;
            SVO.SHIPPING       = ss.tbSHIPPING.Text;

            if (ss.cbSISP.SelectedIndex == 0)
            {
                SVO.SISP = false;
            }
            else
            {
                SVO.SISP = true;
            }
            SVO.IDACCEPT  = (int)ss.cbAccept.SelectedValue;
            SVO.IDPACKING = (int)ss.cbPacking.SelectedValue;

            /*SVO.IDMOUNTINGKIT = (int)ss.cbMountingKit.SelectedValue;
             * if (ss.chbDeterm.Checked)
             * {
             *  SVO.PASSDATE = null;
             * }
             * else
             * {
             *  SVO.PASSDATE = ss.dtpAPPROX.Value;
             * }*/
            SVO.BILLPAYED    = ss.chbBillPayed.Checked;
            SVO.DOCSREADY    = ss.chbDocsRdy.Checked;
            SVO.VIEWED       = true;
            SVO.CONTRACTTYPE = ss.cbCONTRACTTYPE.Text;
            SVO.PLANKA       = (ss.pfPLANKA.FullPath == "<нет>") ? null : ss.pfPLANKA.FullPath;
            SVO.PLANKAREQ    = ss.pfPLANKA.Required;
            SVO.SERIAL       = (ss.pfSERIAL.FullPath == "<нет>") ? null : ss.pfSERIAL.FullPath;
            SVO.SERIALREQ    = ss.pfSERIAL.Required;
            SVO.BILLNUMBER   = ss.tbBillNumber.Text;

            SVO.PASSPORT       = (ss.pfPASSPORT.FullPath == "<нет>") ? null : ss.pfPASSPORT.FullPath;
            SVO.PASSPORTREQ    = ss.pfPASSPORT.Required;
            SVO.MANUAL         = (ss.pfMANUAL.FullPath == "<нет>") ? null : ss.pfMANUAL.FullPath;
            SVO.MANUALREQ      = ss.pfMANUAL.Required;
            SVO.PACKINGLIST    = (ss.pfPACKINGLIST.FullPath == "<нет>") ? null : ss.pfPACKINGLIST.FullPath;
            SVO.PACKINGLISTREQ = ss.pfPACKINGLIST.Required;
            //SVO.LENGTH = ss.tbLENGTH.Text;
            //SVO.WIDTH = ss.tbWIDTH.Text;
            //SVO.HEIGHT = ss.tbHEIGHT.Text;
            //SVO.WEIGHT = ss.tbWEIGHT.Text;

            dbs.SaveSummon(SVO);
            ss.SVO = SVO;

            /*if (ss.dtpApproxAtLoad != SVO.PASSDATE)
             * {
             *  dbs.PassDateChanged(SVO.ID);
             * }*/
            MessageBox.Show("Извещение успешно сохранено!");
        }