protected void Page_Load(object sender, EventArgs e)
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Page.Header.Title = "HISTORIAL DE ACTIVACIONES";

        Decimal ID_EMPRESA = Convert.ToDecimal(QueryStringSeguro["reg"]);

        cliente _clienteMODULO = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaInfoEmpresa = _clienteMODULO.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaTablaInfoEmpresa = tablaInfoEmpresa.Rows[0];
        configurarInfoAdicionalModulo(true, filaTablaInfoEmpresa["RAZ_SOCIAL"].ToString());

        if (IsPostBack == false)
        {
            configurar_paneles_popup(Panel_FONDO_MENSAJE, Panel_MENSAJES);

            String accion = QueryStringSeguro["accion"].ToString();

            if (accion == "inicial")
            {
                iniciarControlesInicial();
            }
        }
    }
Exemplo n.º 2
0
 public AgregaDieta(cliente clienteAux)
 {
     InitializeComponent();
     this.clientePrincipal = clienteAux;
     materiasPrimas = this.materiaPrimaLoader.GetAll();
     foreach (var materiaPrima in materiasPrimas) {
         this.MateriasComboBox.Items.Add(materiaPrima.Nombre);
     }
 }
    protected void Button_BUSCAR_Click(object sender, EventArgs e)
    {
        configurarInfoAdicionalModulo(false, "");

        String datosCapturados = TextBox_BUSCAR.Text.ToUpper();
        String campo = DropDownList_BUSCAR.SelectedValue.ToString();

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaResultadosBusqueda = new DataTable();

        if (DropDownList_BUSCAR.SelectedValue == "RAZ_SOCIAL")
        {
            tablaResultadosBusqueda = _cliente.ObtenerEmpresaConRazSocial(datosCapturados);
        }
        else
        {
            if (DropDownList_BUSCAR.SelectedValue == "COD_EMPRESA")
            {
                tablaResultadosBusqueda = _cliente.ObtenerEmpresaConCodEmpresa(datosCapturados);
            }
        }

        if (tablaResultadosBusqueda.Rows.Count <= 0)
        {
            configurarMensajes(true, System.Drawing.Color.Red);
            if (_cliente.MensajeError != null)
            {
                Label_MENSAJE.Text = _cliente.MensajeError;
            }
            else
            {
                Label_MENSAJE.Text = "ADVERTENCIA: No se encontraron registros que cumplieran los datos de busqueda.";
            }

            Panel_BOTONES_INTERNOS.Visible = false;

            Panel_RESULTADOS_GRID.Visible = false;

            Panel_FormularioContratacion.Visible = false;
            Panel_FORMULARIO.Visible = false;
        }
        else
        {
            configurarMensajes(false, System.Drawing.Color.Green);

            Panel_RESULTADOS_GRID.Visible = true;
            GridView_RESULTADOS_BUSQUEDA.DataSource = tablaResultadosBusqueda;
            GridView_RESULTADOS_BUSQUEDA.DataBind();

            Panel_BOTONES_INTERNOS.Visible = false;

            Panel_FormularioContratacion.Visible = false;
            Panel_FORMULARIO.Visible = false;
        }
    }
Exemplo n.º 4
0
 private void AgregarButton_Click(object sender, EventArgs e)
 {
     StringBuilder str = new StringBuilder();
     bool isCorrect = true;
     long n;
     if (long.TryParse(this.CelularTextBox.Text, out n) && this.CelularTextBox.Text.Length == 10) {
     }
     else {
         isCorrect = false;
         str.Append("El numero de celular es incorrecto\n");
     }
     if (long.TryParse(this.TelefonoTextBox.Text, out n) && this.TelefonoTextBox.Text.Length == 10)
     {
     }
     else
     {
         isCorrect = false;
         str.Append("El numero de Telefono es incorrecto\n");
     }
     if (isCorrect) {
         ClienteLoader clienteLoader = new ClienteLoader();
         direccion direccionDb = new direccion
         {
             Direccion1 = this.DireccionTextBox.Text,
             CP = this.CPTextBox.Text,
             Estado = this.EstadoTextBox.Text,
             Municipio = this.MunicipioTextBox.Text
         };
         cliente clientedb = new cliente
         {
             Celular = this.CelularTextBox.Text,
             Nombre = this.NombreTextBox.Text,
             Telefono = this.TelefonoTextBox.Text,
             direccion = direccionDb
         };
         clientedb = clienteLoader.CreateNew(clientedb);
         if (clientedb == null)
         {
             MessageBoxButtons buttons = MessageBoxButtons.OK;
             DialogResult result;
             result = MessageBox.Show("", "Error al guardar sus datos", buttons);
         }
         else {
             MessageBoxButtons buttons = MessageBoxButtons.OK;
             DialogResult result;
             result = MessageBox.Show("", "Datos guardados con exito", buttons);
             this.clearAll();
         }
     }
     else {
         string caption = "Error de captura";
         MessageBoxButtons buttons = MessageBoxButtons.OK;
         DialogResult result;
         result = MessageBox.Show(str.ToString(), caption, buttons);
     }
 }
Exemplo n.º 5
0
 public void setDataClient(cliente clienteLocal)
 {
     this.principalCliente = clienteLocal;
     this.NombreLabel.Text = clienteLocal.Nombre;
     this.telefonoLabel.Text = clienteLocal.Telefono;
     this.celularLabel.Text = clienteLocal.Celular;
     this.DireccionLabel.Text = clienteLocal.direccion.Direccion1;
     this.MunicipioLabel.Text = clienteLocal.direccion.Municipio;
     this.EstadoLabel.Text = clienteLocal.direccion.Estado;
     this.CPLabel.Text = clienteLocal.direccion.CP;
 }
Exemplo n.º 6
0
        public bool agregarCliente(cliente nueva)
        {
            try
            {
                contexto.cliente.Add(nueva);

                return contexto.SaveChanges() > 0;
            }
            catch (Exception)
            {

                return false;
            }
        }
Exemplo n.º 7
0
        protected void btnRegistrarUser_Click(object sender, EventArgs e)
        {
            usuarios user     = new usuarios();
            cliente  clientes = new cliente();

            if (hdPasswordUsuario.Value != hdPasswordUsuario.Value)
            {
                return;
            }

            string nombre_usuario = (hdNombreUsuario.Value + "." + hdApellidoUsuario.Value).ToLower();

            clientes.idusuario   = nombre_usuario;
            clientes.nombre      = hdNombreUsuario.Value;
            clientes.apellido    = hdApellidoUsuario.Value;
            clientes.email       = hdCorreoUsuario.Value;
            clientes.fechaInicio = Convert.ToString(DateTime.Now);

            user.usuario  = nombre_usuario;
            user.correo   = hdCorreoUsuario.Value;
            user.password = hdPasswordUsuario.Value;



            if (Convert.ToInt32(dlTipoUsuario.SelectedValue) == 0)
            {
                user.tipousuario = "2";
            }
            else
            {
                user.tipousuario = dlTipoUsuario.SelectedValue;
            }

            string database = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["tdvbd"]);
            string server   = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["tdvsrv"]);

            cn.database = database;
            cn.server   = server;

            bool insert = logica_usuarios.insertar_usuario(cn, user, clientes);

            if (insert)
            {
                string javaScript = "refreshUsuarios();";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", javaScript, true);
            }
        }
Exemplo n.º 8
0
        public void TestViaje()
        {
            statusviaje status = CrearStatus();

            Assert.IsTrue(statusRepository.Create(status), statusRepository.Error);
            int idStatus = statusRepository.Read.Max(s => s.IdStatus);

            unidades unidad = CrearUnidades();

            Assert.IsTrue(unidadesRepository.Create(unidad), unidadesRepository.Error);
            int idUnidad = unidadesRepository.Read.Max(u => u.IdUnidad);

            ruta rutaViaje = CrearRuta(idUnidad);

            Assert.IsTrue(rutaRepository.Create(rutaViaje), rutaRepository.Error);
            int idRuta = rutaRepository.Read.Max(r => r.IdRuta);

            cliente clienteViaje = CrearCliente();

            Assert.IsTrue(clienteRepository.Create(clienteViaje), clienteRepository.Error);
            int idCliente = clienteRepository.Read.Max(c => c.IdCliente);

            operador op = CrearOperador();

            Assert.IsTrue(operadorRepository.Create(op), operadorRepository.Error);
            int idOPerador = operadorRepository.Read.Max(o => o.IdOperador);


            viaje nuevoViaje = CrearViaje(idStatus, idRuta, idCliente, idOPerador);

            Assert.IsTrue(viajeRepository.Create(nuevoViaje), viajeRepository.Error);
            int idViajeNuevo = viajeRepository.Read.Max(vj => vj.IdViajeSci);

            viaje aMOdificar = viajeRepository.SearchById(idViajeNuevo);

            aMOdificar.IdViajeCliente = "VIAJEFAURECIA";
            Assert.IsTrue(viajeRepository.Update(aMOdificar), viajeRepository.Error);



            Assert.IsTrue(viajeRepository.Delete(idViajeNuevo), viajeRepository.Error);
            Assert.IsTrue(operadorRepository.Delete(idOPerador), operadorRepository.Error);
            Assert.IsTrue(clienteRepository.Delete(idCliente), clienteRepository.Error);
            Assert.IsTrue(rutaRepository.Delete(idRuta), rutaRepository.Error);
            Assert.IsTrue(unidadesRepository.Delete(idUnidad), unidadesRepository.Error);
            Assert.IsTrue(statusRepository.Delete(idStatus), statusRepository.Error);
        }
        // GET: Cliente/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            cliente cliente = await db.cliente.FindAsync(id);

            if (cliente == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idDepartamento = new SelectList(db.departamento, "idDepartamento", "nombre", cliente.idDepartamento);
            ViewBag.idEstado       = new SelectList(db.estado, "idEstado", "nombre", cliente.idEstado);
            ViewBag.idMunicipio    = new SelectList(db.municipio, "idMunicipio", "nombre", cliente.idMunicipio);
            return(View(cliente));
        }
Exemplo n.º 10
0
        public ActionResult Eliminar(cliente objCliente)
        {
            mensajeInicialEliminar();
            using (FerreteriaDiplomadoEntities db = new FerreteriaDiplomadoEntities())
            {
                cliente cli = db.cliente.Find(objCliente.idCliente);
                db.SaveChanges();

                ViewBag.MensajeExito = "Cliente [" + objCliente.apPaterno + " " + objCliente.apMaterno + ", " + objCliente.nombre + "] Fue Eliminado!!!";
                return(RedirectToAction("Index"));
            }
            //objClienteNeg.delete(objCliente);
            //mostrarMensajeEliminar(objCliente);
            //Cliente objCLiente2 = new Cliente();
            //return View(objCLiente2);
            //return RedirectToAction("Index");
        }
