public DataTable verHistorialPedido() { D_Pedido pedido = new D_Pedido(); DataTable ver = new DataTable(); ver = pedido.obtenerPedidos(); return(ver); }
protected void dgvSubtotal_RowComand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "Cotizar") { E_Cotizacion objE_Cot = new E_Cotizacion(); D_Cotizacion objD_Cot = new D_Cotizacion(); C_Cotizacion objC_Cot = new C_Cotizacion(); double preTotal = Convert.ToDouble(dgvSubtotal.DataKeys[Convert.ToInt32(e.CommandArgument)].Values["SubTotal"].ToString()); double desc = Convert.ToDouble(txtDescuento.Text); string nom = txtNombreCot.Text; objE_Cot.PreTotal1 = preTotal; objE_Cot.Descuento1 = Convert.ToDouble(txtDescuento.Text.Trim()); objE_Cot.Total1 = (preTotal - (preTotal * (Convert.ToDouble(txtDescuento.Text.Trim()) / 100))); objE_Cot.NombreCotizacion1 = txtNombreCot.Text.Trim(); if (desc.ToString() == null) { throw new Exception("Ingrese el descuento"); } if (desc <= 0) { throw new Exception("El descuento debe ser mayor a cero."); } if (txtNombreCot.Text == "") { throw new Exception("Ingrese un nombre a la cotización"); } camposCot(); objC_Cot.insertarCotizacion(objE_Cot); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Notificacion('Ok','Se registró correctamente la cotización','success')", true); } else if (e.CommandName == "Finalizar") { D_Cotizacion objD_Cot = new D_Cotizacion(); D_Pedido objD_Ped = new D_Pedido(); E_Pedido objE_Ped = new E_Pedido(); String idPedido = (Session["pedido"] == null) ? null : Session["pedido"].ToString(); objE_Ped.IdPedido1 = Convert.ToInt32(Session["pedido"]); objD_Ped.actualizarPedido(objE_Ped); dgvTotal.DataSource = objD_Cot.TotalCotizar(); dgvTotal.DataBind(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Notificacion('Ok','Se finalizó la cotización.','success')", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "Notificacion('Error','" + ex.Message + "','error')", true); } }
private void CargarPedidosxProveedor() { int Usuario = Convert.ToInt32(Session["idUsuario"]); DAO.D_Pedido objD_Ped = new D_Pedido(); DAO.D_Proveedor objD_Pro = new D_Proveedor(); DataTable dgv = objD_Pro.BuscarProveedor(Usuario);; int codigo = Convert.ToInt32(dgv.Rows[0]["IdProveedor"].ToString()); //a=ide proveedor dgvPedidos.DataSource = objD_Ped.ListarPedidosxProveedor(codigo); dgvPedidos.DataBind(); }