private void correoElectronicoWaterMarkTextBox_Validating(object sender, CancelEventArgs e) { string error = null; if (!Validacion.esEmail(correoElectronicoWaterMarkTextBox)) { correoElectronicoWaterMarkTextBox.BackColor = Color.White; error = "Ingrese el correo electronico"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else if (DatosCliente.existeClienteCO(id, correoElectronicoWaterMarkTextBox.Text)) { correoElectronicoWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError(correoElectronicoWaterMarkTextBox, String.Empty); } else if (DatosCliente.existeCorreoE(correoElectronicoWaterMarkTextBox.Text)) { correoElectronicoWaterMarkTextBox.BackColor = Color.White; error = "El correo electronico ya existe"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else { correoElectronicoWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError((Control)sender, String.Empty); } }
public Cliente_Admin(bool cumple) { InitializeComponent(); cbox_filtro_producto.SelectedIndex = 0; ArrayList lista = new ArrayList(); // nombre if (cbox_filtro_producto.SelectedIndex == 0) { string buscarse = "and c.nombre like '%%'"; lista = DatosCliente.getClientes(buscarse); } for (int x = lista.Count; x > 0; x--) { if (((Cliente)lista[x - 1]).Nacimiento.Day != DateTime.Today.Day || ((Cliente)lista[x - 1]).Nacimiento.Month != DateTime.Today.Month) { lista.RemoveAt(x - 1); } } listaVacia.Clear(); listaVacia = lista; bdd_clientes.DataSource = listaVacia; }
public Ticket() { setModo(EnumModoTicket.Modo58mm); Negocio = new DatosNegocio(); Cliente = new DatosCliente(); Documento = new DatosDocumento(); }
//public static string modificarlistactacte(DataTable midata, decimal totalapagar) //{ // //DatosCliente objcliente = new DatosCliente(); // //return objcliente(midata,""); //} public static string agregaromodificarrecibo(DataTable midata, decimal totalapagar, int codcliente, int idusuario, ref int codrecibo) { DatosCliente objcliente = new DatosCliente(codcliente); return(objcliente.agregarrecibo(ref codrecibo, objcliente, midata, totalapagar, false, idusuario)); }
public static DataTable Buscar(string buscar) { DatosCliente Cliente = new DatosCliente(); Cliente.Buscar = buscar; return(Cliente.BuscarCliente(Cliente)); }
private void numeroCelularWaterMarkTextBox_Validating(object sender, CancelEventArgs e) { string error = null; if (!Validacion.esTelefono(numeroCelularWaterMarkTextBox)) { numeroCelularWaterMarkTextBox.BackColor = Color.White; error = "Ingrese el numero de celular"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else if (DatosCliente.existeClienteNC(id, numeroCelularWaterMarkTextBox.Text)) { numeroCelularWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError(numeroCelularWaterMarkTextBox, String.Empty); } else if (DatosCliente.existeNumeroCelular(numeroCelularWaterMarkTextBox.Text)) { numeroCelularWaterMarkTextBox.BackColor = Color.White; error = "El numero de celular ya existe"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else { numeroCelularWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError((Control)sender, String.Empty); } }
private void cuitWaterMarkTextBox_Validating(object sender, CancelEventArgs e) { string error = null; if (!Validacion.esNumeroCUIT(cuitWaterMarkTextBox)) { cuitWaterMarkTextBox.BackColor = Color.White; error = "Ingrese el numero de CUIL/CUIT, solo 11 numeros"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else if (DatosCliente.existeClienteC(id, cuitWaterMarkTextBox.Text)) { cuitWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError(cuitWaterMarkTextBox, String.Empty); } else if (DatosCliente.existeC(cuitWaterMarkTextBox.Text)) { cuitWaterMarkTextBox.BackColor = Color.White; error = "El numero de CUIL/CUIT ya existe"; e.Cancel = true; errorProvider1.SetError((Control)sender, error); } else { cuitWaterMarkTextBox.BackColor = colorOk; errorProvider1.SetError((Control)sender, String.Empty); } }
private void txtBuscar_KeyUp(object sender, KeyEventArgs e) { try { if (txtBuscar.Text == "") { clienteBindingSource.DataSource = DatosCliente.getClientes(); } if (cbSelector.SelectedIndex == 0) { clienteBindingSource.DataSource = DatosCliente.BuscarNombreCliente(txtBuscar.Text); } else if (cbSelector.SelectedIndex == 1) { clienteBindingSource.DataSource = DatosCliente.BuscarContacto(txtBuscar.Text); } else if (cbSelector.SelectedIndex == 2) { clienteBindingSource.DataSource = DatosCliente.BuscarCuit(txtBuscar.Text); } else if (cbSelector.SelectedIndex == 3) { clienteBindingSource.DataSource = DatosCliente.BuscarZona(txtBuscar.Text); } } catch { MessageBox.Show("No se encontro nada en su busqueda"); Actualizar(); } }
public EnviarPedidoDVH(PedidoEcom _Pedido, GetInfoClienteEcomm InfoCliEcom) { pedidoEcom = _Pedido; infoClienteEcomm = InfoCliEcom; DatosCli = new DatosCliente(pedidoEcom.RUT); if (DatosCli.Region == "05") { Sucursal = "VIÑA DEL MAR"; } else { Sucursal = "SANTIAGO"; } if (!DatosCli.Bloqueado && DatosCli.EFinanciero.Disponible > _Pedido.Bruto) { PedidoAlfak.Generate generate = new PedidoAlfak.Generate(_Pedido, Sucursal); if (generate.IsSuccess) { NroPedido = generate.NroPedido; /*actualizar el nro de pedido en PLABAL*/ /*Ingresar en PLABAL.Planificacion*/ } else { IsSuccess = false; Mensaje = generate.Mensaje; } } else { IsSuccess = false; Mensaje = "El pedido no pudo ser ingresado debido a que el cliente está bloqueado o el cupo disponible no alcanza."; } }
private void btnEliminar_Click(object sender, EventArgs e) { try { Cliente c = (Cliente)clienteBindingSource.Current; if (!DatosCliente.enUso(c.Id)) { c.Activo = false; if (MessageBox.Show("¿Esta seguro de eliminar a " + c.Nombre + "?", "Eliminar", MessageBoxButtons.YesNo) == DialogResult.Yes) { DatosCliente.Modificar(c); Actualizar(); } } else { MessageBox.Show("El objeto seleccionado no puede ser eliminado"); } } catch { MessageBox.Show("No seleccionó nada"); } }
public static string Eliminar(int id) { DatosCliente cliente = new DatosCliente(); cliente.Idcliente = id; return(cliente.Eliminar(cliente)); }
static void Main(string[] args) { Console.WriteLine("EMPRESA TERCER NIVEL CÍA. LTDA"); Console.WriteLine("BIENVENIDO(A)"); Console.WriteLine(); DatosCliente datosCliente1 = new DatosCliente("Zúniga Reinoso", "Karla Gabriela", 1351289093, "Cdla Los Eléctricos"); DatosCliente datosCliente2 = new DatosCliente("Espinales Moreira", "Diego Xavier", 1358897815, "Ciudad Jardín"); DatosGasolina datosgasolina1 = new DatosGasolina("Extra", 3, 1.50); DatosGasolina datosgasolina2 = new DatosGasolina("Super", 5, 2.00); Console.WriteLine("Apellidos: {0}\nNombres: {1}\nCédula de Identidad: {2}\nDirección Domiciliaria: {3}", datosCliente1.Apellidos, datosCliente1.Nombres, datosCliente1.Cedula, datosCliente1.Direccion); Console.WriteLine(); Console.WriteLine("Tipo Gasolina: {0}\nCantidad de galones: {1}\nPrecio de la gasolina: ${2}\n\nSubtotal: ${3}\nIVA: ${4}\nTotal: ${5}", datosgasolina1.Tipogasolina, datosgasolina1.Cantidadgalones, datosgasolina1.PrecioVenta, datosgasolina1.Subtotal, datosgasolina1.Iva, datosgasolina1.Total); Console.WriteLine("\n*****************************************\n"); Console.WriteLine("Apellidos: {0}\nNombres: {1}\nCédula de Identidad: {2}\nDirección Domiciliaria: {3}", datosCliente2.Apellidos, datosCliente2.Nombres, datosCliente2.Cedula, datosCliente2.Direccion); Console.WriteLine(); Console.WriteLine("Tipo Gasolina: {0}\nCantidad de galones: {1}\nPrecio de la gasolina: ${2}\n\nSubtotal: ${3}\nIVA: ${4}\nTotal: ${5}", datosgasolina2.Tipogasolina, datosgasolina2.Cantidadgalones, datosgasolina2.PrecioVenta, datosgasolina2.Subtotal, datosgasolina2.Iva, datosgasolina2.Total); Console.ReadKey(); }
private void btnAceptar_Click(object sender, EventArgs e) { try { if (!validaciones()) { return; } Cliente c = (Cliente)clienteBindingSource.Current; c.Zona = (Zona)cbZona.SelectedItem; c.Activo = true; c.FechaInicio = fechaInicioDateTimePicker.Value; if (c.Id == 0) { DatosCliente.Crear(c); } else { DatosCliente.Modificar(c); } Close(); } catch { MessageBox.Show("Complete todos los campos"); } }
public static DataTable BuscarCliente(string busqueda) { DatosCliente cliente = new DatosCliente(); cliente.Nombre = busqueda; return(cliente.BuscarCliente(cliente)); }
public static DataTable buscar(string texto) { DatosCliente cliente = new DatosCliente(); cliente.BuscarCliente = texto; return(cliente.buscarTexto(cliente)); }
public static DataTable buscarCodigoCliente(string texto, int modo = 6) { DatosCliente cliente = new DatosCliente(); cliente.BuscarCliente = texto; return(cliente.buscarCodigoCliente(cliente, modo)); }
public DatosCliente GetIP() { DatosCliente cli = new DatosCliente(); try { string ip = null; ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ip)) { ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } else // Using X-Forwarded-For last address { ip = ip.Split(',') .Last() .Trim(); } cli.RemoteAddr = ip; var ipClient = HttpContext.Current.Request.ServerVariables["HTTP_CLIENT_IP"]; cli.ClientIP = ipClient; var host = HttpUtility.HtmlEncode(HttpContext.Current.Request.UserHostAddress); cli.HostAddr = host; } catch (Exception e) { } return(cli); }
private void Actualizar() { try { Cliente c = DatosCliente.getCliente(id); provinciaBindingSource.DataSource = DatosProvincia.getProvinciasPorPais(c.Zona.Localidad.Provincia.Pais.Id); if (cbProvincia.SelectedValue == null) { localidadBindingSource.DataSource = null; } else { localidadBindingSource.DataSource = DatosLocalidad.getLocalidadesPorProvincia(c.Zona.Localidad.Provincia.Id); if (cbLocalidad.SelectedValue == null) { zonaBindingSource.DataSource = null; } else { zonaBindingSource.DataSource = DatosZona.getZonasPorLocalidad(c.Zona.Localidad.Id); } } } catch { } }
protected void FillInformation(DatosCliente _Cli) { FillDDlEmpresas(DUser.InfoEmpresas); Page.Title = _Cli.Nombre; lblCreditoDis.Text = (_Cli.EFinanciero.Credito + _Cli.EFinanciero.RiesgoPropio).ToString("C0"); LabelDisponible.Text = _Cli.EFinanciero.Disponible.ToString("C0"); Hiddendisponible.Value = _Cli.EFinanciero.Disponible.ToString(); LblCliente.Text = "Empresa: " + Cli.Nombre; lblUtilizado.Text = _Cli.EFinanciero.Deuda.ToString("C0"); CargarMensajes(Cli.Nombre); if (_Cli.EFinanciero.Disponible <= 5000) { BtnCrearPedido.Enabled = false; BtnCrearPedido.ToolTip = "No tiene cupo para realizar pedido."; } else { BtnCrearPedido.Enabled = true; } if (_Cli.Bloqueado) { BtnCrearPedido.Enabled = false; BtnCrearPedido.ToolTip = "Cliente Bloqueado, comuníquese con el depto. de Créditos y Cobranzas."; } }
public static string Eliminar(int idCliente) { DatosCliente Cliente = new DatosCliente(); Cliente.IdCliente = idCliente; return(Cliente.Eliminar(Cliente)); }
void master_Page_PreLoad(object sender, EventArgs e) { Usuario funcion = new Usuario(); Infousuario usuario = funcion.Info; HtmlGenericControl span = new HtmlGenericControl("span") { InnerHtml = usuario.Nombre }; HtmlGenericControl a; var divuser = loginview.FindControl("DivUsuario"); var DropMenu = loginview.FindControl("DropMenu"); divuser.Controls.Add(span); if (!IsPostBack) { // Establecer token Anti-XSRF ViewState[AntiXsrfTokenKey] = Page.ViewStateUserKey; ViewState[AntiXsrfUserNameKey] = Context.User.Identity.Name ?? String.Empty; } else { // Validar el token Anti-XSRF if ((string)ViewState[AntiXsrfTokenKey] != _antiXsrfTokenValue || (string)ViewState[AntiXsrfUserNameKey] != (Context.User.Identity.Name ?? String.Empty)) { throw new InvalidOperationException("Error de validación del token Anti-XSRF."); } } rut = Request.QueryString["RUT"]; Ainicio.Attributes.Clear(); Ainicio.Attributes.Add("class", "nav-link text-white"); Ainicio.Attributes.Add("id", "Ainicio"); if (!string.IsNullOrEmpty(rut)) { Ainicio.Attributes.Add("onclick", "Loading();"); Ainicio.Attributes.Add("href", "~/View/Cliente/Default.aspx?RUT=" + rut); } else { DUser = new nsCliente.Usuario(Page.User.Identity.Name); Cli = DUser.InfoEmpresas.First(); rut = Cli.Rut; } Ainicio.Attributes.Add("onclick", "Loading();"); Ainicio.Attributes.Add("href", "~/View/Cliente/"); a = new HtmlGenericControl("a") { InnerHtml = "Información de la Empresa" }; a.Attributes.Add("class", "dropdown-item dropdown-item-nav text-white"); a.Attributes.Add("href", ResolveUrl("~/View/Cliente/Usuario/Info-empresa/Empresa.aspx") + "?RUT=" + rut); DropMenu.Controls.Add(a); }
public static string Editar(int idCliente, string estado) { DatosCliente Cliente = new DatosCliente(); Cliente.IdCliente = idCliente; Cliente.Estado = estado; return(Cliente.EditarEstado(Cliente)); }
public static DataTable consultarClienteTabla(string ciCliente) { DatosCliente cliente = new DatosCliente(); cliente.CiCliente = ciCliente; return(cliente.consultarClienteTabla(cliente)); }
public static string buscarCliente(string ciCliente) { DatosCliente cliente = new DatosCliente(); cliente.CiCliente = ciCliente; return(cliente.buscarCliente(cliente)); }
public static string eliminarCliente(string ciCliente) { DatosCliente cliente = new DatosCliente(); cliente.CiCliente = ciCliente; return(cliente.eliminarCliente(cliente)); }
public static string getSaludo(this DatosCliente data) { if (data == null) { return(""); } return("Hola, " + data.FirstName.ToUpperFirstLetter() + " " + data.LastName.ToUpperFirstLetter()); }
protected void Page_Load(object sender, EventArgs e) { string User = Page.User.Identity.Name; DUser = new nsCliente.Usuario(User); if (DUser.HasEmpresa) { if (DUser.InfoEmpresas.Count > 1) { PnlBtnToMdlChangeCli.Visible = true; } else { PnlBtnToMdlChangeCli.Visible = false; } if (!IsPostBack) { rut = Request.QueryString["RUT"]; if (!string.IsNullOrEmpty(rut)) { Cli = new DatosCliente(rut); } else { Cli = DUser.InfoEmpresas.First(); } HdnRutCli.Value = Cli.Rut; FillInformation(Cli); } else { } } else { Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador.")); } Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL"); FunDetPed Funcion = new FunDetPed(); PlazoEntrega Plazoentregatermo = Funcion.PlazoEntrega("Termo"); diastermo.Text = "(" + Plazoentregatermo.Dias.ToString() + " días hábiles)"; FechaTermo.Text = "Entrega el " + Plazoentregatermo.Fecha.ToShortDateString(); PlazoEntrega Plazolamina = Funcion.PlazoEntrega("Lamina"); DiasLaminas.Text = "(" + Plazolamina.Dias.ToString() + " días hábiles)"; FechaLaminas.Text = "Entrega el " + Plazolamina.Fecha.ToShortDateString(); PlazoEntrega Plazoarq = Funcion.PlazoEntrega("Arq"); DiasArq.Text = "(" + Plazoarq.Dias.ToString() + " días hábiles)"; FechaArq.Text = "Entrega el " + Plazoarq.Fecha.ToShortDateString(); }
public static string actualizarCliente(string ciCliente, string direccionCliente, string telefonoFijoCliente, string telefonoMovilCliente) { DatosCliente cliente = new DatosCliente(); cliente.CiCliente = ciCliente; cliente.DireccionCliente = direccionCliente; cliente.TelefonoFijoCliente = telefonoFijoCliente; cliente.TelefonoMovilCliente = telefonoMovilCliente; return(cliente.actualizarCliente(cliente)); }
public static string insertarCliente(string ciCliente, string nombreCliente, string direccionCliente, string telefonoFijoCliente, string telefonoMovilCliente) { DatosCliente cliente = new DatosCliente(); cliente.CiCliente = ciCliente; cliente.NombreCliente = nombreCliente; cliente.DireccionCliente = direccionCliente; cliente.TelefonoFijoCliente = telefonoFijoCliente; cliente.TelefonoMovilCliente = telefonoMovilCliente; return(cliente.insertarCliente(cliente)); }
protected void Page_Load(object sender, EventArgs e) { string User = Page.User.Identity.Name; DUser = new nsCliente.Usuario(User); if (DUser.HasEmpresa) { if (DUser.InfoEmpresas.Count > 1) { PnlBtnToMdlChangeCli.Visible = true; } else { PnlBtnToMdlChangeCli.Visible = false; } rut = Request.QueryString["RUT"]; if (!string.IsNullOrEmpty(rut)) { Cli = new DatosCliente(rut); ClienteEcom = new GetInfoClienteEcomm(rut); } else { Cli = DUser.InfoEmpresas.First(); ClienteEcom = new GetInfoClienteEcomm(Cli.Rut); } if (!IsPostBack) { HdnRutCli.Value = Cli.Rut; FillInformation(Cli); Thread.CurrentThread.CurrentCulture = new CultureInfo("es-CL"); FechasExpress.Get get; get = new FechasExpress.Get("TER", ClienteEcom.DiasDeTrato, 7); diastermo.Text = "(" + get.DiasEntrega.ToString() + " días hábiles)"; FechaTermo.Text = "Entrega el " + get.FechaCorte.ToShortDateString(); get = new FechasExpress.Get("LAMINA", 7); DiasLaminas.Text = "(" + get.DiasEntrega.ToString() + " días hábiles)"; FechaLaminas.Text = "Entrega el " + get.FechaCorte.ToShortDateString(); get = new FechasExpress.Get("ARQ", 0, 7); DiasArq.Text = "(" + get.DiasEntrega.ToString() + " días hábiles)"; FechaArq.Text = "Entrega el " + get.FechaCorte.ToShortDateString(); } else { } } else { Response.Redirect(Error404.Redireccion(MasterPageFile, User + ", no tienes empresa asignada :(. Por favor comuníquese con el administrador.")); } }