Example #1
0
    protected void btnGenerateFolio_Click(object sender, EventArgs e)
    {
        try
        {
            util.GetActionMenu(mpMenu.SelectedItem.Value);
            var ect = new ExchangeCompositeType();
            var em  = new ExchangeManager();
            var tem = new TaskExchangeManager();             //Add

            ect = em.getExchangeById(int.Parse(lblIdExchange.Text));
            int      iMax        = tem.getMaxTimingByIdExchange(ect); //Add
            DateTime dAplication = calAplicationDate.SelectedDate.Value;
            dAplication.AddDays(iMax * 7);                            //Add
            tem.UpdateTime_byGenerate(int.Parse(lblIdExchange.Text), calAplicationDate.SelectedDate.Value, ((RadButton)sender).ID);
            //Add DateTime dAplication = DateTime.Parse(txtAplicationDate.Text);
            ect.dAplicationDate = dAplication;
            ect.iStatus         = 12;
            //Add em.UpdateExchange(ect);
            em.UpdateExchangeDate(ect);
            lblFolioGen.Text        = ((DateTime)ect.dAplicationDate).ToShortDateString().ToString();
            pnGenerateFolio.Visible = false;
            pnFolio.Visible         = true;
        }
        catch (AccessViolationException ave)
        {
            Alert.Permisos(this.Page);
        }
        catch (Exception ex)
        {
            util.ErroDisplay(1, ex.Message, ref lblMessage);
        }
    }