Example #1
0
        protected void guardar()
        {
            try
            {
                if (BllMensajeria.ExistActa(int.Parse(TxtNroActa1.Text)) == 0)
                {
                    BllMensajeria.Mensajeria ObjGrabar = new BllMensajeria.Mensajeria();
                    ObjGrabar.MensActa = int.Parse(TxtNroActa1.Text);
                    ObjGrabar.MensUsua = Usuario.username;
                    ObjGrabar.MensFech = System.DateTime.Now;
                    ObjGrabar.MensOper = int.Parse(CmbEmpresa.SelectedValue);
                    ObjGrabar.MensEsta = 1;
                    ObjGrabar.MensUsSi = Usuario.username;
                    ObjGrabar.MensFeSi = System.DateTime.Now;
                    ObjGrabar.MensCaDe = 0;
                    int r = ObjGrabar.Insert();
                    if (r > 0)
                    {
                        TxtCodi.Text = r.ToString().PadLeft(5, '0');
                        Acta = BllActas.GetActa(ObjGrabar.MensActa);

                        if (Acta.EstadoActa == 4)
                        {

                            //Guardamos el registro en la Bitacora
                            ObjGrabarBit.BitaActa = int.Parse(TxtNroActa1.Text);
                            ObjGrabarBit.BitaUsua = Usuario.username;
                            ObjGrabarBit.BitaFeca = System.DateTime.Now;
                            ObjGrabarBit.BitaEsMe =0;
                            ObjGrabarBit.BitaEsCa = 0;
                            ObjGrabarBit.BitaEsAn = Acta.EstadoActa;
                            Acta.EstadoActa = 11;
                            ObjGrabarBit.BitaEsAc = Acta.EstadoActa;

                            if (Acta.Update() > 0)
                            {
                                ObjGrabarBit.Insert();
                                Log.EscribirTraza("Estado del Acta Actualizado");
                                Response.Redirect("GestionBandejaS.aspx",false);
                            }
                            else
                            {
                                Metodos.divMensaje(Constantes.Danger, "Error al actualizar Estado del Acta", PnlMsg, Constantes.Fallo);
                            }
                        }
                    }
                    //UpdateNew.Update();
                    //ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "anotaciones();", true);
                }
            }
            catch (Exception ex)
            {
                Metodos.divMensaje(Constantes.Danger, Constantes.ErrorAlGuardar, PnlMsg, Constantes.Fallo);
                Log.EscribirError(ex);
            }
        }
Example #2
0
        protected void Modificar()
        {
            try
            {
                if (BllMensajeria.Exist(int.Parse(TxtCodi.Text)) == 1)
                {
                    BllMensajeria.Mensajeria ObjGrabar = new BllMensajeria.Mensajeria();
                    ObjGrabar = BllMensajeria.GetMens((int.Parse(TxtCodi.Text)));
                  //  ObjGrabar.MensActa = int.Parse(TxtNroActa1.Text);
                    ObjGrabar.MensOper = int.Parse(CmbEmpresa.SelectedValue);
                    ObjGrabar.MensUsSi = Usuario.username;
                    ObjGrabar.MensFeSi = System.DateTime.Now;
                    ObjGrabar.MensCaDe = 0;
                    int r = ObjGrabar.Update();
                    if (r > 0)
                    {
                        TxtCodi.Text = r.ToString().PadLeft(5, '0');
                        if (Acta.EstadoActa == 4)
                        {

                            //Guardamos el registro en la Bitacora
                            ObjGrabarBit.BitaActa = int.Parse(TxtNroActa1.Text);
                            ObjGrabarBit.BitaUsua = Usuario.username;
                            ObjGrabarBit.BitaFeca = System.DateTime.Now;
                            ObjGrabarBit.BitaEsMe = 0;
                            ObjGrabarBit.BitaEsCa = 0;
                            ObjGrabarBit.BitaEsAn = Acta.EstadoActa;
                            Acta.EstadoActa = 11;
                            ObjGrabarBit.BitaEsAc = Acta.EstadoActa;

                            if (Acta.Update() > 0)
                            {
                                ObjGrabarBit.Insert();
                                Log.EscribirTraza("Estado del Acta Actualizado");
                            }
                            else
                            {
                                Metodos.divMensaje(Constantes.Danger, "Error al actualizar Estado del Acta", PnlMsg, Constantes.Fallo);
                            }
                        }

                    }
                }
            }
            catch (Exception ex)
            {
                Metodos.divMensaje(Constantes.Danger, Constantes.ErrorAlGuardar, PnlMsg, Constantes.Fallo);
                Log.EscribirError(ex);
            }
        }