Exemplo n.º 11
0
        public static void Main(string[] args)
        {
            cliente  clientito  = new cliente();
            gasolina gasolinita = new gasolina();

            Console.Write("Ingrese el nombre del cliente: ");
            clientito.Nombre = Console.ReadLine();
            Console.Write("Ingrese el apellidos del cliente: ");
            clientito.Apellidos = Console.ReadLine();
            Console.Write("Ingrese el numero de identificacion: ");
            clientito.Id = Console.ReadLine();
            Console.Write("Ingrese la direccion: ");
            clientito.Direccion = Console.ReadLine();

            Console.WriteLine("");

            Console.Write("Ingrese el tipo de gasolina: ");
            string abc = Console.ReadLine();

            if (abc == "extra" || abc == "super")
            {
                gasolinita.Tipo = abc;
            }

            else
            {
                Console.WriteLine("Tipo de gasolina no valida");
                gasolinita.Tipo = Console.ReadLine();
            }

            Console.Write("Ingrese cantidad de galones: ");
            gasolinita.CantidadDeGalones = Convert.ToDouble(Console.ReadLine());

            Console.Clear();
            Console.WriteLine("\t" + "  FACTURA  " + "\n");
            Console.WriteLine("  Nombres y Apellidos: " + clientito.Nombre + " " + clientito.Apellidos + "\n" +
                              "   Numero de cedula: " + clientito.Id + "\n" +
                              "   Direccion del cliente: " + clientito.Direccion + "\n");

            Console.WriteLine("     Valor de gasolina: $" + gasolinita.PrecioDeVenta);

            Console.WriteLine("     Subtotal a pagar: $" + gasolinita.SubTotal);
            Console.WriteLine("      Iva a pagar: $" + gasolinita.Iva);
            Console.WriteLine("     Total a pagar: $" + gasolinita.Total);
            Console.ReadKey();
        }
Exemplo n.º 12
0
        public ActionResult MiCuenta()
        {
            cliente us = (cliente)Session["cliente"];

            if (us == null)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                if (us.rol == "administrador")
                {
                    return(RedirectToAction("Clientes"));
                }
                return(View());
            }
        }
Exemplo n.º 13
0
        // GET: cliente/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            cliente cliente = db.cliente.Find(id);

            if (cliente == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_Cargo          = new SelectList(db.cargo, "ID_Cargo", "Tipo_Cargo", cliente.ID_Cargo);
            ViewBag.ID_Perfil         = new SelectList(db.perfil, "ID_Perfil", "Perfil1", cliente.ID_Perfil);
            ViewBag.ID_Tipo_Documento = new SelectList(db.tipo_documento, "ID_Tipo_Documento", "Nombre_TipoDeDocumento", cliente.ID_Tipo_Documento);
            return(View(cliente));
        }
Exemplo n.º 14
0
        public ActionResult DeleteConfirmed(int id)
        {
            var pedidos = db.pedido.Where(p => p.clienteID == id);

            if (pedidos.Count() > 0)
            {
                cliente e = db.cliente.Find(id);
                ViewData["error"] = "Este cliente tiene pedidos relacionados";
                return(View("delete", e));
            }

            cliente cliente = db.cliente.Find(id);

            db.cliente.Remove(cliente);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private void Btn_registrar_cliente_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ReglaAdministradorCliente rAC = new ReglaAdministradorCliente();


                cliente cliente = new cliente();

                cliente.Rut            = txt_rut.Text;
                cliente.RazonSocial    = txt_razon_social.Text;
                cliente.NombreContacto = txt_nombre_contacto.Text;
                cliente.MailContacto   = txt_mail_contacto.Text;
                cliente.Direccion      = txt_direccion.Text;
                cliente.Telefono       = txt_telefono.Text;
                cliente.Actividad      = (actividadEmpresa)cmb_actividad_empresa.SelectedItem;
                cliente.Tipo           = (tipoEmpresa)cmb_tipo_empresa.SelectedItem;

                if (!ValidarCampoVacio())
                {
                    try
                    {
                        rAC.ValidarCliente(txt_rut.Text);
                        coleccion.RegistrarCliente(cliente);
                        DesplegarListaDtg();
                        MessageBox.Show("CLIENTE: " + cliente.NombreContacto + " REGISTRADO CORRECTAMENTE");
                        Limpiar();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    DesplegarListaDtg();
                }

                else
                {
                    MessageBox.Show("NECESITA COMPLETAR TODOS LOS CAMPOS");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public IHttpActionResult Postcliente(cliente cliente)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            /*agregar la instancia de la tabla referenciada al contexto antes de insertar la instancia de la tabla con referencia
             * http://stackoverflow.com/questions/33185741/entity-framework-foreign-key-inserting-duplicate-key
             * the context has no understanding about estado, it assumes estado should be added and hence the exception */
            db.estados.Attach(cliente.estado1);

            db.clientes.Add(cliente);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = cliente.idcliente }, cliente));
        }
Exemplo n.º 17
0
        public ActionResult uploadCSV(HttpPostedFileBase fileform)
        {
            string filePath = string.Empty;

            if (fileform != null)
            {
                //ruta de la carpeta que caragara el archivo
                string path = Server.MapPath("~/Uploads/");

                //verificar si la ruta de la carpeta existe
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                //obtener el nombre del archivo
                filePath = path + Path.GetFileName(fileform.FileName);
                //obtener la extension del archivo
                string extension = Path.GetExtension(fileform.FileName);

                //guardando el archivo
                fileform.SaveAs(filePath);

                string csvData = System.IO.File.ReadAllText(filePath);
                foreach (string row in csvData.Split('\n'))
                {
                    if (!string.IsNullOrEmpty(row))
                    {
                        var newCliente = new cliente
                        {
                            nombre    = row.Split(';')[0],
                            documento = row.Split(';')[1],
                            email     = row.Split(';')[2],
                        };

                        using (var db = new inventarioEntities1())
                        {
                            db.cliente.Add(newCliente);

                            db.SaveChanges();
                        }
                    }
                }
            }
            return(View());
        }
Exemplo n.º 18
0
        public ActionResult Clientes()
        {
            cliente us = (cliente)Session["cliente"];

            if (us != null)
            {
                if (us.rol.Equals("cliente"))
                {
                    return(RedirectToAction("MiCuenta"));
                }
                else
                {
                    return(View());
                }
            }
            return(RedirectToAction("Index"));
        }
Exemplo n.º 19
0
        public void ActualizarClientes(cliente cliente)
        {
            string query = "UPDATE CLIENTE SET NOMB_CLIENTE =@NombCliente," +
                           "DIRECCION =@Direccion, PAIS = @Pais," +
                           "SALDO_INI = @SaldoIni," +
                           "SALDO_FINAL = @SaldoFinal WHERE ID_CLIENTE = @IdCliente";

            using (ComandoSQL = new SqlCommand())
            {
                //verificamos si hay una transaccion
                if (AccesoDatos.Transaction != null)
                {
                    ComandoSQL.Transaction = AccesoDatos.Transaction;
                }

                ComandoSQL.Connection  = AccesoDatos.ObtenerConexion();
                ComandoSQL.CommandType = CommandType.Text;
                ComandoSQL.CommandText = query;
                try
                {
                    ComandoSQL.Parameters.AddWithValue("@IdCliente", cliente.ID_CLIENTE);
                    ComandoSQL.Parameters.AddWithValue("@NombCliente", cliente.NOMB_CLIENTE);
                    ComandoSQL.Parameters.AddWithValue("@Direccion", cliente.DIRECCION);
                    ComandoSQL.Parameters.AddWithValue("@Pais", cliente.PAIS);
                    ComandoSQL.Parameters.AddWithValue("@SaldoIni", cliente.SALDO_INI);
                    ComandoSQL.Parameters.AddWithValue("@SaldoFinal", cliente.SALDO_FINAL);

                    //Ejecutar Comando
                    ComandoSQL.ExecuteNonQuery();
                }
                catch (Exception)
                {
                    //verificamos si hay una transaccion
                    if (AccesoDatos.Transaction != null)
                    {
                        AccesoDatos.DevolverTransaccion();
                    }

                    throw;
                }
                finally
                {
                    AccesoDatos.CerrarConexion();
                }
            }
        }
Exemplo n.º 20
0
        private void FormAgregarRutas_Load(object sender, EventArgs e)
        {
            //cargarTiposDeUnidades();
            cargarTodosLosClientes();

            if (accion == "editar")
            {
                entidadAeditar = managerRutas.BuscarPorId(idAEditar);
                cliente clienteSeleccionado = managerCliente.BuscarPorId(entidadAeditar.IdCliente);
                textNombre.Text           = entidadAeditar.Nombre;
                textCosto.Text            = entidadAeditar.Costo.ToString();
                comboClientes.Text        = clienteSeleccionado.IdCliente + "/" + clienteSeleccionado.RazonSocial;
                comboUnidadAFacturar.Text = entidadAeditar.UnidadAFacturar;
                this.Text           = "Actualizar los datos de la Ruta.";
                btnAgregarRuta.Text = "Editar Ruta";
            }
        }
Exemplo n.º 21
0
        // GET: Cliente/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            string idDecrypted = MiUtil.desEncriptar(id);
            int    intId       = Convert.ToInt32(idDecrypted);

            cliente cliente = db.cliente.Find(intId);

            if (cliente == null)
            {
                return(HttpNotFound());
            }
            return(View(cliente));
        }
Exemplo n.º 22
0
        //EXCLUI O CLIENTE FAZENDO APENAS A ALTERAÇÃO DO STATUS
        public static int Excluir(int id)
        {
            cliente cliente = new cliente();

            using (var db = new bancoviagemEntities())
            {
                var y = db.cliente.Find(id);
                y.Status = 1;
                cliente  = y;
            }
            using (var db = new bancoviagemEntities())
            {
                db.Entry(cliente).State = EntityState.Modified;
                db.SaveChanges();
            }
            return(id);
        }
