public Boolean ReservarMesa(mesa _mesa, string fecha, clienteFrecuent _clieF) { int insertar = 0; bool respuesta = false; SqlCommand comando = new SqlCommand("sp_A_Table_Reservar", conexion.openDataBase()); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idMesa", _mesa.Id); comando.Parameters.AddWithValue("@fecha", fecha); comando.Parameters.AddWithValue("@NombreCliente", _clieF.Nombe); try { insertar = comando.ExecuteNonQuery(); if (insertar < 0) { respuesta = true; } conexion.closeDatabase(); } catch (Exception) { conexion.closeDatabase(); throw; } return(respuesta); }
public Boolean eliminarClienteFre(clienteFrecuent _cF) { int elininar = 0; bool respuesta = false; SqlCommand comando = new SqlCommand("sp_E_Table_Cliente", conexion.openDataBase()); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@nombrecliente", _cF.Nombe); try { elininar = comando.ExecuteNonQuery(); if (elininar < 0) { respuesta = true; } conexion.closeDatabase(); } catch (Exception) { conexion.closeDatabase(); throw; } return(respuesta); }
public Boolean altaClienteFrecuente(clienteFrecuent _clientFrecu) { int insertar = 0; bool respuesta = false; SqlCommand comando = new SqlCommand("sp_A_table_ClienteFrecuente", conexion.openDataBase()); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@Nombre", _clientFrecu.Nombe); comando.Parameters.AddWithValue("@apellido", _clientFrecu.Apellido); comando.Parameters.AddWithValue("@telefono", _clientFrecu.Telefono); comando.Parameters.AddWithValue("@email", _clientFrecu.Email); comando.Parameters.AddWithValue("@idCatCliente", _clientFrecu.IdtCliente); try { insertar = comando.ExecuteNonQuery(); if (insertar < 0) { respuesta = true; } conexion.closeDatabase(); } catch (Exception) { conexion.closeDatabase(); throw; } return(respuesta); }
public Boolean altaOrdenTipoMesaLocal(mesa _mesa, clienteFrecuent _cliente, usuario _Personal) { int insertar = 0; bool respuesta = false; SqlCommand comando = new SqlCommand("sp_OrdenMesaLocal", conexion.openDataBase()); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idMesa ", _mesa.Id); comando.Parameters.AddWithValue("@idcliente ", _cliente.Id); comando.Parameters.AddWithValue("@idPersonal ", _Personal.Id); try { insertar = comando.ExecuteNonQuery(); if (insertar < 0) { respuesta = true; } conexion.closeDatabase(); } catch (Exception) { conexion.closeDatabase(); throw; } return(respuesta); }
public Boolean altaOrdenParaLlevar(string observacion, clienteFrecuent _cliente, usuario _Personal) { int insertar = 0; bool respuesta = false; SqlCommand comando = new SqlCommand("sp_A_Table_OrdenLLevar", conexion.openDataBase()); comando.CommandType = System.Data.CommandType.StoredProcedure; comando.Parameters.AddWithValue("@idcliente ", _cliente.Id); comando.Parameters.AddWithValue("@observacion", observacion); comando.Parameters.AddWithValue("@idPersonal ", _Personal.Id); try { insertar = comando.ExecuteNonQuery(); if (insertar < 0) { respuesta = true; } conexion.closeDatabase(); } catch (Exception) { conexion.closeDatabase(); throw; } return(respuesta); }
public List <clienteFrecuent> seleccionarCliente() { List <clienteFrecuent> listClienteFrecente = new List <clienteFrecuent>(); SqlCommand Comando = new SqlCommand(); Comando.Connection = conexion.openDataBase(); Comando.CommandType = CommandType.StoredProcedure; Comando.CommandText = "sp_C_Table_Cliente"; clienteFrecuent _clifcnt = new clienteFrecuent(); _clifcnt.Nombe = "Cliente"; listClienteFrecente.Add(_clifcnt); try { IDataReader lector = Comando.ExecuteReader(); while (lector.Read()) { clienteFrecuent _clienteFr = new clienteFrecuent(); _clienteFr.Id = int.Parse(lector[0].ToString()); _clienteFr.Nombe = lector[1].ToString(); listClienteFrecente.Add(_clienteFr); } } catch (Exception ex) { string m = ex.Message; Comando.Dispose(); } finally { conexion.closeDatabase(); } return(listClienteFrecente); }