예제 #1
0
        void conectar()
        {
            if (!(CnnFalp != null))
            {
                ExeConfigurationFileMap FileMap = new ExeConfigurationFileMap();
                FileMap.ExeConfigFilename = Application.StartupPath + @"\..\WF.config";
                Config = ConfigurationManager.OpenMappedExeConfiguration(FileMap, ConfigurationUserLevel.None);

                CnnFalp = new ConectarFalp(Config.AppSettings.Settings["dbServer"].Value, //ConfigurationManager.AppSettings["dbServer"],
                                           Config.AppSettings.Settings["dbUser"].Value,   //ConfigurationManager.AppSettings["dbUser"],
                                           Config.AppSettings.Settings["dbPass"].Value,   //ConfigurationManager.AppSettings["dbPass"],
                                           ConectarFalp.TipoBase.Oracle);

                if (CnnFalp.Estado == ConnectionState.Closed)
                {
                    CnnFalp.Abrir();                                           // abre la conexion
                }
                Conexion[0] = Config.AppSettings.Settings["dbServer"].Value;
                Conexion[1] = Config.AppSettings.Settings["dbUser"].Value;
                Conexion[2] = Config.AppSettings.Settings["dbPass"].Value;
            }



            // this.Text = this.Text + " [Versión: " + Application.ProductVersion + "] [Conectado: " + Conexion[0] + "]";
            //User = ValidaMenu.LeeUsuarioMenu();
            User            = "******";
            LblUsuario.Text = "Usuario: " + User;
            //LblUsuario.Text = "Usuario: " + User;
        }
        private void Frm_Visor_Etapas_Load(object sender, EventArgs e)
        {
            if (!(CnnFalp != null))
            {
                ExeConfigurationFileMap FileMap = new ExeConfigurationFileMap();
                FileMap.ExeConfigFilename = Application.StartupPath + @"\..\WF.config";
                Config = ConfigurationManager.OpenMappedExeConfiguration(FileMap, ConfigurationUserLevel.None);

                CnnFalp = new ConectarFalp(Config.AppSettings.Settings["dbServer"].Value, //ConfigurationManager.AppSettings["dbServer"],
                                           Config.AppSettings.Settings["dbUser"].Value,   //ConfigurationManager.AppSettings["dbUser"],
                                           Config.AppSettings.Settings["dbPass"].Value,   //ConfigurationManager.AppSettings["dbPass"],
                                           ConectarFalp.TipoBase.Oracle);

                if (CnnFalp.Estado == ConnectionState.Closed)
                {
                    CnnFalp.Abrir();                                           // abre la conexion
                }
                Conexion[0] = Config.AppSettings.Settings["dbServer"].Value;
                Conexion[1] = Config.AppSettings.Settings["dbUser"].Value;
                Conexion[2] = Config.AppSettings.Settings["dbPass"].Value;

                this.Text = this.Text + " [Versión: " + Application.ProductVersion + "] [Conectado: " + Conexion[0] + "]";
            }
            Db_Usuario = "SICI";
            Cargar_gilla();
        }