Exemplo n.º 23
0
        public ActionResult Edit(int id, cliente cliente)
        {
            try
            {
                using (KonohaMovieEntities km = new KonohaMovieEntities())
                {
                    km.Entry(cliente).State = EntityState.Modified;
                    km.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 24
0
        public printTicket(venta xventa, tienda xtienda)
        {
            this.xtienda   = xtienda;
            this.xventa    = xventa;
            this.db        = new dbop();
            this.reporte   = new rptticket();
            this.translate = new convierte();
            this.codbar    = new cb();

            this.xcliente = this.db.getclientAsobject(this.xventa.idcliente);

            this.pathcbar = Path.Combine(genericDefinitions.TICKETLOGOSPATH + @"\logocbar.png");
            this.pathlogo = Path.Combine(genericDefinitions.TICKETLOGOSPATH + @"\logotienda.png");

            this.widthcbar  = (int)(widthcbar * 50 / 2.54);
            this.heightcbar = (int)(heightcbar * 50 / 2.54);
        }
Exemplo n.º 25
0
 public List<cliente> Filtrar(cliente cliente)
 {
     return repositoryCliente.ObterPorFiltros(b => (
         (cliente.ID == Guid.Empty || b.ID == cliente.ID) &&
         (cliente.razaoSocial == null || b.razaoSocial.ToUpper().Contains(cliente.razaoSocial)) &&
         (cliente.nomeFantasia == null || b.nomeFantasia.ToUpper().Contains(cliente.nomeFantasia)) &&
         (cliente.codigo == null || b.codigo == cliente.codigo) &&
         (cliente.CNPJ == null || b.CNPJ.ToUpper().Contains(cliente.CNPJ)) &&
         (cliente.CPF == null || b.CPF.ToUpper().Contains(cliente.CPF)) &&
         (cliente.RG == null || b.RG.ToUpper().Contains(cliente.RG)) &&
         (cliente.IE == null || b.IE.ToUpper().Contains(cliente.IE)) &&
         (cliente.IM == null || b.IM.ToUpper().Contains(cliente.IM)) &&
         (cliente.suframa == null || b.suframa.ToUpper().Contains(cliente.suframa)) &&
         (cliente.CNAEID == Guid.Empty || b.CNAEID == cliente.CNAEID) &&
         (cliente.empresaID == Guid.Empty || b.empresaID == cliente.empresaID)
         )).ToList();
 }
Exemplo n.º 26
0
        private static List <cliente> Le(SqlConnection conexaoSql, string sql)
        {
            SqlCommand cmd = conexaoSql.CreateCommand();

            cmd.CommandText = sql;

            AcessoBanco.comandosSqlExecutados += sql + "\r\n";

            List <cliente> clientes = new List <cliente>();

            using (DbDataReader reader = cmd.ExecuteReader())
            {
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        cliente cliente = new cliente();

                        cliente.cd_cliente = DBUtils.buscaValor <int>(cliente.CD_CLIENTE, reader);
                        cliente.localidade = new localidade()
                        {
                            nr_localidade = DBUtils.buscaValor <int>(localidade.NR_LOCALIDADE, reader)
                        };
                        cliente.responsavel = new cliente()
                        {
                            cd_cliente = DBUtils.buscaValor <int>("cd_responsavel", reader)
                        };
                        cliente.nm_cliente = DBUtils.buscaValor <string>(cliente.NM_CLIENTE, reader);

                        cliente.ds_logradouro  = DBUtils.buscaValor <string>(cliente.DS_LOGRADOURO, reader);
                        cliente.ds_complemento = DBUtils.buscaValor <string>(cliente.DS_COMPLEMENTO, reader);
                        cliente.ds_bairro      = DBUtils.buscaValor <string>(cliente.DS_BAIRRO, reader);

                        cliente.nr_telefone_res = DBUtils.buscaValor <string>(cliente.NR_TELEFONE_RES, reader);
                        cliente.nr_telefone_com = DBUtils.buscaValor <string>(cliente.NR_TELEFONE_COM, reader);
                        cliente.nr_telefone_cel = DBUtils.buscaValor <string>(cliente.NR_TELEFONE_CEL, reader);

                        cliente.ds_email = DBUtils.buscaValor <string>(cliente.DS_EMAIL, reader);

                        clientes.Add(cliente);
                    }
                }
            }

            return(clientes);
        }
Exemplo n.º 27
0
        private void actualizar(DateTime fecha)
        {
            dgReservacion.Rows.Clear();

            List <reservacion> listaReservacion = controladorReservacion.listarPorFecha(fecha);

            foreach (reservacion r in listaReservacion)
            {
                cliente oCliente = controladorCliente.buscarId(r.id_cliente);
                string  cliente  = oCliente.nombre + " " + oCliente.ap_paterno + " " + oCliente.ap_materno;

                rampa oRampa = controladorRampa.buscarId(r.id_rampa);


                dgReservacion.Rows.Add(r.id, cliente, oRampa.nombre, r.horario, r.fecha, r.observacion);
            }
        }
Exemplo n.º 28
0
        //guardar

        private void saveClients()
        {
            cliente _infoClient = new cliente();

            _infoClient.nombres_cliente   = txtNombre.Text.ToUpper();
            _infoClient.direccion_cliente = txtDireccion.Text.ToUpper();
            _infoClient.dni_cliente       = txtDni.Text;
            _infoClient.ttelefono_cliente = txtTelefono.Text;
            _infoClient.email_cliente     = txtEmail.Text.ToLower();
            bool res = LogicaCliente.saveClients(_infoClient);

            if (res)
            {
                Response.Write("<script>alert('Cliente guardado correctamente.!!');</script>");
                newClients();
            }
        }
Exemplo n.º 29
0
        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            //agregar

            if (ValidarMonto(txtSaldoInicial.Text) == false)
            {
                MessageBox.Show("El campo sueldo inicial es solo numerico");
                txtSaldoInicial.Focus();
                return;
            }

            if (ValidarMonto(txtSaldoFinal.Text) == false)
            {
                MessageBox.Show("El campo sueldo actual es solo numerico");
                txtSaldoFinal.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtNombre.Text))
            {
                MessageBox.Show("el nombre no puede estar vacio.!");
                txtNombre.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtDireccion.Text))
            {
                MessageBox.Show("la direccion es un campo obligatorio");
                txtDireccion.Focus();
                return;
            }

            var cliente = new cliente
            {
                NOMB_CLIENTE = txtNombre.Text,
                PAIS         = txtPais.Text,
                DIRECCION    = txtDireccion.Text,
                SALDO_INI    = float.Parse(txtSaldoInicial.Text),
                SALDO_FINAL  = float.Parse(txtSaldoFinal.Text)
            };

            clienteBL.RegClientes(cliente);
            MessageBox.Show("Cliente insertado con exito", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            toolStripLabel1_Click(null, null); // limpiamos lo campos de pues de grabar.
        }
Exemplo n.º 30
0
        protected void lnkActualizarMiCuenta_Click(object sender, EventArgs e)
        {
            usuarios user     = new usuarios();
            cliente  clientes = new cliente();

            conexion_entidad cn = new conexion_entidad();

            string database = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["tdvbd"]);
            string server   = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["tdvsrv"]);

            cn.database = database;
            cn.server   = server;
            //cn.usuario = Session["sesion_usuario"].ToString();

            if (hdPasswordUsuario.Value != hdPasswordUsuario2.Value)
            {
                return;
            }

            if (Convert.ToInt32(dpEstadoUsuario.SelectedValue) == 0)
            {
                clientes.estado = "0";
            }
            else
            {
                clientes.estado = dpEstadoUsuario.SelectedValue;
            }

            clientes.idusuario = hdIdUsuario.Value;
            clientes.nombre    = hdNombreUsuario.Value;
            clientes.apellido  = hdApellidoUsuario.Value;
            clientes.email     = hdCorreoUsuario.Value;

            user.usuario  = hdIdUsuario.Value;
            user.correo   = hdCorreoUsuario.Value;
            user.password = hdPasswordUsuario.Value;

            bool update = logica_usuarios.actualizar_usuario(cn, user, clientes);

            if (update)
            {
                string javaScript = "refreshUsuarios();";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "script", javaScript, true);
            }
        }
Exemplo n.º 31
0
 public void ImprimirObjeto(object unCliente)
 {
     try
     {
         cliente objeto = (cliente)unCliente;
         Proveedores.Colecciones.ClienteCl coleccion = new Proveedores.Colecciones.ClienteCl();
         coleccion.Add(objeto);
         Reportes reporte = new Reportes()
         {
             Reporte = "ClientesRp", FuenteDatos = "ClienteCl", Lista = coleccion.ObtenerItems()
         };
         reporte.ShowDialog();
     }
     catch (Exception ex)
     {
         General.Mensaje(ex.Message);
     }
 }
Exemplo n.º 32
0
        public HttpResponseMessage ClienteInsert(HttpRequestMessage request, [FromBody] cliente cli)
        {
            ConfigAppMembers cf  = Util.ConfigApp.getConfig();
            double           ret = 0;

            try
            {
                Util.LogUtil.GravaLog(this, "Cliente post: " + JsonConvert.SerializeObject(cli), cf.Cnpj, Log.TipoLog.info);

                ret = Database.ClienteADO.GravaClienteRest(cli, cf.datasource, cf.schema);
            }
            catch (Exception e)
            {
                Util.LogUtil.GravaLog(this, "Cliente post: " + e.ToString(), cf.Cnpj, Log.TipoLog.erro);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError, "ERRO"));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, ret));
        }
