예제 #1
0
    private void Quote()
    {
        if (ddlPartListC.Items.Count > 0)
        {
            pnQuoteA.Visible   = true;
            pnQuoteNon.Visible = false;

            var plct = new DS.SAI.Data.PartListCompositeType();
            var plm  = new PartListManager();

            var ect = new DS.SAI.Data.ExchangeCompositeType();
            var em  = new ExchangeManager();

            var qct = new DS.SAI.Data.QuoteCompositeType();
            var qm  = new QuoteManager();

            qct.iExchange = int.Parse(lblIdExchange.Text.ToString());
            qct.iPartList = int.Parse(ddlPartListC.SelectedValue.ToString());
            plct          = plm.getPartListById(int.Parse(ddlPartListC.SelectedValue.ToString()));
            ect           = em.getExchangeById(int.Parse(lblIdExchange.Text));

            lblNoParC.Text       = plct.iNumber.ToString();
            lblClientC.Text      = ect.sClient.ToString();
            lblProyectC.Text     = ect.sProyect.ToString();
            lblDescriptionC.Text = ect.sDescription.ToString();

            if (qm.ExistQuoteDuplicate(qct))
            {
                qct = qm.getQuoteById(qct);

                txtDateIn.Text          = qct.dIn.ToShortDateString();
                txtDateProm.Text        = qct.dProm.ToShortDateString();
                txtDateOut.Text         = qct.dOut.ToShortDateString();
                txtSOPClientC.Text      = qct.SOPCliente;
                txtMoldC.Text           = qct.iMoldProt.ToString();
                txtMoldSC.Text          = qct.iMoldSerie.ToString();
                txtCFC.Text             = qct.iCF.ToString();
                txtDeviceC.Text         = qct.iDevice.ToString();
                txtObsoletC.Text        = qct.iObsolet.ToString();
                txtManEngC.Text         = qct.iEngMan.ToString();
                txtDesignC.Text         = qct.iDesign.ToString();
                txtComponentsC.Text     = qct.iComponents.ToString();
                txtOthersTitleWC.Text   = qct.sOthers.ToString();
                txtOthersWC.Text        = qct.iOthers.ToString();
                txtPaintC.Text          = qct.iPaint.ToString();
                txtEmpC.Text            = qct.iEmp.ToString();
                txtBankC.Text           = qct.iBank.ToString();
                txtPrue.Text            = qct.iOthersC.ToString();
                txtPoundC.Text          = qct.iPound.ToString();
                txtDelta1.Text          = qct.iDelta1.ToString();
                txtDelta2.Text          = qct.iDelta2.ToString();
                txtCost.Text            = qct.iCost.ToString();
                txtR1.Text              = qct.iFR1.ToString();
                txtR2.Text              = qct.iFR2.ToString();
                txtMoldPlazoC.Text      = qct.iMoldP.ToString();
                txtMoldProtC.Text       = qct.iMoldProtP.ToString();
                txtDateStart.Text       = qct.iStart.ToString();
                txtObsC.Text            = qct.sDescription.ToString();
                lblINVTotal.Text        = qct.iTotalInv.ToString();
                lblTotalPieceTotal.Text = qct.iTotalP.ToString();
                chkMoldC.Checked        = qct.bMoldProt;
                chkMoldSC.Checked       = qct.bMoldSerie;
                chkCFC.Checked          = qct.bCF;
                chkDeviceC.Checked      = qct.bDevice;
                chkObsoletC.Checked     = qct.bObsolet;
                chkManEngC.Checked      = qct.bEngMan;
                chkDesingC.Checked      = qct.bDesign;
                chkComponetsC.Checked   = qct.bComponents;
                chkOthersWC.Checked     = qct.bOthers;
                chkPaintC.Checked       = qct.bPaint;
                chkEmpC.Checked         = qct.bEmp;
                chkBankC.Checked        = qct.bBank;
                setVisibleChecked();
                BlockQuote();
                btnUpdateQuote.Visible        = true;
                btnUpdateQuoteGuardar.Visible = false;
                btnAddQuote.Visible           = false;
            }
            else
            {
                clearControlsQuote();
                UnblockQuote();
            }
        }
        else
        {
            pnQuoteA.Visible   = false;
            pnQuoteNon.Visible = true;
        }
    }