Exemplo n.º 1
0
    protected void btnGenetate_Click(object sender, EventArgs e)
    {
        try
        {
            util.GetActionMenu(mpMenu.SelectedItem.Value);
            lblMessage.Text = "";
            Util.validateDatesHomeEnd(calLimite.SelectedDate.ToString(), "Fecha Limite");
            CamposRequeridos();
            var em  = new ExchangeManager();
            var ect = HeaderReq();
            ect.iStatus   = 1;
            ect.sFolio    = "0";
            ect.sFolioPre = DateTime.Now.Year.ToString() + String.Format("{0:00}", int.Parse(DateTime.Now.Month.ToString())) + String.Format("{0:0000}", em.GetNumberPrefolio());

            em.AddExchange(ect, false);
            var ectNow = em.getExchangeByPreFolioUnique(ect.sFolioPre);
            lblIdExchange.Text = ectNow.iIdExchange.ToString();

            if (ddlExchange.SelectedItem.Text.Contains("Cambio"))
            {
                var adm = new AffectationDocumentsManager();
                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);
        }
    }
Exemplo n.º 2
0
 private static void CreateExchange(ExchangeManager exchangeManager, Assembly asm, Type type)
 {
     if (!exchangeManager.LoadedExchanges.Contains(type.FullName))
     {
         var instance =
             asm.CreateInstance(type.FullName, false, BindingFlags.CreateInstance,
                                null,
                                new object[] { exchangeManager },
                                CultureInfo.CurrentCulture,
                                null)
             as ExchangeBase;
         if (instance != null)
         {
             Log.Info("Exchange {0} loaded", instance.Name);
             exchangeManager.AddExchange(instance);
         }
     }
 }
Exemplo n.º 3
0
    protected void btnGenetate_Click(object sender, EventArgs e)
    {
        try
        {
            util.GetActionMenu(mpMenu.SelectedItem.Value);
            lblMessage.Text = "";
            Util.validateDatesHomeEnd(calLimitDate.SelectedDate.ToString(), "Fecha Limite");
            CamposRequeridos();
            var em  = new ExchangeManager();
            var ect = new ExchangeCompositeType();
            HeaderReq(ref ect, true);
            em.AddExchange(ect, true);
            var ectNow = em.getExchangeByPreFolioUnique(0.ToString());
            lblIdExchange.Text = ectNow.iIdExchange.ToString();
            AddDocumentosAfectados();

            BlockControls();
            btnClean.Visible            = true;
            btnGenetate.Visible         = false;
            lblPrefolio.Visible         = true;
            lblPrefolioTitle.Visible    = true;
            btnUpdateExchangeOk.Visible = false;
            btnExchangeUpdate.Visible   = true;
            lblPrefolio.Text            = ectNow.sFolio;  //Add
            txtSrchPreFol.Text          = ectNow.sFolio;  //Add
        }
        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);
        }
    }