private void HeaderReq(ref ExchangeCompositeType ect, bool bGenerate) { try { ect.iIdClient = int.Parse(ddlClient.SelectedValue); ect.iIdExchangeType = int.Parse(ddlExchange.SelectedValue); ect.iIdPlant = int.Parse(ddlPlant.SelectedValue); ect.iIdPriority = int.Parse(ddlPriority.SelectedValue);; ect.iProductEngener = int.Parse(ddlEngeenerProduct.SelectedValue); ect.iSerie = int.Parse(ddlSerie.SelectedValue); ect.sContact = txtContact.Text.Trim(); ect.sDescription = txtDescription.Text.Trim(); ect.sIssue = txtIssue.Text.Trim(); ect.sMeasure = txtAction.Text.Trim(); ect.sProyect = txtProyectPlataformDescription.Text.Trim(); ect.sReason = txtReason.Text.Trim(); ect.dLimitDate = calLimitDate.SelectedDate.Value; ect.sLastFolio = txtLastFolio.Text.Trim(); if (bGenerate) { ect.iStatus = 6; var em = new ExchangeManager(); //SITI - CAFC 24102011 Corrección para generar el folio acorde a la letra inicial String sFolio = ddlSerie.SelectedItem.Text.Substring(0, 1) + DateTime.Today.Year.ToString().Substring(2, 2) + ddlExchange.SelectedItem.Text.Substring(0, 1) + String.Format("{0:0000}", em.GetNumberFolio()); ect.sFolio = sFolio; ect.sFolioPre = "0"; } else { ect.iStatus = 2; } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void btnGenerateFolio_Analize_Click(object sender, EventArgs e) { try { util.GetActionMenu(mpMenu.SelectedItem.Value); UpdateExchange(int.Parse(lblIdExchange.Text)); var em = new ExchangeManager(); String sFolio = Exchange.sSerie.ToString().Substring(0, 1) + DateTime.Today.Year.ToString().Substring(2, 2) + Exchange.sExchangeType.ToString().Substring(0, 1) + String.Format("{0:0000}", em.GetNumberFolio()); Exchange.sFolio = sFolio; Exchange.iStatus = 6; em.UpdateExchange(Exchange, ((RadButton)sender).ID); lblFolioGen.Text = Exchange.sFolio.ToString(); pnGenerateFolio.Visible = false; pnFolio.Visible = true; } catch (AccessViolationException ave) { Alert.Permisos(this.Page); } catch (Exception ex) { util.ErroDisplay(1, ex.Message, ref lblMessage); } }