private void Quote() { if (ddlNoPartCot.Items.Count > 0) { pnQuote.Visible = true; pnQuoteNon.Visible = false; var plct = new PartListCompositeType(); var plm = new PartListManager(); var ect = new ExchangeCompositeType(); var em = new ExchangeManager(); plct = plm.getPartListById(int.Parse(ddlNoPartCot.SelectedValue.ToString())); ect = em.getExchangeById(int.Parse(lblIdExchange.Text)); lblNoPartC.Text = plct.iNumber.ToString(); lblNoPartClientC.Text = plct.iNumberClient.ToString(); lblProyectc.Text = ect.sProyect.ToString(); lblPartList.Text = plct.iIdPart.ToString(); lblDescriptionC.Text = "Descripcion del Cambio: " + ect.sDescription.ToString(); ddlAfectationCot.DataBind(); calculate(); } else { pnQuote.Visible = false; pnQuoteNon.Visible = true; } }
protected void btnAddPartList_Click(object sender, EventArgs e) { var lstError = new errorCompositeType(); try { util.GetActionMenu(mpMenu.SelectedItem.Value); String sDescription = txtDescriptionPartList.Text.Trim(); String iNumber = txtNumberPartList.Text.Trim(); string iNumberClient = txtNumberPartListClient.Text.Trim(); Util.isRequired(sDescription, "Descripción"); Util.isRequired(iNumber, "Numero"); Util.isRequired(iNumberClient, "Numero"); Util.validatePartList(iNumber, "No. de Parte"); Util.validatePartList(iNumberClient, "No. de Parte Cliente"); var rm = new PartListManager(); const string iIdEntity = "0"; if (rm.ExistPartListDuplicate(int.Parse(iIdEntity), iNumber, sDescription, iNumberClient)) { util.ErroDisplay(3, "La Descripción o Número ya existe, no es posible duplicar registros.", ref lblMessage); } else { rm.AddPartList(iNumber, sDescription, iNumberClient); CleanControls(); util.ErroDisplay(5, string.Empty, ref lblMessage); ddlPartListExchangePartList.DataBind(); } } catch (AccessViolationException ave) { Alert.Permisos(this.Page); } catch (ArgumentException ae) { util.ErroDisplay(3, ae.Message, ref lblMessage); } catch (Exception ex) { util.ErroDisplay(1, string.Empty, ref lblMessage); } }
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; } }