protected void btnUpdateExchange_Documents_Click(object sender, EventArgs e) { try { lblMessage.Text = ""; util.GetActionMenu(mpMenu.SelectedItem.Value); CamposRequeridos(); var ect = HeaderReq(); var ectNow = new ExchangeCompositeType(); var em = new ExchangeManager(); ect = em.getExchangeById(int.Parse(lblIdExchange.Text.Trim())); ect.iStatus = 2; em.UpdateExchange(ect, ((RadButton)sender).ID); ectNow = em.getExchangeByPreFolioUnique(ect.sFolioPre); lblIdExchange.Text = ectNow.iIdExchange.ToString(); if (ddlExchange.SelectedItem.Text.Contains("Cambio")) { var adm = new AffectationDocumentsManager(); if (adm.GetCountAffectationDocumentsByIdExchange(int.Parse(lblIdExchange.Text.ToString())) > 0) { adm.UpdateAffectationDocuments(Afectacion()); } else { adm.AddAffectationDocuments(Afectacion()); } } BlockControls(); btnClean.Visible = true; btnGenetate.Visible = false; lblPrefolio.Visible = true; lblPrefolioTitle.Visible = true; btnUpdateExchange_Documents.Visible = false; btnExchangeUpdate.Visible = true; lblPrefolio.Text = ectNow.sFolioPre; txtSrchPreFol.Text = ectNow.sFolioPre; gvExchange.DataBind(); } catch (AccessViolationException ave) { Alert.Permisos(this.Page); } catch (ArgumentException ae) { util.ErroDisplay(3, ae.Message, ref lblMessage); } catch (Exception ex) { util.ErroDisplay(1, ex.Message, ref lblMessage); } }
private void AddDocumentosAfectados() { if (ddlExchange.SelectedItem.Text.Contains("Cambio")) { var adct = new affectationDocumentsCompositeType(); var adm = new AffectationDocumentsManager(); adct.bAMEF = chkAMEF.Checked; adct.bCost = chkCost.Checked; adct.bDevices = chkDevices.Checked; adct.bDrawing = chkDrawing.Checked; adct.bEspecifications = chkEspecification.Checked; adct.bHOE = chkHOE.Checked; adct.bMedia = chkMedia.Checked; adct.bMold = chkMold.Checked; adct.bOthers = chkOthers.Checked; adct.bPlan = chkPlan.Checked; adct.bSAP = chkSAP.Checked; adct.bSingOff = chkSing.Checked; adct.iIdExchange = int.Parse(lblIdExchange.Text.ToString()); try { if (adm.GetCountAffectationDocumentsByIdExchange(adct.iIdExchange) > 0) { adm.UpdateAffectationDocuments(adct); } else { adm.AddAffectationDocuments(adct); } } catch (Exception ex) { throw new Exception(ex.Message); } } }