예제 #3
0
        private void Frm_Etapas_Load(object sender, EventArgs e)
        {
            if (!(CnnFalp != null))
            {
                ExeConfigurationFileMap FileMap = new ExeConfigurationFileMap();
                FileMap.ExeConfigFilename = Application.StartupPath + @"\..\WF.config";
                Config = ConfigurationManager.OpenMappedExeConfiguration(FileMap, ConfigurationUserLevel.None);

                CnnFalp = new ConectarFalp(Config.AppSettings.Settings["dbServer"].Value, //ConfigurationManager.AppSettings["dbServer"],
                                           Config.AppSettings.Settings["dbUser"].Value,   //ConfigurationManager.AppSettings["dbUser"],
                                           Config.AppSettings.Settings["dbPass"].Value,   //ConfigurationManager.AppSettings["dbPass"],
                                           ConectarFalp.TipoBase.Oracle);

                if (CnnFalp.Estado == ConnectionState.Closed)
                {
                    CnnFalp.Abrir();                                           // abre la conexion
                }
                Conexion[0] = Config.AppSettings.Settings["dbServer"].Value;
                Conexion[1] = Config.AppSettings.Settings["dbUser"].Value;
                Conexion[2] = Config.AppSettings.Settings["dbPass"].Value;

                this.Text = this.Text + " [Versión: " + Application.ProductVersion + "] [Conectado: " + Conexion[0] + "]";
            }
            Db_Usuario = "SICI";

            txtreclamo.Text     = reclamo.ToString();
            txtcaso.Text        = caso.ToString();
            txtpaciente.Text    = paciente;
            txtreclamo.Enabled  = false;
            txtcaso.Enabled     = false;
            txtpaciente.Enabled = false;

            Cargar_gilla();
            Validar_estados();
            int etapas_activas = Validar_Estado_sub_etapa();
            int v_etapas       = dt.Rows.Count;

            v_ac.Text = etapas_activas.ToString();
            v_c.Text  = v_etapas.ToString();
        }
예제 #4
0
        protected void btn_confirmar_pedido(object sender, EventArgs e)
        {
            ConectarFalp conn = new  ConectarFalp(BD, User, Pass, ConectarFalp.TipoBase.Oracle);

            if (conn.Estado == ConnectionState.Closed)
            {
                conn.Abrir();
            }

            try
            {
                conn.IniciarTransaccion();

                guardar_detalle_tipo_comida();
                guardar_detalle_distribucion();
                guardar_detalle_alimentos();

                conn.ConfirmarTransaccion();
                conn.Cerrar();

                if (Convert.ToInt32(cod_alimento) > 0)
                {
                    string res1 = "Estimado Usuario, El pedido se registrado correctamente";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup4('" + res1 + "');", true);
                }
                else
                {
                    string res1 = "Estimado Usuario, error al realizar pedido";
                    ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup4('" + res1 + "');", true);
                }
            }
            catch (Exception ex)
            {
                string res1 = ex.ToString();
                ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup4('" + res1 + "');", true);
                conn.ReversarTransaccion();
            }
        }
예제 #5
0
        private void Ges002M_Load(object sender, EventArgs e)
        {
            if (!(CnnFalp != null))
            {
                ExeConfigurationFileMap FileMap = new ExeConfigurationFileMap();
                FileMap.ExeConfigFilename = Application.StartupPath + @"\..\WF.config";
                Config = ConfigurationManager.OpenMappedExeConfiguration(FileMap, ConfigurationUserLevel.None);

                CnnFalp = new ConectarFalp(Config.AppSettings.Settings["dbServer"].Value, //ConfigurationManager.AppSettings["dbServer"],
                                           Config.AppSettings.Settings["dbUser"].Value,   //ConfigurationManager.AppSettings["dbUser"],
                                           Config.AppSettings.Settings["dbPass"].Value,   //ConfigurationManager.AppSettings["dbPass"],
                                           ConectarFalp.TipoBase.Oracle);

                if (CnnFalp.Estado == ConnectionState.Closed)
                {
                    CnnFalp.Abrir();                                           // abre la conexion
                }
                Conexion[0] = Config.AppSettings.Settings["dbServer"].Value;
                Conexion[1] = Config.AppSettings.Settings["dbUser"].Value;
                Conexion[2] = Config.AppSettings.Settings["dbPass"].Value;

                this.Text = this.Text + " [Versión: " + Application.ProductVersion + "] [Conectado: " + Conexion[0] + "]";
            }
            Db_Usuario      = "SICI";
            txtcaso.Text    = NCaso.ToString();
            txtreclamo.Text = Nreclamo.ToString();
            timer1.Start();

            if (estado == 4)
            {
                Lbl_Estado.Text = "CERRADO";
            }

            CargaPac();
            Cargar_historial_num_caso();
        }