Exemplo n.º 33
0
        private void Btn_verificar_rut_Click(object sender, RoutedEventArgs e)
        {
            cliente cliente = new cliente();

            cliente.Rut = txt_rut_asociado.Text;
            string rut = cliente.Rut;

            try
            {
                BuscarClienteRut(rut);
                txt_nombre_asociado.Text = BuscarClienteRut(rut).NombreContacto;
                MessageBox.Show("CLIENTE EXISTE");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 34
0
 private cliente ModificarCliente(cliente oCliente)
 {
     try
     {
         using (BDSoftComputacionEntities bd = new BDSoftComputacionEntities())
         {
             oCliente.nombre          = oCliente.nombre.ToUpper();
             oCliente.apellido        = oCliente.apellido.ToUpper();
             bd.Entry(oCliente).State = System.Data.Entity.EntityState.Modified;
             bd.SaveChanges();
             return(oCliente);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 35
0
        public ActionResult Delete(int id, cliente cliente)
        {
            try
            {
                using (KonohaMovieEntities km = new KonohaMovieEntities())
                {
                    var removable = km.cliente.Where(x => x.id == id).FirstOrDefault();
                    km.cliente.Remove(removable);
                    km.SaveChanges();
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 36
0
        public string newCod()
        {
            cliente cliente_    = (from c in las_DeliciasContext.cliente orderby c.cod_cli descending select c).First();
            string  cod         = cliente_.cod_cli;
            string  nuevoCodigo = String.Empty;
            Int64   number      = Convert.ToInt64(cod.Substring(1, 4));

            number += 1;
            if (number > 9999)
            {
                nuevoCodigo = "C" + number.ToString();
            }
            else if (number <= 9999)
            {
                nuevoCodigo = "C" + number.ToString("0000");
            }
            return(nuevoCodigo);
        }
Exemplo n.º 37
0
 protected void btnRegistrar_Click(object sender, EventArgs e)
 {
     try
     {
         cliente cli = new cliente();
         cli.idCliente = int.Parse(txtCodigo.Text);
         cli.nombre    = txtNombre.Text;
         cli.apePater  = txtPaterno.Text;
         cli.apeMater  = txtMaterno.Text;
         cli.dni       = int.Parse(txtDni.Text);
         cli.correo    = txtCorreo.Text;
         proxy.CrearCliente(cli);
         Response.Redirect("CrudClientes.aspx");
     }
     catch (Exception)
     {
     }
 }
Exemplo n.º 38
0
        public bool EditarCliente(cliente nueva)
        {
            try
            {
                cliente anterior = new cliente();
                anterior = contexto.cliente.Find(nueva.Rut);
                anterior.Nombre = nueva.Nombre;
                anterior.Direccion = nueva.Direccion;
                anterior.Correo = nueva.Correo;
                anterior.Telefono = nueva.Telefono;
                anterior.Contraseña = nueva.Contraseña;

                return contexto.SaveChanges() > 0;
            }
            catch (Exception)
            {

                return false;
            }
        }
Exemplo n.º 39
0
    /// <summary>
    /// hecho por cesar pulido
    /// el dia 16 de enero de 2013
    /// para escribir en el pdf del manual la seccion de identificacion del cliente
    /// </summary>
    /// <param name="ID_EMPRESA"></param>
    /// <param name="htmlSeccion"></param>
    /// <param name="_datos"></param>
    /// <returns></returns>
    private String CargarIdentificacionCliente(Decimal ID_EMPRESA, String htmlSeccion, Conexion _datos)
    {
        //verificado por _datos

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        //ok ----------------------
        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA, _datos);
        DataRow filaCliente = tablaCliente.Rows[0];

        htmlSeccion = htmlSeccion.Replace("[RAZ_SOCIAL]", filaCliente["RAZ_SOCIAL"].ToString().Trim());
        htmlSeccion = htmlSeccion.Replace("[ACT_ECO]", filaCliente["ACT_ECO"].ToString().Trim());
        htmlSeccion = htmlSeccion.Replace("[NIT]", filaCliente["NIT_EMPRESA"].ToString().Trim() + "-" + filaCliente["DIG_VER"].ToString().Trim());
        htmlSeccion = htmlSeccion.Replace("[REP_LEGAL]", filaCliente["NOM_REP_LEGAL"].ToString().Trim());
        htmlSeccion = htmlSeccion.Replace("[NUM_DOC_REP_LEGAL]", filaCliente["TIP_DOC_REP_LEGAL"].ToString().Trim() + " " + filaCliente["CC_REP_LEGAL"].ToString().Trim());
        htmlSeccion = htmlSeccion.Replace("[DIR_CIU_EMPRESA]", filaCliente["DIR_EMP"].ToString().Trim() + " (" + filaCliente["ID_CIUDAD_EMPRESA"].ToString().Trim() + ").");
        htmlSeccion = htmlSeccion.Replace("[TEL_EMPRESA]", filaCliente["TEL_EMP"].ToString().Trim() + " / " + filaCliente["TEL_EMP1"].ToString().Trim() + " CEL: " + filaCliente["NUM_CELULAR"].ToString());

        return htmlSeccion;
    }
    private void Cargar(Acciones accion)
    {
        DataTable dataTable = new DataTable();
        switch(accion)
        {
            case Acciones.Inicio:
                cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                dataTable = _cliente.ObtenerTodasLasEmpresasActivas();
                Cargar(dataTable, this.DropDownList_empresas, "ID_EMPRESA", "RAZ_SOCIAL");

                dataTable = _cliente.ObtenerEmpresaConIdEmpresa(Convert.ToDecimal(this.HiddenField_ID_EMPRESA.Value));
                Cargar(dataTable);

                usuario _usuario = new usuario(Session["idEmpresa"].ToString());
                dataTable = _usuario.ObtenerEmpleadosRestriccionEmpresas();
                Cargar(dataTable, this.DropDownList_usuario, "Id_Usuario", "NOMBRE_EMPLEADO");

                parametro _parametro = new parametro(Session["idEmpresa"].ToString());
                dataTable = _parametro.ObtenerParametrosPorTabla(tabla.PARAMETROS_UNIDAD_NEGOCIO);
                Cargar(dataTable, this.DropDownList_unidad_negocio, "codigo", "descripcion");

                Cargar(GridView_unidades_negocio);
                break;

        }
        if (dataTable == null) dataTable.Dispose();
    }
Exemplo n.º 41
0
    public byte[] GenerarPDFEntrevistaRetiro(Decimal ID_EMPLEADO, Decimal ID_SOLICITUD, Decimal ID_EMPRESA)
    {
        String USULOG_ENTREVISTA = Session["USU_LOG"].ToString();

        tools _tools = new tools();

        // OBTENEMOS INFORMACION DE USUARIO
        usuario _usuario = new usuario(Session["idEmpresa"].ToString());
        DataTable tablaUsuario = _usuario.ObtenerUsuarioPorUsuLog(USULOG_ENTREVISTA); //ACA VA ES EL DE LA ENTREVISTA
        DataRow filaUsuario = tablaUsuario.Rows[0];

        String NOMBRE_DILIGENCIA = "";
        if (filaUsuario["USU_TIPO"].ToString().ToUpper() == "PLANTA")
        {
            NOMBRE_DILIGENCIA = filaUsuario["NOMBRES"].ToString().Trim() + " " + filaUsuario["APELLIDOS"].ToString().Trim();
        }
        else
        {
            NOMBRE_DILIGENCIA = filaUsuario["NOMBRES_EXTERNO"].ToString().Trim() + " " + filaUsuario["APELLIDOS_EXTERNO"].ToString().Trim();
        }

        //OBTENEMOS LA INFORMACION DEL CLIENTE
        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaCliente = tablaCliente.Rows[0];

        String RAZ_SOCIAL = filaCliente["RAZ_SOCIAL"].ToString().Trim();
        String NIT_EMPRESA = filaCliente["NIT_EMPRESA"].ToString().Trim() + "-" + filaCliente["DIG_VER"].ToString().Trim();
        String DIR_EMPRESA = filaCliente["DIR_EMP"].ToString().Trim() + " " + filaCliente["ID_CIUDAD_EMPRESA"].ToString().Trim();

        //OBTENEMOS LA INFORMACION DE LA SOLICITUD DE INGRESO
        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaSolicitud = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));
        DataRow filaSolicitud = tablaSolicitud.Rows[0];

        String NOMBRE_ASPIRANTE = filaSolicitud["NOMBRES"].ToString().Trim() + " " + filaSolicitud["APELLIDOS"].ToString().Trim();
        String DOC_IDENTIDAD_ASPIRANTE = filaSolicitud["TIP_DOC_IDENTIDAD"].ToString().Trim() + " " + filaSolicitud["NUM_DOC_IDENTIDAD"].ToString().Trim();
        int EDAD_ASPIRANTE = 0;
        if (DBNull.Value.Equals(filaSolicitud["FCH_NACIMIENTO"]) == false)
        {
            try
            {
                EDAD_ASPIRANTE = _tools.ObtenerEdadDesdeFechaNacimiento(Convert.ToDateTime(filaSolicitud["FCH_NACIMIENTO"]));
            }
            catch
            {
                EDAD_ASPIRANTE = 0;
            }
        }
        String DIRECCION_ASPIRANTE = filaSolicitud["DIR_ASPIRANTE"].ToString().Trim();
        String CIUDAD_ASPIRANTE = filaSolicitud["NOMBRE_CIUDAD"].ToString().Trim();
        String SECTOR_ASPIRANTE = filaSolicitud["SECTOR"].ToString();
        String TELEFONOS_ASPIRANTE = filaSolicitud["TEL_ASPIRANTE"].ToString();
        String EMAIL_ASPIRANTE = filaSolicitud["E_MAIL"].ToString().Trim();

        //DATOS DEL MOTIVO DE RETIRO
        MotivoRotacionRetiro _motivo = new MotivoRotacionRetiro(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaResultadosEntrevista = _motivo.ObtenerResultadosEntrevistaDeRetiroParaEmpleado(ID_EMPLEADO);

        //CREAMOS LA TABLA DE MOTIVOS DE RETIRO
        Boolean yaSeTieneObservaciones = false;
        String OBSERVACIONES = null;

        String html_tabla_motivos = "<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" width=\"95%\" align=\"center\" style=\"font-size:8px; line-height:9px;\">";
        html_tabla_motivos += "<tr>";
        html_tabla_motivos += "<td width=\"50%\" style=\"text-align:center;\">";
        html_tabla_motivos += "CATEGORÍA";
        html_tabla_motivos += "</td>";
        html_tabla_motivos += "<td width=\"50%\" style=\"text-align:center;\">";
        html_tabla_motivos += "MOTIVO";
        html_tabla_motivos += "</td>";
        html_tabla_motivos += "</tr>";
        foreach (DataRow filaMotivo in tablaResultadosEntrevista.Rows)
        {
            if (yaSeTieneObservaciones == false)
            {
                //SOLO UNA VEZ
                OBSERVACIONES = filaMotivo["OBSERVACIONES"].ToString().Trim();
                yaSeTieneObservaciones = true;
            }

            Decimal ID_DETALLE_ROTACION_EMPLEADO = Convert.ToDecimal(filaMotivo["ID_DETALLE_ROTACION_EMPLEADO"]);
            Decimal ID_MAESTRA_ROTACION_EMPLEADO = Convert.ToDecimal(filaMotivo["ID_MAESTRA_ROTACION_EMPLEADO"]);
            Decimal ID_ROTACION_EMPRESA = Convert.ToDecimal(filaMotivo["ID_ROTACION_EMPRESA"]);

            //OBTENEMOS DATOS COMPLEMENTARIOS POR MEDIO DE ID_ROTACION_EMPRESA
            DataTable tablaInfoComplementaria = _motivo.ObtenerMotivoEmpresaPorId(ID_ROTACION_EMPRESA);
            DataRow filaInfoComplementaria = tablaInfoComplementaria.Rows[0];

            html_tabla_motivos += "<tr>";
            html_tabla_motivos += "<td width=\"50%\" style=\"text-align:justify;\">";
            html_tabla_motivos += filaInfoComplementaria["TITULO_MAESTRA_ROTACION"];
            html_tabla_motivos += "</td>";
            html_tabla_motivos += "<td width=\"50%\" style=\"text-align:justify;\">";
            html_tabla_motivos += filaInfoComplementaria["TITULO"];
            html_tabla_motivos += "</td>";
            html_tabla_motivos += "</tr>";
        }
        html_tabla_motivos += "</table>";

        /*
         * Generación del archi de informe de entrevista de retiro
         * Stream con el contenido del pdf.
        */
        String html_encabezado = "<html>";
        html_encabezado += "<head>";
        html_encabezado += "</head>";
        html_encabezado += "<body>";

        String html_pie = "</body>";
        html_pie += "</html>";

        //En esta variable cargamos el documento plantilla
        StreamReader archivo_original = new StreamReader(Server.MapPath(@"~\plantillas_reportes\entrevista_retiro.htm"));

        String html_formato_entrevista = html_encabezado + archivo_original.ReadToEnd();

        archivo_original.Dispose();
        archivo_original.Close();

        html_formato_entrevista = html_formato_entrevista.Replace("[RAZ_SOCIAL]", RAZ_SOCIAL);
        html_formato_entrevista = html_formato_entrevista.Replace("[NIT_EMPRESA]", NIT_EMPRESA);
        html_formato_entrevista = html_formato_entrevista.Replace("[DIR_EMPRESA]", DIR_EMPRESA);

        html_formato_entrevista = html_formato_entrevista.Replace("[NOMBRE_ASPIRANTE]", NOMBRE_ASPIRANTE);
        html_formato_entrevista = html_formato_entrevista.Replace("[DOC_IDENTIDAD_ASPIRANTE]", DOC_IDENTIDAD_ASPIRANTE);
        if (EDAD_ASPIRANTE > 0)
        {
            html_formato_entrevista = html_formato_entrevista.Replace("[EDAD_ASPIRANTE]", EDAD_ASPIRANTE.ToString() + " Años.");
        }
        else
        {
            html_formato_entrevista = html_formato_entrevista.Replace("[EDAD_ASPIRANTE]", "Desconocida.");
        }
        html_formato_entrevista = html_formato_entrevista.Replace("[DIRECCION_ASPIRANTE]", DIRECCION_ASPIRANTE);
        html_formato_entrevista = html_formato_entrevista.Replace("[CIUDAD_ASPIRANTE]", CIUDAD_ASPIRANTE);
        html_formato_entrevista = html_formato_entrevista.Replace("[SECTOR_ASPIRANTE]", SECTOR_ASPIRANTE);
        html_formato_entrevista = html_formato_entrevista.Replace("[TELEFONOS_ASPIRANTE]", TELEFONOS_ASPIRANTE);
        html_formato_entrevista = html_formato_entrevista.Replace("[EMAIL_ASPIRANTE]", EMAIL_ASPIRANTE);

        html_formato_entrevista = html_formato_entrevista.Replace("[TABLA_MOTIVOS_RETIRO]", html_tabla_motivos);

        html_formato_entrevista = html_formato_entrevista.Replace("[OBSERVACIONES]", OBSERVACIONES);

        html_formato_entrevista = html_formato_entrevista.Replace("[NOMBRE_DILIGENCIA]", NOMBRE_DILIGENCIA);

        html_formato_entrevista += html_pie;

        //creamos un configuramos el documento de pdf
        //(tamaño de la hoja,margen izq, margen der, margin arriba margen abajo)
        iTextSharp.text.Document document = new iTextSharp.text.Document(new Rectangle(595, 842), 50, 50, 80, 45);

        using (MemoryStream streamArchivo = new MemoryStream())
        {
            iTextSharp.text.pdf.PdfWriter writer = PdfWriter.GetInstance(document, streamArchivo);

            // Our custom Header and Footer is done using Event Handler
            pdfEvents PageEventHandler = new pdfEvents();
            writer.PageEvent = PageEventHandler;

            // Define the page header
            // Define the page header
            if (Session["idEmpresa"].ToString() == "1")
            {
                PageEventHandler.dirImagenHeader = Server.MapPath("~/imagenes/reportes/logo_sertempo.png");
            }
            else
            {
                PageEventHandler.dirImagenHeader = Server.MapPath("~/imagenes/reportes/logo_eficiencia.png");
            }

            PageEventHandler.fechaImpresion = DateTime.Now;
            PageEventHandler.tipoDocumento = "entrevista_retiro";

            document.Open();

            //capturamos el archivo temporal del response
            String tempFile = Path.GetTempFileName();

            //y lo llenamos con el html de la plantilla
            using (StreamWriter tempwriter = new StreamWriter(tempFile, false))
            {
                tempwriter.Write(html_formato_entrevista);
            }

            //leeemos el archivo temporal y lo colocamos en el documento de pdf
            List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StreamReader(tempFile), new StyleSheet());

            foreach (IElement element in htmlarraylist)
            {
                if (element.Chunks.Count > 0)
                {
                    if (element.Chunks[0].Content == "linea para paginacion de pdf")
                    {
                        document.NewPage();
                    }
                    else
                    {
                        document.Add(element);
                    }
                }
                else
                {
                    document.Add(element);
                }
            }

            //limpiamos todo
            document.Close();

            writer.Close();

            return streamArchivo.ToArray();
        }
    }
    protected void ImageButton7_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            cliente nuevo = new cliente

            {

                id_cliente = Convert.ToInt32(TextBox1.Text),
               nombre_cliente = TextBox2.Text,
                apellido_cliente = TextBox3.Text,
               telefono_cliente = TextBox5.Text,
               direccion_cliente= TextBox7.Text,

            };
            //guardar cambios
            conectar.AddTocliente(nuevo);
            conectar.SaveChanges();
            //actualizar gridview
            GridView1.DataBind();
           // limpiar();
            Label1.Text = "Registro agregado correctamente";
        }

        catch (Exception ex)
        {
            Label10.Text = "Debe ingresar numeros..." + ex.Message;
        }
    }
Exemplo n.º 43
0
        public Result SalvarCliente(cliente cliente)
        {
            //if (!modelState.IsValid)
            //{
            //    return;
            //}

            Result retorno = serviceCliente.Salvar(cliente);
            //if (!retorno.Sucesso)
            //{
            //    modelState.AddModelError("", retorno.MensagemGeral);

            //    foreach (ResultadoCampo campo in retorno.Campos)
            //    {
            //        modelState.AddModelError(campo.Campo, campo.Mensagem);
            //    }
            //}

            return retorno;
        }
    private void Cargar(Decimal ID_SOLICITUD, Decimal ID_EMPLEADO, Decimal ID_EMPRESA, Decimal REGISTRO_CONTRATO)
    {
        HiddenField_ID_SOLICITUD.Value = ID_SOLICITUD.ToString();
        HiddenField_ID_EMPLEADO.Value = ID_EMPLEADO.ToString();
        HiddenField_ID_EMPRESA.Value = ID_EMPRESA.ToString();
        HiddenField_REGISTRO_CONTRATO.Value = REGISTRO_CONTRATO.ToString();

        radicacionHojasDeVida _radicacionHojasDeVida = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaInfoTrabajador = _radicacionHojasDeVida.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);

        if (tablaInfoTrabajador.Rows.Count <= 0)
        {
            if (_radicacionHojasDeVida.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _radicacionHojasDeVida.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información del Trabajador Seleciconado.", Proceso.Advertencia);
            }
        }
        else
        {
            if (tablaCliente.Rows.Count <= 0)
            {
                if (_cliente.MensajeError != null)
                {
                    Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _cliente.MensajeError, Proceso.Error);
                }
                else
                {
                    Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontró información de la Empresa asociada al trabajador.", Proceso.Advertencia);
                }
            }
            else
            {
                DataRow filainfoCliente = tablaCliente.Rows[0];

                cargarInfoTrabajador(tablaInfoTrabajador.Rows[0], filainfoCliente);

                MotivoRotacionRetiro _motivo = new MotivoRotacionRetiro(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                DataTable tablaMotivosAsociadosAEmpresa = _motivo.ObtenerMotivosActivosEmpresa(ID_EMPRESA);

                if (tablaMotivosAsociadosAEmpresa.Rows.Count <= 0)
                {
                    if (_motivo.MensajeError != null)
                    {
                        Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _motivo.MensajeError, Proceso.Error);
                    }
                    else
                    {
                        Ocultar(Acciones.Inicio);
                        Desactivar(Acciones.Inicio);
                        Mostrar(Acciones.Inicio);
                        Cargar(Acciones.Inicio);

                        Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La empresa no tiene Motivos de Rotación y Retiros asociados.", Proceso.Advertencia);
                    }
                }
                else
                {
                    _motivo.MensajeError = null;

                    Boolean correcto = true;

                    DataTable tablaResultadosEntrevistaRetiro = _motivo.ObtenerResultadosEntrevistaDeRetiroParaEmpleado(ID_EMPLEADO);

                    if (tablaResultadosEntrevistaRetiro.Rows.Count <= 0)
                    {
                        if (_motivo.MensajeError != null)
                        {
                            if (_motivo.MensajeError != null)
                            {
                                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _motivo.MensajeError, Proceso.Error);
                                correcto = false;
                            }
                        }
                    }

                    if (correcto == true)
                    {
                        DataTable tablaparaGrilla = configurarTablaParaGrillaMotivos();

                        Boolean idEncontrado = false;

                        Int32 contadorResultados = 0;

                        for (int i = 0; i < tablaMotivosAsociadosAEmpresa.Rows.Count; i++)
                        {
                            idEncontrado = false;

                            DataRow filaMotivo = tablaMotivosAsociadosAEmpresa.Rows[i];
                            DataRow filaParaGrilla = tablaparaGrilla.NewRow();

                            filaParaGrilla["ID_MAESTRA_ROTACION"] = filaMotivo["ID_MAESTRA_ROTACION"];
                            filaParaGrilla["ID_DETALLE_ROTACION"] = filaMotivo["ID_DETALLE_ROTACION"];
                            filaParaGrilla["ID_ROTACION_EMPRESA"] = filaMotivo["ID_ROTACION_EMPRESA"];

                            filaParaGrilla["TITULO"] = filaMotivo["TITULO"];
                            filaParaGrilla["TITULO_MAESTRA_ROTACION"] = filaMotivo["TITULO_MAESTRA_ROTACION"];

                            Decimal ID_ROTACION_EMPRESA_1 = Convert.ToDecimal(filaMotivo["ID_ROTACION_EMPRESA"]);

                            Decimal ID_DETALLE_ROTACION_EMPLEADO = 0;

                            for(int j = 0; j < tablaResultadosEntrevistaRetiro.Rows.Count; j++)
                            {
                                DataRow filaResultado = tablaResultadosEntrevistaRetiro.Rows[j];

                                Decimal ID_ROTACION_EMPRESA_2 = Convert.ToDecimal(filaResultado["ID_ROTACION_EMPRESA"]);

                                if(ID_ROTACION_EMPRESA_1 == ID_ROTACION_EMPRESA_2)
                                {
                                    contadorResultados += 1;

                                    ID_DETALLE_ROTACION_EMPLEADO = Convert.ToDecimal(filaResultado["ID_DETALLE_ROTACION_EMPLEADO"]);
                                    idEncontrado = true;

                                    if (contadorResultados == 1)
                                    {
                                        HiddenField_ID_MAESTRA_ENTREVISTA_EMPLEADO.Value = filaResultado["ID_MAESTRA_ROTACION_EMPLEADO"].ToString().Trim();

                                        TextBox_Observaciones.Text = filaResultado["OBSERVACIONES"].ToString().Trim();
                                    }
                                    break;
                                }
                            }

                            if(idEncontrado == true)
                            {
                                filaParaGrilla["ID_DETALLE_ROTACION_EMPLEADO"] = ID_DETALLE_ROTACION_EMPLEADO;
                            }
                            else
                            {
                                filaParaGrilla["ID_DETALLE_ROTACION_EMPLEADO"] = 0;
                            }

                            tablaparaGrilla.Rows.Add(filaParaGrilla);
                        }

                        CargarGrillaMotivosRotacionDesdeTabla(tablaparaGrilla);

                        Ocultar(Acciones.Inicio);

                        if (contadorResultados <= 0)
                        {
                            Mostrar(Acciones.Nuevo);
                            Activar(Acciones.Nuevo);
                            Limpiar(Acciones.Nuevo);

                            habilitarFilasGrilla(GridView_MotivosRotacion, 0);
                        }
                        else
                        {
                            Mostrar(Acciones.Cargar);
                            Desactivar(Acciones.Cargar);

                            inhabilitarFilasGrilla(GridView_MotivosRotacion, 0);
                        }
                    }
                }
            }
        }
    }
    private void CargarIdentificacionCliente(Decimal ID_EMPRESA)
    {
        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaCliente = tablaCliente.Rows[0];

        Label_RAZ_SOCIAL.Text = filaCliente["RAZ_SOCIAL"].ToString().Trim();
        Label_ActividadEconomica.Text = filaCliente["ACT_ECO"].ToString().Trim();
        Label_NIT.Text = filaCliente["NIT_EMPRESA"].ToString().Trim() + "-" + filaCliente["DIG_VER"].ToString().Trim();
        Label_REPRESENTANTE_LEGAL.Text = filaCliente["NOM_REP_LEGAL"].ToString().Trim();
        Label_CEDULA_REPRESENTANTE.Text = filaCliente["TIP_DOC_REP_LEGAL"].ToString().Trim() + " " + filaCliente["CC_REP_LEGAL"].ToString().Trim();
        Label_DIRECCION_CLIENTE.Text = filaCliente["DIR_EMP"].ToString().Trim() + " (" + filaCliente["ID_CIUDAD_EMPRESA"].ToString().Trim() + ").";
        Label_Telefono.Text = filaCliente["TEL_EMP"].ToString().Trim() + " / " + filaCliente["TEL_EMP1"].ToString().Trim() + " CEL: " + filaCliente["NUM_CELULAR"].ToString();
    }
    private void Cargar(Decimal ID_REQUERIMIENTO, Decimal ID_SOLICITUD, Decimal ID_EMPRESA, Decimal ID_OCUPACION)
    {
        HiddenField_ID_REQUERIMIENTO.Value = ID_REQUERIMIENTO.ToString();
        HiddenField_ID_SOLICITUD.Value = ID_SOLICITUD.ToString();
        HiddenField_ID_EMPRESA.Value = ID_EMPRESA.ToString();
        HiddenField_ID_OCUPACION.Value = ID_OCUPACION.ToString();

        Ocultar(Acciones.Inicio);

        radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        _solIngreso.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(ID_REQUERIMIENTO), Convert.ToInt32(ID_SOLICITUD), "EN EXAMENES", Session["USU_LOG"].ToString());

        condicionesContratacion CondicionesContratacion = new condicionesContratacion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable _tablaReq = CondicionesContratacion.ObtenerComRequerimientoPorIdRequerimiento(ID_REQUERIMIENTO);
        DataRow _filaReq = _tablaReq.Rows[0];
        String CIUDAD_REQ = _filaReq["CIUDAD_REQ"].ToString().Trim();
        HiddenField_CIUDAD_REQ.Value = CIUDAD_REQ;

        perfil _PERFIL = new perfil(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaPerfil = _PERFIL.ObtenerPorRegistro(Convert.ToInt32(_filaReq["REGISTRO_PERFIL"]));
        DataRow filaPerfil = tablaPerfil.Rows[0];
        Decimal ID_PERFIL = Convert.ToDecimal(_filaReq["REGISTRO_PERFIL"]);
        ID_OCUPACION = Convert.ToDecimal(filaPerfil["ID_OCUPACION"]);
        if (!string.IsNullOrEmpty(filaPerfil["CODIGO"].ToString())) Label_RIESGO.Text =  filaPerfil["CODIGO"].ToString();
        HiddenField_ID_PERFIL.Value = ID_PERFIL.ToString();
        HiddenField_ID_OCUPACION.Value = ID_OCUPACION.ToString();

        DataTable tablasol = _solIngreso.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));
        DataRow filaSolIngreso = tablasol.Rows[0];
        String NOMBRE_TRABAJADOR = filaSolIngreso["NOMBRES"].ToString().Trim() + " " + filaSolIngreso["APELLIDOS"].ToString().Trim();
        String NUM_DOC_IDENTIDAD_COMPLETO = filaSolIngreso["TIP_DOC_IDENTIDAD"].ToString().Trim() + " " + filaSolIngreso["NUM_DOC_IDENTIDAD"].ToString().Trim();
        String NUM_DOC_IDENTIDAD = filaSolIngreso["NUM_DOC_IDENTIDAD"].ToString().Trim();
        HiddenField_NUM_DOC_IDENTIDAD.Value = NUM_DOC_IDENTIDAD;

        cliente _empresa = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaEmpresa = _empresa.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaEmpresa = tablaEmpresa.Rows[0];
        String RAZ_SOCIAL = filaEmpresa["RAZ_SOCIAL"].ToString().Trim();
        HiddenField_ID_EMPRESA.Value = filaEmpresa["ID_EMPRESA"].ToString().Trim();

        cargo _cargo = new cargo(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaOcupacion = _cargo.ObtenerOcupacionPorIdOcupacion(ID_OCUPACION);
        DataRow filaOcupacion = tablaOcupacion.Rows[0];
        String CARGO = filaOcupacion["NOM_OCUPACION"].ToString().Trim();

        HiddenField_persona.Value = ID_SOLICITUD.ToString() + "," + ID_REQUERIMIENTO.ToString() + "," + ID_OCUPACION.ToString() + "," + ID_EMPRESA.ToString() + "," + NUM_DOC_IDENTIDAD.Trim();

        cargar_menu_botones_modulos_internos();

        if (!String.IsNullOrEmpty(filaSolIngreso["NUM_CUENTA"].ToString())) CheckBox_TIENE_CUENTA.Checked = true;

        cargarDatosTrabajador(NOMBRE_TRABAJADOR, NUM_DOC_IDENTIDAD_COMPLETO, RAZ_SOCIAL, CARGO, ID_OCUPACION.ToString());

        ordenExamenes _ordenes = new ordenExamenes(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaOrdenes = _ordenes.ObtenerConRegOrdenExamenPorSolicitud(Convert.ToInt32(ID_REQUERIMIENTO), Convert.ToInt32(ID_SOLICITUD));

        if (tablaOrdenes.Rows.Count <= 0)
        {
            if (_ordenes.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _ordenes.MensajeError, Proceso.Error);
            }
            else
            {

                Mostrar(Acciones.SeleccionUbicacion);

                HiddenField_ESTADO_PROCESO.Value = AccionesProceso.Paso1ConfigurarExamenes.ToString();

                CargarSeccionUbicacionTrabajador();

                Panel_INFO_ADICIONAL_MODULO.Visible = true;
                Label_INFO_ADICIONAL_MODULO.Text = "SELECCIONE LA UBICACIÓN DONDE TRABAJARÁ LA PERSONA SELECICONADA";
            }
        }
        else
        {
            HiddenField_ESTADO_PROCESO.Value = AccionesProceso.Paso2RegistrarResultadosExamenes.ToString();

            Boolean TIENE_CUENTA = CargarUbicacionTrabajadorTemporal(ID_REQUERIMIENTO, ID_SOLICITUD);

            Cargar_GridView_EXAMENES_REALIZADOS_desde_tabla(tablaOrdenes);

            Cargar_forma_Pago(filaSolIngreso, TIENE_CUENTA);

            Mostrar(Acciones.ResultadosExamenes);

            if (filaSolIngreso["PAR_FORMA_PAGO_VARIABLE"].ToString().Trim() == "1")
            {
                if (TIENE_CUENTA == false)
                {
                    Button_Imprimir_Carta.Visible = true;
                }
                else
                {
                    Button_Imprimir_Carta.Visible = false;
                }
            }
            else
            {
                Button_Imprimir_Carta.Visible = false;
            }

            Panel_INFO_ADICIONAL_MODULO.Visible = false;
            Label_INFO_ADICIONAL_MODULO.Text = "";

            Button_DescartarPorExamenes.Visible = true;
        }
    }
