// // GET: /Prueba/ public ActionResult Index() { using (TransaccionClient proxy = new TransaccionClient()) { ViewBag.listadoSedes = proxy.ListarSedes(); return(View()); } }
private void btnVerDetalle_Click(object sender, EventArgs e) { TransaccionClient proxy = new TransaccionClient(); Pedido pe = new Pedido(); dataGridView2.DataSource = proxy.ListarxPedido(dataGridView1.CurrentRow.Cells[5].Value.ToString()); }
public ActionResult Index(string anio) { using (TransaccionClient proxy = new TransaccionClient()) { int idSede = (int)Session["sedeSelect"]; var listado = proxy.ReservasxAnio(anio, idSede); return(View(listado)); } }
public JsonResult Index(int idSede) { using (TransaccionClient proxy = new TransaccionClient()) { var resultado = new JsonResult(); resultado.Data = new { listadoCampos = proxy.ObtenerCamposXSede(idSede) }; return(resultado); } }
public ActionResult Crear() { var proxy = new TransaccionClient(); var listaCliente = proxy.ListarCliente(); ViewBag.CodCliente = new SelectList(listaCliente, "CodCliente", "Nombre"); var listaEmpleado = proxy.ListarEmpleado(); ViewBag.CodEmpleado = new SelectList(listaEmpleado, "CodEmpleado", "Nombre"); return View(); }
public ActionResult Crear(Pedido nuevoPedido, int CodCliente, int CodEmpleado) { var proxy = new TransaccionClient(); var codcliente = proxy.ObtenerCliente(CodCliente); nuevoPedido.CodCliente = codcliente; var codempleado = proxy.ObtenerEmpleado(CodEmpleado); nuevoPedido.CodEmpleado = codempleado; proxy.CrearPedido(nuevoPedido); return RedirectToAction("Index"); }
public ActionResult Crear(DetallePedido nuevoDetallePedido, int NroPedido, int CodMedicamento) { var proxy = new TransaccionClient(); var nropedido = proxy.ObtenerPedido(NroPedido); //nuevoDetallePedido.NroPedido = nropedido; var codmedicament = proxy.ObtenerMedicamentos(CodMedicamento); //nuevoDetallePedido.CodMedicamento = codmedicament; proxy.CrearDetallePedido(nuevoDetallePedido); return RedirectToAction("Index"); }
public ActionResult Crear() { var proxy = new TransaccionClient(); var listaPedido = proxy.ListarPedido(); ViewBag.NroPedido = new SelectList(listaPedido, "NroPedido", "NroPedido"); var listaMedicamento = proxy.ListarMedicamento(); ViewBag.CodMedicamento = new SelectList(listaMedicamento, "CodMedicamento", "NombreMedicamento"); return View(); }
public ActionResult Actualizar(Pedido pedido, int CodCliente, int CodEmpleado) { var proxy = new TransaccionClient(); var codcliente = proxy.ObtenerCliente(CodCliente); pedido.CodCliente = codcliente; var codempleado = proxy.ObtenerEmpleado(CodEmpleado); pedido.CodEmpleado = codempleado; proxy.ModificarPedido(pedido); return RedirectToAction("Index"); }
private void AgregarMedicamento_Load(object sender, EventArgs e) { TransaccionClient proxy = new TransaccionClient(); proxy.Open(); int cantidad = proxy.ListarMedicamento().Length; //txtCodMedicamento.Text = (cantidad + 1).ToString(); cboMedicamento.DataSource = null; cboMedicamento.DataSource = proxy.ListarTodosMedicamentos(); cboMedicamento.DisplayMember = "NombreMedicamento"; cboMedicamento.ValueMember = "CodMedicamento"; }
public ActionResult Actualizar(int? CodEmpleado) { if (CodEmpleado.HasValue) { var proxy = new TransaccionClient(); var emp = proxy.ObtenerEmpleado(CodEmpleado.Value); return View(emp); } else { return RedirectToAction("Index"); } }
private void btnGuardar_Click(object sender, EventArgs e) { if (txtNombre.Text.Length == 0) { MessageBox.Show("Debe ingresar el Nombre...!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txtPrecioUnidad.Text.Length == 0) { MessageBox.Show("Debe ingresar el Precio...!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (txtUnidades.Text.Length == 0) { MessageBox.Show("Debe ingresar las Unidades...!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { TransaccionClient proxy = new TransaccionClient(); proxy.Open(); Medicamento medi = new Medicamento(); double precio = Double.Parse(txtPrecioUnidad.Text) / 100; medi.NombreMedicamento = txtNombre.Text; medi.PrecioUnidad = precio; medi.UnidadesEnExistencia = int.Parse(txtUnidades.Text); DialogResult Confirmacion = MessageBox.Show("Esta seguro de Guardar los Cambios?", "CONFIRMACION", MessageBoxButtons.YesNo); if (Confirmacion == DialogResult.Yes) { proxy.CrearMedicamento(medi); MessageBox.Show("MEDICAMENTO AGREGADO CORRECTAMENTE","EXITO",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); lblId.Text = ""; txtNombre.Text = ""; txtPrecioUnidad.Text = ""; txtUnidades.Text = ""; txtNombre.Enabled = false; txtPrecioUnidad.Enabled = false; txtUnidades.Enabled = false; btnGuardar.Enabled = false; btnNuevo.Enabled = true; } //else if (Confirmacion == DialogResult.No) //{ //} } }
public ActionResult CamposPorSedes(string id) { var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = 500000000; var proxy = new TransaccionClient(); var campos = proxy.ObtenerCamposXSede2(Convert.ToInt32(id)); return(new JsonResult() { Data = campos, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult MostrarImagen(string id) { var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = 500000000; var proxy = new TransaccionClient(); var campos = proxy.ObtenerCamposXId(Convert.ToInt32(id)); var imagen = Convert.ToBase64String(campos.Imagen); return(new JsonResult() { Data = imagen, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult Actualizar(int? NroPedido) { if (NroPedido.HasValue) { var proxy = new TransaccionClient(); var listaCliente = proxy.ListarCliente(); ViewBag.CodCliente = new SelectList(listaCliente, "CodCliente", "Nombre"); var listaEmpleado = proxy.ListarEmpleado(); ViewBag.CodEmpleado = new SelectList(listaEmpleado, "CodEmpleado", "Nombre"); var emp = proxy.ObtenerPedido(NroPedido.Value); return View(emp); } else { return RedirectToAction("Index"); } }
public ActionResult Tarifa(string dia, int campo) { Session["idCampoCliente"] = campo; DateTime fecha = Convert.ToDateTime(dia); var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = 500000000; var proxy = new TransaccionClient(); string diaFormat = string.Format("{0:yyyy-MM-dd}", fecha); Session["diaReservaCliente"] = dia; var listado = proxy.ListarTarifas(fecha, campo); int horaActual = DateTime.Now.Hour; if (diaFormat == DateTime.Now.ToString("yyyy-MM-dd")) { List <Tarifa> lista = new List <Tarifa>(); foreach (var tarifa in listado) { int hora = int.Parse(tarifa.HoraInicio.Substring(0, 2)); if (hora >= horaActual) { lista.Add(tarifa); } } return(new JsonResult() { Data = lista, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); } return(new JsonResult() { Data = listado, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult Informacion(string id) { Session["idCampoCliente"] = id; var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = 500000000; var proxy = new TransaccionClient(); var campos = proxy.ObtenerCamposXId(Convert.ToInt32(id)); return(new JsonResult() { Data = campos, JsonRequestBehavior = JsonRequestBehavior.AllowGet, MaxJsonLength = Int32.MaxValue }); }
public ActionResult Actualizar(Empleado empleado) { var proxy = new TransaccionClient(); proxy.ModificarEmpleado(empleado); return RedirectToAction("Index"); }
private void ListaMedicamentos_Load(object sender, EventArgs e) { TransaccionClient proxy = new TransaccionClient(); proxy.Open(); dgvMedicamentos.DataSource = proxy.ListarPedido(); }
private void btnNuevo_Click(object sender, EventArgs e) { txtNombre.Enabled = true; txtPrecioUnidad.Enabled = true; txtUnidades.Enabled = true; btnGuardar.Enabled = true; btnNuevo.Enabled = false; TransaccionClient proxy = new TransaccionClient(); proxy.Open(); int cantidad = proxy.ListarTodosMedicamentos().Length+1; lblId.Text = cantidad.ToString(); }
private void Pedidos_Load(object sender, EventArgs e) { TransaccionClient proxy = new TransaccionClient(); dataGridView1.DataSource = proxy.ListarPedido(); }
public ActionResult Crear(Empleado nuevoEmpleado) { var proxy = new TransaccionClient(); proxy.CrearEmpleado(nuevoEmpleado); return RedirectToAction("Index"); }
public ActionResult Create(Cliente nuevoCliente) { var proxy = new TransaccionClient(); proxy.CrearCliente(nuevoCliente); return RedirectToAction("Index"); }
public ActionResult Actualizar(Cliente cliente) { var proxy = new TransaccionClient(); proxy.ModificarCliente(cliente); return RedirectToAction("Index"); }
public ActionResult Crear(Medicamento nuevoMedicamento) { var proxy = new TransaccionClient(); proxy.CrearMedicamento(nuevoMedicamento); return RedirectToAction("Index"); }
// // GET: /Empleado/ public ActionResult Index() { TransaccionClient proxy = new TransaccionClient(); var listado = proxy.ListarEmpleado(); return View(listado); }
public ActionResult Actualizar(Medicamento medicamento) { var proxy = new TransaccionClient(); proxy.ModificarMedicamento(medicamento); return RedirectToAction("Index"); }