Пример #1
0
        private void btnGuardarAmparo_Click(object sender, System.EventArgs e)
        {
            DateTime fechaInicio            = UpdatetxtFechaInicio.Text == ""?ConstantesArquitectura.c_NullDateTime:Convert.ToDateTime(UpdatetxtFechaInicio.Text);
            DateTime fechaFin               = UpdatetxtFechaFin.Text == "" ?ConstantesArquitectura.c_NullDateTime:Convert.ToDateTime(UpdatetxtFechaFin.Text);
            int      IdAmparoMedidaCautelar = Convert.ToInt32(VarPersistent.Get("IdMedidaCautelarAmparo"));
            int      IdDenuncia             = Convert.ToInt32(VarPersistent.Get("IdDenuncia"));


            if (fechaInicio == ConstantesArquitectura.c_NullDateTime)
            {
                this.MostrarMensaje("Fecha de Inicio es un campo obligatorio");
            }
            else if (DateTime.Compare(fechaInicio, fechaFin) > 0 && fechaFin != ConstantesArquitectura.c_NullDateTime)
            {
                this.MostrarMensaje("Formato Incorrecto: La fecha de Inicio es obligatoria y debe ser menor a la fecha de Fin");
            }
            else
            {
                AltaModificacionMedidaCautelarOAmparoActionRequest  ammcoaRequest  = new AltaModificacionMedidaCautelarOAmparoActionRequest();
                AltaModificacionMedidaCautelarOAmparoActionResponse ammcoaResponse = new AltaModificacionMedidaCautelarOAmparoActionResponse();

                ammcoaRequest.FechaInicio             = fechaInicio;
                ammcoaRequest.FechaFin                = fechaFin;
                ammcoaRequest.IdConceptoILT           = Convert.ToInt32(cmbILT.SelectedValue);
                ammcoaRequest.IdMedidaCautelarOAmparo = IdAmparoMedidaCautelar == 0 ? ConstantesArquitectura.c_NullInteger: IdAmparoMedidaCautelar;
                ammcoaRequest.IdDenuncia              = IdDenuncia;
                ammcoaRequest.BitEliminado            = false;

                this.LogicaNegocio.Execute(ammcoaRequest, ammcoaResponse);

                if (this.LogicaNegocio.ExecOk)
                {
                    VarPersistent.Del("IdDenuncia");
                    VarPersistent.Del("IdMedidaCautelarAmparo");
                    this.RegisterStartupScript("Close", "<script>window.parent.$(\"#dialog-Amparo\").dialog(\"close\");window.parent.RefrescarVista();window.parent.$(\"#dialog-Amparo\").dialog(\"destroy\");</script>");
                }
            }
        }
Пример #2
0
        override protected void PageLoadEvent(object sender, System.EventArgs e)
        {
            this.Response.Expires = 0;


            VarPersistent.Set("IdDenuncia", Request.QueryString["idDenuncia"].ToString());

            if (Request.QueryString["IdMedidaCautelarAmparo"] != null)
            {
                VarPersistent.Set("IdMedidaCautelarAmparo", Request.QueryString["IdMedidaCautelarAmparo"].ToString());

                cmbILT.SelectedValue      = Request.QueryString["IdTipoPrestacion"].ToString();
                UpdatetxtFechaInicio.Text = Request.QueryString["FechaInicio"].ToString();
                UpdatetxtFechaFin.Text    = Request.QueryString["FechaFin"].ToString();
            }


            //se utiliza para llamar a la carga de las librerias de jquery y del CU
            StringBuilder sb = new StringBuilder();

            sb.Append("<script>" + this.funciones("") + "</script>");
            RegisterStartupScript("Validar", sb.ToString());
        }