Exemplo n.º 47
0
        public Result Salvar(cliente cliente)
        {
            Result retorno = new Result();

            try
            {
                if (cliente.ID == Guid.Empty)
                {
                    cliente.ID = Guid.NewGuid();
                    repositoryCliente.Adicionar(cliente);
                }
                else
                {
                    repositoryCliente.Alterar(cliente);
                }

                context.SaveChanges();

                systemMessageCore systemMessageCore = new systemMessageCore();

                string description = systemMessageCore.BuscarSystemMessageByExternalNumber("0001");

                if (description != "")
                {
                    retorno.Ok(description);
                }
                else
                {
                    retorno.Ok("Cadastro realizado com sucesso.");
                }

                retorno.Sucesso = true;
            }
            catch (Exception erro)
            {
                retorno.Sucesso = false;
                retorno.Erro(erro.InnerException.Message);
            }

            return retorno;
        }
        //ingresar clientes
        private void btnIngresarCliente_Click(object sender, RoutedEventArgs e)
        {
            //se cargan los datos del cliente menos tel y mails
            cliente cli = new cliente();
            cli.Nombre = txtNombre.Text;
            cli.Apellido = txtApellido.Text;

            if (!swModificarCliente) //sólo si es ingresar un cliente nuevo y no modificar uno ya existente
            {
                //se comprueba que no haya otro cliente con el mismo nombre
                foreach (cliente clienteGuardado in misClientes)
                {
                    if (clienteGuardado.Nombre.ToLower() == cli.Nombre.ToLower() && clienteGuardado.Apellido.ToLower() == cli.Apellido.ToLower())
                    {
                        MessageBox.Show("Ya hay un cliente ingresado con el nombre " + cli.Nombre + " " + cli.Apellido + ". Por favor ingrese otro nombre distinto.", "Atención");
                        return;
                    }
                }
            }

            cli.Dirección = txtDirección.Text;
            cli.Peluquería = txtPeluquería.Text;
            cli.Localidad = txtLocalidad.Text;
            DateTime fecha = DateTime.Now;
            try
            { fecha = DateTime.Parse(txtFechaNacimiento.Text); } //si hay una fecha válida
            catch
            { MessageBox.Show("No ha escribo bien la fecha de nacimiento. Hay que escribirla dd/mm/aaaa. La d es día, m es mes, y a es año. O sea que son dos números para el día, dos para el mes, y cuatro para el año. Por ejemplo 02/04/1980.", "Error en la fecha"); return; }

            cli.fecha_nacimiento = fecha.ToShortDateString();

            //se guardan los teléfonos
            if (txtTeléfono.Text != "") cli.Teléfonos.Add(new Teléfono(txtTeléfono.Text)); //lo que está en el txt
            foreach (string str in listBoxTeléfonos.Items) //lo que está en la lista
            {
                cli.Teléfonos.Add(new Teléfono(str));
            }
            //se guardan los mails
            if (txtMail.Text != "") cli.Emails.Add(new Mail(txtMail.Text)); //lo que está en el txt mails
            foreach (string str in listBoxMail.Items) //lo que está en la lista
            {
                cli.Emails.Add(new Mail(str));
            }

            pago unPago = new pago();

            if (!swModificarCliente)
            {
                cli.guardar();
                //se muestra el agregado en el grid
                misClientes.Add(cli);
            }
            else
            {
                cliente unCliente = (cliente)dataGridClientes.SelectedItem;
                cli.Id = unCliente.Id;
                cli.actualizar();
                swModificarCliente = false;
                misClientes.Clear();
                misClientes = new ObservableCollection<cliente>(cliente.cargarTodos());
                dataGridClientes.DataContext = misClientes;
            }

            iniciarCampos();
            tabItem2.Focus();
        }
