private void GuardarCliente() { string CUIL = TxtCUILIzq.Text + "-" + TxtCUIL.Text + "-" + TxtCUILDer.Text; DBClientes objCliente = new DBClientes(TxtApellidos.Text, TxtNombres.Text, CUIL, TxtDNI.Text, cboTipoCliente.SelectedValue.ToString(), TxtCel.Text, TxtFijo.Text, TxtEmail.Text, cboProvincia.SelectedValue.ToString(), cboLocalidad.SelectedValue.ToString(), TxtDireccion.Text, codCliente.ToString(), ChActivo.Checked); if (objCliente.GuardarCliente()) { Alertas alert = new Alertas("Operacion finalizada con éxito !", ""); alert.Show(); } else { Alertas alert = new Alertas("No pudo realizarse la operacion, comuniquese con su administrador.", ""); alert.Show(); } }
private void CargarDirecciones() { DBClientes objCliente = new DBClientes(); DGDirecciones.DataSource = objCliente.TraerDirecciones(this.codCliente); LimpiarDatos(); }
private void cargarCliente() { panel4.Visible = false; panel5.Dock = DockStyle.Fill; panel5.Visible = true; DBClientes objCliente = new DBClientes(); DataTable tabla = objCliente.TraerClientes(tipoCliente, codCliente); DataRow row = tabla.Rows[0]; cboTipoCliente.SelectedValue = Convert.ToInt32(row["CodClienteTipo"].ToString()); if (row["CodProvincia"].ToString() != "") { cboProvincia.SelectedValue = Convert.ToInt32(row["CodProvincia"].ToString()); } if (row["CodLocalidad"].ToString() != "") { cboLocalidad.SelectedValue = Convert.ToInt32(row["CodLocalidad"].ToString()); } TxtNombres.Text = row["Nombres"].ToString(); TxtApellidos.Text = row["Apellidos"].ToString(); TxtDNI.Text = row["DNI"].ToString(); if (row["CUIL"].ToString() != "") { String value = row["CUIL"].ToString(); Char delimiter = '-'; String[] substrings = value.Split(delimiter); int contar = 1; foreach (var substring in substrings) { switch (contar) { case 1: TxtCUILIzq.Text = substring; break; case 2: TxtCUIL.Text = substring; break; case 3: TxtCUILDer.Text = substring; break; default: break; } contar = contar + 1; } } TxtCel.Text = row["TelCelular"].ToString(); TxtFijo.Text = row["TelFijo"].ToString(); TxtDireccion.Text = row["Domicilio"].ToString(); TxtEmail.Text = row["Email"].ToString(); }
private void GuardarDireccion() { DBClientes objCliente = new DBClientes(); Alertas alert = new Alertas(objCliente.GuardarDireccion(this.codCliente, cboProvincia.SelectedValue.ToString(), cboLocalidad.SelectedValue.ToString(), TxtDireccion.Text.Trim()), ""); alert.Show(); }
private void GuardarLlamada() { DBClientes objCliente = new DBClientes(); Alertas alert = new Alertas(objCliente.GuardarLlamada(this.codCliente, cboFecha2.Value, TxtConcepto.Text.Trim()), ""); alert.Show(); TxtConcepto.Text = ""; cboFecha2.Value = DateTime.Today; }
private void cargarComponentes() { DBClientes objCliente = new DBClientes(); //Cargo combo Provincias this.cboProvincia.DisplayMember = "Provincia"; this.cboProvincia.ValueMember = "CodProvincia"; this.cboProvincia.DataSource = objCliente.TraerClientesProvincias(); this.cboProvincia.SelectedIndex = 7; //Cargo combo Localidades this.cboLocalidad.DisplayMember = "Localidad"; this.cboLocalidad.ValueMember = "CodLocalidad"; this.cboLocalidad.DataSource = objCliente.TraerClientesLocalidades(Convert.ToInt32(this.cboProvincia.SelectedValue)); this.cboLocalidad.SelectedIndex = 5; }
private void CargarLocalidades() { try { if (Convert.ToInt32(this.cboProvincia.SelectedValue) > 0) { DBClientes objCliente = new DBClientes(); this.cboLocalidad.DisplayMember = "Localidad"; this.cboLocalidad.ValueMember = "CodLocalidad"; DataTable dt = objCliente.TraerClientesLocalidades(Convert.ToInt32(this.cboProvincia.SelectedValue)); this.cboLocalidad.DataSource = dt; this.cboLocalidad.SelectedIndex = -1; } } catch (Exception e) { MessageBox.Show(e.ToString()); throw; } }
public void CargarClientes() { DBClientes objCliente = new DBClientes(); DGClientes.DataSource = objCliente.TraerClientes(ChEmpresas.Checked); }
private void CargarLlamadas() { DBClientes objCliente = new DBClientes(); DGLlamadas.DataSource = objCliente.TraerLlamadas(this.codCliente); }
public ClienteActivo getByID(string ID, bool xSimple) { if (ID.Length > 12) { throw new Exception("No se ecuentra el cliente"); } if (ID.Length < 1) { throw new Exception("No se ecuentra el cliente"); } if (!Tools.Numeros.IsNumeric(ID)) { throw new Exception("El codigo debe ser solo numeros"); } int IDCliente = -1; if (ID.ToString().Length > 5 && ID.ToString().Length < 9) { if (Tools.Numeros.Cedula(Convert.ToInt32(ID))) { IDCliente = DBClientes.getClienteIDByCedula(ID); } else { throw new Exception("No se ecuentra el cliente"); } } else if (ID.Length > 10 && ID.Length < 13) { IDCliente = DBClientes.getClienteIDRut(ID); } else { IDCliente = Convert.ToInt32(ID); } ClienteActivo Obj; Obj = (ClienteActivo)DBClientes.getSimpleByID(IDCliente); int Cob = 0; try { Cob = Convert.ToInt32(Obj.Cobrador); } catch (Exception) { Cob = 4; } if (Cob > 15) { throw new Exception("No se puede cobrar esta cuenta."); } if (Obj == null) { throw new Exception("No se ecuentra el cliente"); } return(Obj); }
public void Iniciar() { DBClientes = (IMapperClientes)Factory.getMapper(this.GetType()); DTClientes = (DataTable)DBClientes.ObtenerClientes(); }