Esempio n. 1
0
    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);
        }
    }
Esempio n. 2
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);
        }
    }
Esempio n. 3
0
 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);
         }
     }
 }
Esempio n. 4
0
    private void selectedExchange(int iIdExchange)
    {
        var ex = new ExchangeCompositeType();
        var em = new ExchangeManager();

        ViewState["Exchange"] = iIdExchange;
        ex = em.getExchangeById(iIdExchange);
        if (ex != null)
        {
            lblPrefolio.Text   = ex.sFolio;
            lblIdExchange.Text = ex.iIdExchange.ToString();

            try
            {
                ddlExchange.SelectedValue = ex.iIdExchangeType.ToString();
                ddlPlant.SelectedValue    = ex.iIdPlant.ToString();
                ddlPriority.SelectedValue = ex.iIdPriority.ToString();
                ddlClient.SelectedValue   = ex.iIdClient.ToString();
                ddlSerie.SelectedValue    = ex.iSerie.ToString();
                ddlEngeenerProduct_Asignacion(iIdExchange, ex.iProductEngener);
            }
            catch (Exception e)
            {
                Response.Redirect("/Error/PageError.aspx?ex=" + iIdExchange + "er=ddl", true);
            }
            txtAction.Text      = ex.sMeasure;
            txtContact.Text     = ex.sContact;
            txtDescription.Text = ex.sDescription;
            txtIssue.Text       = ex.sIssue;
            try
            {
                calLimitDate.SelectedDate = ex.dInitChange as DateTime?;
            }
            catch (Exception e)
            {
                calLimitDate.SelectedDate = null;
            }
            txtLastFolio.Text = ex.sLastFolio;
            txtProyectPlataformDescription.Text = ex.sProyect;
            txtReason.Text = ex.sReason;

            BlockControls();

            CleanControls();

            if (ex.sExchangeType.Contains("Cambio"))
            {
                pnDocuments.Visible = true;
                var adm  = new AffectationDocumentsManager();
                var adct = adm.GetAffectationDocumentsByIdExchange(iIdExchange);
                chkAMEF.Checked           = adct.bAMEF;
                chkCost.Checked           = adct.bCost;
                chkDevices.Checked        = adct.bDevices;
                chkDrawing.Checked        = adct.bDrawing;
                chkEspecification.Checked = adct.bEspecifications;
                chkHOE.Checked            = adct.bHOE;
                chkMedia.Checked          = adct.bMedia;
                chkMold.Checked           = adct.bMold;
                chkOthers.Checked         = adct.bOthers;
                chkPlan.Checked           = adct.bPlan;
                chkSAP.Checked            = adct.bSAP;
                chkSing.Checked           = adct.bSingOff;
            }
            else
            {
                pnDocuments.Visible = false;
            }
            lblPrefolio.Text         = ex.sFolio;
            txtSrchPreFol.Text       = ex.sFolio;
            lblPrefolio.Visible      = true;
            lblPrefolioTitle.Visible = true;
        }
        else
        {
            CleanControlsExchange();
        }
    }
Esempio n. 5
0
    private void selectedExchange(int iIdExchange)
    {
        var ex = new ExchangeCompositeType();
        var em = new ExchangeManager();

        lblMessage.Text = string.Empty;
        try
        {
            ex = em.getExchangeById(iIdExchange);
            if (ex != null)
            {
                lblPrefolio.Text          = ex.sFolioPre;
                lblIdExchange.Text        = ex.iIdExchange.ToString();
                ddlExchange.SelectedValue = ex.iIdExchangeType.ToString();
                ddlPlant.SelectedValue    = ex.iIdPlant.ToString();
                ddlPriority.SelectedValue = ex.iIdPriority.ToString();
                ddlClient.SelectedValue   = ex.iIdClient.ToString();
                ddlSerie.SelectedValue    = ex.iSerie.ToString();
                ddlEngeenerProduct_Asignacion(iIdExchange, ex.iProductEngener);
                txtAction.Text      = ex.sMeasure;
                txtContact.Text     = ex.sContact;
                txtDescription.Text = ex.sDescription;
                txtIssue.Text       = ex.sIssue;
                if (ex.dLimitDate != null)
                {
                    calLimite.SelectedDate = (DateTime)ex.dLimitDate;
                }
                txtLastFolio.Text = ex.sLastFolio;
                txtProyectPlataformDescription.Text = ex.sProyect;
                txtReason.Text = ex.sReason;
                BlockControls();
                CleanControls();
                if (ex.sExchangeType.ToString() == "Cambio")
                {
                    pnDocuments.Visible = true;
                    var adct = new affectationDocumentsCompositeType();
                    var adm  = new AffectationDocumentsManager();
                    adct                      = adm.GetAffectationDocumentsByIdExchange(iIdExchange);
                    chkAMEF.Checked           = adct.bAMEF;
                    chkCost.Checked           = adct.bCost;
                    chkDevices.Checked        = adct.bDevices;
                    chkDrawing.Checked        = adct.bDrawing;
                    chkEspecification.Checked = adct.bEspecifications;
                    chkHOE.Checked            = adct.bHOE;
                    chkMedia.Checked          = adct.bMedia;
                    chkMold.Checked           = adct.bMold;
                    chkOthers.Checked         = adct.bOthers;
                    chkPlan.Checked           = adct.bPlan;
                    chkSAP.Checked            = adct.bSAP;
                    chkSing.Checked           = adct.bSingOff;
                }
                else
                {
                    pnDocuments.Visible = false;
                }
                lblPrefolio.Text         = ex.sFolioPre;
                txtSrchPreFol.Text       = ex.sFolioPre;
                lblPrefolio.Visible      = true;
                lblPrefolioTitle.Visible = true;
            }
        }
        catch (Exception e)
        {
            throw new Exception(e.Message);
        }
    }