Exemplo n.º 49
0
 public static void add(cliente cliente)
 {
     Clientes.Add(cliente);
 }
    private void cargarInfoCondiciones(Boolean bModificar)
    {
        capturarVariablesGlogales();

        if (ID_SUB_C != 0)
        {
            subCentroCosto _subCentroCostoMODULO = new subCentroCosto(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
            DataTable tablaInfoSubCentro = _subCentroCostoMODULO.ObtenerSubCentrosDeCostoPorIdSubCosto(ID_SUB_C);
            DataRow filaTablaInfoSubCentro = tablaInfoSubCentro.Rows[0];

            configurarInfoAdicionalModulo(true, filaTablaInfoSubCentro["NOM_SUB_C"].ToString());

            Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
        }
        else
        {
            if (ID_CENTRO_C != 0)
            {
                centroCosto _centroCostoMODULO = new centroCosto(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                DataTable tablaInfoCC = _centroCostoMODULO.ObtenerCentrosDeCostoPorIdCentroCosto(ID_CENTRO_C);
                DataRow filaTablaInfoCC = tablaInfoCC.Rows[0];

                configurarInfoAdicionalModulo(true, filaTablaInfoCC["NOM_CC"].ToString());

                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
            }
            else
            {
                if ((String.IsNullOrEmpty(ID_CIUDAD) == false) && (ID_EMPRESA != 0))
                {
                    cobertura _coberturaMODULO = new cobertura(Session["idEmpresa"].ToString());
                    DataTable tablaInfoCiudad = _coberturaMODULO.obtenerNombreCiudadPorIdCiudad(ID_CIUDAD);
                    DataRow filaTablaInfoCiudad = tablaInfoCiudad.Rows[0];

                    configurarInfoAdicionalModulo(true, filaTablaInfoCiudad["NOMBRE"].ToString());

                    Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
                }
                else
                {
                    cliente _clienteMODULO = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
                    DataTable tablaInfoCliente = _clienteMODULO.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
                    DataRow filaTablaInfoCliente = tablaInfoCliente.Rows[0];

                    configurarInfoAdicionalModulo(true, filaTablaInfoCliente["RAZ_SOCIAL"].ToString());
                    Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = true;
                }
            }
        }

        condicionComercial _condicionComercial = new condicionComercial(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaCondiciones = _condicionComercial.ObtenerCondicionesEconomicasPorId(ID_EMPRESA, ID_CIUDAD, ID_CENTRO_C, ID_SUB_C);
        if (tablaCondiciones.Rows.Count <= 0)
        {
            if (_condicionComercial.MensajeError != null)
            {
                if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
                {
                    configurarBotonesDeAccion(false, false, false, false);
                }
                else
                {
                    configurarBotonesDeAccion(false, false, false, true);
                }

                Panel_FORMULARIO.Visible = false;

                Panel_SECCION_SERVICIOS.Visible = false;

                Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = false;

                configurarMensajes(true, System.Drawing.Color.Red);
                Label_MENSAJE.Text = _condicionComercial.MensajeError;

                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
            }
            else
            {
                if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
                {
                    configurarBotonesDeAccion(false, true, true, false);
                }
                else
                {
                    configurarBotonesDeAccion(false, true, true, true);
                }

                Panel_FORMULARIO.Visible = true;

                Panel_SECCION_SERVICIOS.Visible = false;

                Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = true;

                controlesParaNuevaCondicionEconomica();

                if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
                {
                    Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = true;
                    cargarEstructuraDeCC();

                    configurarMensajesCC(true, System.Drawing.Color.Red);
                    Label_MENSAJE_CC.Text = "Por favor seleccionar una ciudad de la lista de cobertura.";

                    configurarMensajesSUBCC(true, System.Drawing.Color.Red);
                    Label_MENSAJE_SUB_CC.Text = "Por favor seleccionar un centro de costo de la lista de centros de costo.";
                }
                else
                {
                    Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = false;
                }
            }
        }
        else
        {

            if (bModificar == true)
            {
                if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
                {
                    configurarBotonesDeAccion(false, true, true, false);
                }
                else
                {
                    configurarBotonesDeAccion(false, true, true, true);
                }

                Panel_FORMULARIO.Enabled = true;

                Panel_CONTROL_REGISTRO.Visible = false;

                Panel_COD_CONDICIONES.Visible = false;

                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = true;
                mostrar_modulo_copia_condiciones_grupoempresarial();

            }
            else
            {
                if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
                {
                    configurarBotonesDeAccion(true, false, false, false);
                }
                else
                {
                    configurarBotonesDeAccion(true, false, false, true);
                }

                Panel_FORMULARIO.Enabled = false;

                Panel_CONTROL_REGISTRO.Visible = true;
                Panel_CONTROL_REGISTRO.Enabled = false;

                Panel_COD_CONDICIONES.Visible = true;
                Panel_COD_CONDICIONES.Enabled = false;

                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
            }

            Panel_FORMULARIO.Visible = true;

            configurarMensajes(false, System.Drawing.Color.Green);

            DataRow infoCondicionesComerciales = tablaCondiciones.Rows[0];

            cargar_campos_condiciones_comerciales(infoCondicionesComerciales);

            DataTable tablaServiciosDeLaEntidad;
            if (ID_SUB_C != 0)
            {
                tablaServiciosDeLaEntidad = _condicionComercial.ObtenerServiciosPorEmpresaPorIdSubC(ID_SUB_C);

                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
            }
            else
            {
                if (ID_CENTRO_C != 0)
                {
                    tablaServiciosDeLaEntidad = _condicionComercial.ObtenerServiciosPorEmpresaPorIdCentroC(ID_CENTRO_C);

                    Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
                }
                else
                {
                    if ((ID_EMPRESA != 0) && (String.IsNullOrEmpty(ID_CIUDAD) == false))
                    {
                        tablaServiciosDeLaEntidad = _condicionComercial.ObtenerServiciosPorEmpresaPorIdCiudad(ID_CIUDAD, ID_EMPRESA);

                        Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
                    }
                    else
                    {
                        tablaServiciosDeLaEntidad = _condicionComercial.ObtenerServiciosPorEmpresaPorIdEmpresa(ID_EMPRESA);

                    }
                }
            }

            if (tablaServiciosDeLaEntidad.Rows.Count <= 0)
            {
                habilitarSeccionServiciosParaDatosNuevos(bModificar);
            }
            else
            {

                List<servicio> listaServicios = new List<servicio>();
                Session.Remove("listaServicios_" + ID_EMPRESA.ToString());
                Session.Add("listaServicios_" + ID_EMPRESA.ToString(), listaServicios);
                List<detalleServicio> listaDetallesServicio = new List<detalleServicio>();
                Session.Remove("listaDetallesServicio_" + ID_EMPRESA.ToString());
                Session.Add("listaDetallesServicio_" + ID_EMPRESA.ToString(), listaDetallesServicio);

                cargarInformacionServiciosComplementariosDeUnaEntidad(tablaServiciosDeLaEntidad, bModificar, false);
            }

            if ((String.IsNullOrEmpty(ID_CIUDAD) == true) && (ID_CENTRO_C == 0) && (ID_SUB_C == 0))
            {
                Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = true;
                cargarEstructuraDeCC();

                configurarMensajesCC(true, System.Drawing.Color.Red);
                Label_MENSAJE_CC.Text = "Por favor seleccionar una ciudad de la lista de cobertura.";

                configurarMensajesSUBCC(true, System.Drawing.Color.Red);
                Label_MENSAJE_SUB_CC.Text = "Por favor seleccionar un centro de costo de la lista de centros de costo.";
            }
            else
            {
                Panel_ESTRUCTURA_CENTRO_COSTOS.Visible = false;
            }
        }
    }
    private void cargar_ListaEmpresasEnDrop(DropDownList drop)
    {
        drop.Items.Clear();

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        ListItem item = new ListItem("Seleccione...", "");
        drop.Items.Add(item);

        DataTable tablaClientes = _cliente.ObtenerTodasLasEmpresasActivas();

        foreach (DataRow fila in tablaClientes.Rows)
        {
            item = new ListItem(fila["RAZ_SOCIAL"].ToString(), fila["ID_EMPRESA"].ToString());
            drop.Items.Add(item);
        }

        drop.DataBind();
    }
    private void cargar_empresas_asociadas_a_grupo(Decimal ID_GRUPOEMPRESARIAL)
    {
        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaEmpresas = _cliente.ObtenerEmpresasAsociadasAGrupo(ID_GRUPOEMPRESARIAL);

        if (tablaEmpresas.Rows.Count <= 0)
        {
            if (_cliente.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _cliente.MensajeError, Proceso.Error);
            }

            Panel_EMPRESAS_ASOCIADAS_AL_GRUPO.Visible = false;
        }
        else
        {
            cargar_GridView_EMPRESAS_GRUPO_desde_tabal(tablaEmpresas);
        }
    }
    private void Cargar(Decimal ID_REQUERIMIENTO, Decimal ID_SOLICITUD, Decimal ID_EMPRESA, Decimal ID_OCUPACION)
    {
        HiddenField_ID_REQUERIMIENTO.Value = ID_REQUERIMIENTO.ToString();
        HiddenField_ID_SOLICITUD.Value = ID_SOLICITUD.ToString();
        HiddenField_ID_EMPRESA.Value = ID_EMPRESA.ToString();
        HiddenField_ID_OCUPACION.Value = ID_OCUPACION.ToString();

        radicacionHojasDeVida _solIngreso = new radicacionHojasDeVida(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        _solIngreso.ActualizarEstadoProcesoRegSolicitudesIngreso(Convert.ToInt32(ID_REQUERIMIENTO), Convert.ToInt32(ID_SOLICITUD), "EN AFILIACIONES", Session["USU_LOG"].ToString());

        requisicion _requisicion = new requisicion(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable _tablaReq = _requisicion.ObtenerComRequerimientoPorIdRequerimiento(ID_REQUERIMIENTO);
        DataRow _filaReq = _tablaReq.Rows[0];
        String CIUDAD_REQ = _filaReq["CIUDAD_REQ"].ToString().Trim();
        HiddenField_CIUDAD_REQ.Value = CIUDAD_REQ;

        perfil _PERFIL = new perfil(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaPerfil = _PERFIL.ObtenerPorRegistro(Convert.ToInt32(_filaReq["REGISTRO_PERFIL"]));
        DataRow filaPerfil = tablaPerfil.Rows[0];
        Decimal ID_PERFIL = Convert.ToDecimal(_filaReq["REGISTRO_PERFIL"]);
        ID_OCUPACION = Convert.ToDecimal(filaPerfil["ID_OCUPACION"]);
        if (!string.IsNullOrEmpty(filaPerfil["CODIGO"].ToString())) Label_RIESGO.Text = filaPerfil["CODIGO"].ToString();
        HiddenField_ID_PERFIL.Value = ID_PERFIL.ToString();
        HiddenField_ID_OCUPACION.Value = ID_OCUPACION.ToString();

        DataTable tablasol = _solIngreso.ObtenerRegSolicitudesingresoPorIdSolicitud(Convert.ToInt32(ID_SOLICITUD));
        DataRow filaSolIngreso = tablasol.Rows[0];
        String NOMBRE_TRABAJADOR = filaSolIngreso["NOMBRES"].ToString().Trim() + " " + filaSolIngreso["APELLIDOS"].ToString().Trim();
        String NUM_DOC_IDENTIDAD_COMPLETO = filaSolIngreso["TIP_DOC_IDENTIDAD"].ToString().Trim() + " " + filaSolIngreso["NUM_DOC_IDENTIDAD"].ToString().Trim();
        String NUM_DOC_IDENTIDAD = filaSolIngreso["NUM_DOC_IDENTIDAD"].ToString().Trim();
        HiddenField_NUM_DOC_IDENTIDAD.Value = NUM_DOC_IDENTIDAD;

        cliente _empresa = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaEmpresa = _empresa.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaEmpresa = tablaEmpresa.Rows[0];
        String RAZ_SOCIAL = filaEmpresa["RAZ_SOCIAL"].ToString().Trim();
        HiddenField_ID_EMPRESA.Value = filaEmpresa["ID_EMPRESA"].ToString().Trim();

        cargo _cargo = new cargo(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaOcupacion = _cargo.ObtenerOcupacionPorIdOcupacion(ID_OCUPACION);
        DataRow filaOcupacion = tablaOcupacion.Rows[0];
        String CARGO = filaOcupacion["NOM_OCUPACION"].ToString().Trim();

        HiddenField_persona.Value = ID_SOLICITUD.ToString() + "," + ID_REQUERIMIENTO.ToString() + "," + ID_OCUPACION.ToString() + "," + ID_EMPRESA.ToString() + "," + NUM_DOC_IDENTIDAD.Trim();

        cargarDatosTrabajador(NOMBRE_TRABAJADOR, NUM_DOC_IDENTIDAD_COMPLETO, RAZ_SOCIAL, CARGO, ID_OCUPACION.ToString());

        ConRegContratoTemporal _contratoTemporal = new ConRegContratoTemporal(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaCOntratoTemporal = _contratoTemporal.ObtenerConRegContratosTemporalPorIdRequerimientoIdSolicitud(ID_REQUERIMIENTO, ID_SOLICITUD);

        Panel_UbicacionTrabajador.Visible = true;

        if (tablaCOntratoTemporal.Rows.Count <= 0)
        {
            if (_contratoTemporal.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _contratoTemporal.MensajeError, Proceso.Error);
            }

            CargarSeccionUbicacionTrabajador();

            Panel_INFO_ADICIONAL_MODULO.Visible = true;
            Label_INFO_ADICIONAL_MODULO.Text = "SELECCIONE LA UBICACIÓN DONDE LABORARÁ EL TRABAJADOR, PARA PODER CONTINUAR CON LAS AFILIACIONES";
        }
        else
        {
            DataRow filaContratoTemporal = tablaCOntratoTemporal.Rows[0];
            CargarUbicacionTrabajadorSegunTemporal(filaContratoTemporal);
            Panel_INFO_ADICIONAL_MODULO.Visible = true;
            Label_INFO_ADICIONAL_MODULO.Text = "DILIGENCIAR AFILIACIONES DEL TRABAJADOR";
        }

        limpiar_DropDownList_ENTIDAD_ARP();
        limpiar_DropDownList_ENTIDAD_EPS();
        limpiar_DropDownList_ENTIDAD_Caja();
        limpiar_DropDownList(DropDownList_DepartamentoCajaC);
        limpiar_DropDownList(DropDownList_CiudadCajaC);
        limpiar_DropDownList_AFP();

        cargar_DropDownList_pensionado();

        if (HiddenField_SELECCION_ITEM_CON_CONDICIONES_CONTRATACION.Value == "S")
        {
            Panel_ARP.Visible = true;
            Panel_EPS.Visible = true;
            Panel_CCF.Visible = true;
            Panel_AFP.Visible = true;

            cargar_DropDownList_ENTIDAD_AFP();
            cargar_DropDownList_ENTIDAD_ARP();
            cargar_DropDownList_ENTIDAD_CAJA();
            cargar_DropDownList_ENTIDAD_EPS();
        }

        cargar_GridView_AFP(ID_SOLICITUD.ToString(), ID_REQUERIMIENTO.ToString());
        cargar_GridView_ARP(ID_SOLICITUD.ToString(), ID_REQUERIMIENTO.ToString());
        cargar_GridView_CCF(ID_SOLICITUD.ToString(), ID_REQUERIMIENTO.ToString());
        cargar_GridView_EPS(ID_SOLICITUD.ToString(), ID_REQUERIMIENTO.ToString());

        TextBox_ARP_OBSERVACIONES.Text = "";
        TextBox_COMENTARIOS_AFP.Text = "";
        TextBox_COMENTARIOS_EPS.Text = "";
        TextBox_observaciones_Caja.Text = "";

        Panel_Registro_CCF.Visible = true;
        Panel_registro_EPS.Visible = true;
        Panel_registros_afp.Visible = true;
        Panel_registros_ARP.Visible = true;

        if (GridView_ARP.Rows.Count > 0)
        {
            Panel_registros_ARP.Visible = false;
        }
        if (GridView_AFP.Rows.Count > 0)
        {
            Panel_registros_afp.Visible = false;
        }
        if (GridView_CAJA.Rows.Count > 0)
        {
            Panel_Registro_CCF.Visible = false;
        }
        if (GridView_EPS.Rows.Count > 0)
        {
            Panel_registro_EPS.Visible = false;
        }
    }
    private void CargarDatosEmpresaSeleccionada(Decimal ID_EMPRESA)
    {
        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaCliente = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);

        DataRow filaCliente = tablaCliente.Rows[0];

        Label_RazonSocial.Text = filaCliente["RAZ_SOCIAL"].ToString().Trim();
        Label_NitEmpresa.Text = filaCliente["NIT_EMPRESA"].ToString().Trim() + "-" + filaCliente["DIG_VER"].ToString().Trim();
    }
    private void CargarValidadorPersonalCitado(Decimal ID_EMPRESA)
    {
        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaDatos = _cliente.ObtenerNumEmpleadosActivosPorIdEmpresa(ID_EMPRESA, "S", "S");

        if (tablaDatos.Rows.Count <= 0)
        {
            if (_cliente.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se pudo determinar el personal activo actual de la empresa, no se realizará el control de personal citado.", Proceso.Advertencia);
            }

            Label_PersonalCitadoMaximo.Visible = false;
            RangeValidator_TextBox_PersonalCitado.Enabled = false;
            ValidatorCalloutExtender_TextBox_PersonalCitado_1.Enabled = false;

        }
        else
        {
            Int32 contadorPersonalActivo = Convert.ToInt32(tablaDatos.Rows[0]["NUM_EMPLEADOS"]);

            if (contadorPersonalActivo <= 0)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "La empresa no tiene personal activo, no se realizará el control de personal citado.", Proceso.Advertencia);

                Label_PersonalCitadoMaximo.Visible = false;
                RangeValidator_TextBox_PersonalCitado.Enabled = false;
                ValidatorCalloutExtender_TextBox_PersonalCitado_1.Enabled = false;
            }
            else
            {
                Label_PersonalCitadoMaximo.Visible = true;
                Label_PersonalCitadoMaximo.Text = contadorPersonalActivo.ToString();
                RangeValidator_TextBox_PersonalCitado.Enabled = true;
                ValidatorCalloutExtender_TextBox_PersonalCitado_1.Enabled = true;

                RangeValidator_TextBox_PersonalCitado.MinimumValue = "1";
                RangeValidator_TextBox_PersonalCitado.MaximumValue = contadorPersonalActivo.ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        Page.Header.Title = "CONDICIONES DE SELECCIÓN (ENVIO)";

        Decimal ID_EMPRESA = Convert.ToDecimal(QueryStringSeguro["reg"]);

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaInfoEmpresa = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaTablaInfoEmpresa = tablaInfoEmpresa.Rows[0];
        configurarInfoAdicionalModulo(true, filaTablaInfoEmpresa["RAZ_SOCIAL"].ToString());

        if (IsPostBack == false)
        {
            String accion = QueryStringSeguro["accion"].ToString();

            if (accion == "inicial")
            {
                iniciarControlesInicial();
            }
            else
            {
                if (accion == "nuevo")
                {
                    iniciarControlesNuevo();
                }
                else
                {
                    if (accion == "cargarNuevo")
                    {
                        iniciarControlesCargar(false);

                        configurarMensajes(true, System.Drawing.Color.Green);
                        String REGISTRO = QueryStringSeguro["envio"].ToString();
                        Label_MENSAJE.Text = "La condición de envio fue creada y se le asignó el ID " + REGISTRO + ".";
                    }
                    else
                    {
                        if (accion == "cargarModificado")
                        {
                            iniciarControlesCargar(false);

                            configurarMensajes(true, System.Drawing.Color.Green);
                            String REGISTRO = QueryStringSeguro["envio"].ToString();
                            Label_MENSAJE.Text = "La condición de envio  " + REGISTRO + " fue modificada correctamente.";
                        }
                        else
                        {
                            if (accion == "cargar")
                            {
                                iniciarControlesCargar(false);
                            }
                            else
                            {
                                if (accion == "modificar")
                                {
                                    iniciarControlesCargar(true);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    private void Buscar()
    {
        Ocultar(Acciones.Inicio);
        Mostrar(Acciones.Inicio);

        String datosCapturados = HiddenField_FILTRO_DATO.Value;
        String campo = HiddenField_FILTRO_DROP.Value;

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());

        DataTable tablaResultadosBusqueda = new DataTable();

        if (DropDownList_BUSCAR.SelectedValue == "RAZ_SOCIAL")
        {
            tablaResultadosBusqueda = _cliente.ObtenerEmpresaConRazSocial(datosCapturados);
        }
        else
        {
            if (DropDownList_BUSCAR.SelectedValue == "COD_EMPRESA")
            {
                tablaResultadosBusqueda = _cliente.ObtenerEmpresaConCodEmpresa(datosCapturados);
            }
            if (DropDownList_BUSCAR.SelectedValue == "NIT_EMPRESA")
            {
                tablaResultadosBusqueda = _cliente.ObtenerEmpresaConNitEmpresa(datosCapturados);
            }
        }

        if (tablaResultadosBusqueda.Rows.Count <= 0)
        {
            if (_cliente.MensajeError != null)
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _cliente.MensajeError, Proceso.Error);
            }
            else
            {
                Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "No se encontraron registros que cumplieran los datos de busqueda.", Proceso.Advertencia);
            }
        }
        else
        {
            GridView_RESULTADOS_BUSQUEDA.DataSource = tablaResultadosBusqueda;
            GridView_RESULTADOS_BUSQUEDA.DataBind();

            Panel_RESULTADOS_GRID.Visible = true;
        }
    }
Exemplo n.º 58
0
 public List<cliente> FiltrarCliente(cliente cliente)
 {
     return serviceCliente.Filtrar(cliente);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"]);

        _proceso = Convert.ToInt32(tabla.proceso.Financiera);

        Page.Header.Title = "CONTÁCTOS";

        Decimal ID_EMPRESA = Convert.ToDecimal(QueryStringSeguro["reg"]);

        cliente _clienteMODULO = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaInfoEmpresa = _clienteMODULO.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaTablaInfoEmpresa = tablaInfoEmpresa.Rows[0];
        configurarInfoAdicionalModulo(true, filaTablaInfoEmpresa["RAZ_SOCIAL"].ToString());

        if (IsPostBack == false)
        {
            configurar_paneles_popup(Panel_FONDO_MENSAJE, Panel_MENSAJES);

            String accion = QueryStringSeguro["accion"].ToString();

            if (accion == "inicial")
            {
                iniciarControlesInicial();
            }
            else
            {
                if (accion == "nuevo")
                {
                    iniciarControlesNuevo();
                }
                else
                {
                    if (accion == "cargarNuevo")
                    {
                        iniciarControlesCargar();

                        configurarMensajes(true, System.Drawing.Color.Green);
                        String REGISTRO = QueryStringSeguro["contacto"].ToString();
                        Label_MENSAJE.Text = "El contácto " + REGISTRO + " fue creado correctamente.";
                    }
                    else
                    {
                        if (accion == "cargarModificado")
                        {
                            iniciarControlesCargar();

                            configurarMensajes(true, System.Drawing.Color.Green);
                            String REGISTRO = QueryStringSeguro["contacto"].ToString();
                            Label_MENSAJE.Text = "El contácto " + REGISTRO + " fue modificado correctamente.";
                        }
                        else
                        {
                            if (accion == "cargar")
                            {
                                iniciarControlesCargar();
                            }
                            else
                            {
                                if (accion == "modificar")
                                {
                                    iniciarControlesModificar();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    private void mostrar_modulo_copia_condiciones_grupoempresarial()
    {
        tools _tools = new tools();
        SecureQueryString QueryStringSeguro;
        QueryStringSeguro = new SecureQueryString(_tools.byteParaQueryStringSeguro(), Request["data"].ToString());

        Decimal ID_EMPRESA = Convert.ToDecimal(QueryStringSeguro["reg"]);

        cliente _cliente = new cliente(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
        DataTable tablaInfo = _cliente.ObtenerEmpresaConIdEmpresa(ID_EMPRESA);
        DataRow filaInfo = tablaInfo.Rows[0];

        Decimal ID_GRUPOEMPRESARIAL = 0;
        if (filaInfo["ID_GRUPO_EMPRESARIAL"] != DBNull.Value)
        {
            ID_GRUPOEMPRESARIAL = Convert.ToDecimal(filaInfo["ID_GRUPO_EMPRESARIAL"]);
        }

        if (ID_GRUPOEMPRESARIAL == 0)
        {
            Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
        }
        else
        {
            DataTable tablaEmpresas = _cliente.ObtenerEmpresasDelMismoGrupoEmpresarial(ID_GRUPOEMPRESARIAL, ID_EMPRESA);

            if (tablaEmpresas.Rows.Count <= 0)
            {
                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = false;
            }
            else
            {
                Panel_COPIA_CONDICIONES_ECONOMICAS_GRUPO_EMPRESARIAL.Visible = true;
                cargar_DropDownList_EMPRESAS_DEL_GRUPO(tablaEmpresas);
            }
        }
    }