private void MP_ObtenerCalculo() { try { Tb_Total.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns["Total"], AggregateFunction.Sum)); } catch (Exception ex) { MP_MostrarMensajeError(ex.Message); } }
private void MP_ObtenerCalculo() { //Tb_TotalEnviado.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[3], AggregateFunction.Sum)); //Tb_TGrupo.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[4], AggregateFunction.Sum)); //Tb_TMaples.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[5], AggregateFunction.Sum)); //Tb_TCantidad.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[6], AggregateFunction.Sum)); //Tb_TotalFisico.Value = (Tb_TotalEnviado.Value * 360) + (Tb_TGrupo.Value * 300) + (Tb_TMaples.Value * 30) + Tb_TCantidad.Value; //Tb_TPrecio.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[8], AggregateFunction.Sum)) / 10; //Tb_TSaldoTo.Value = Tb_TTotal.Value * Tb_TPrecio.Value; //Tb_TotalVendido.Value = Tb_TotalEnviado.Value * 12; //Tb_MGrupos.Value = Tb_TGrupo.Value * 10; //Tb_MMaples.Value = Tb_TMaples.Value; //Tb_MCantidad.Value = Convert.ToInt32((Tb_TCantidad.Value / 300) * 11); //Tb_MTotal.Value = Tb_TSaldoTo.Value + Tb_MGrupos.Value + Tb_MMaples.Value + Tb_MCantidad.Value; Tb_TotalFisico.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[7], AggregateFunction.Sum)); Tb_TPrecio.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns[8], AggregateFunction.Sum)) / Dgv_Detalle.RowCount; Tb_TSaldoTo.Value = Tb_TotalFisico.Value * Tb_TPrecio.Value; Tb_TotalMaples.Value = Tb_TotalFisico.Value / 30; }
private void MP_ObtenerCalculo() { try { decimal Precio = 0; if (Tb_IdCompraIngreso.Text != "") { var lresult = new ServiceDesktop.ServiceDesktopClient().CmmpraIngreso_01ListarXId(Convert.ToInt32(Tb_IdCompraIngreso.Text)).ToList(); Precio = lresult.Select(c => c.PrecioCost).Sum() / lresult.Where(c => c.PrecioCost > 0).Select(d => d.PrecioCost).Count(); } Tb_Recep_TCantidad.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns["TotalCant"], AggregateFunction.Sum)); Tb_Recep_TPrecio.Value = Convert.ToDouble(Precio); Tb_Recep_Total.Value = Tb_Recep_TCantidad.Value * Tb_Recep_TPrecio.Value; Tb_TCantidad.Value = Convert.ToDouble(Dgv_Seleccion.GetTotal(Dgv_Seleccion.RootTable.Columns["Cantidad"], AggregateFunction.Sum)); Tb_TPrecio.Value = Convert.ToDouble(Precio); //Tb_Selecc_TPrecio.Value = Convert.ToDouble(Dgv_Seleccion.GetTotal(Dgv_Seleccion.RootTable.Columns["Precio"], AggregateFunction.Sum)) / Dgv_Seleccion.RowCount; Tb_Total.Value = Tb_TCantidad.Value * Tb_TPrecio.Value; } catch (Exception ex) { MP_MostrarMensajeError(ex.Message); } }
private void Dgv_Detalle_KeyDown(object sender, KeyEventArgs e) { Tb_Total1.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns["TotalProd"], AggregateFunction.Sum)); Tb_Total2.Value = Convert.ToDouble(Dgv_Detalle.GetTotal(Dgv_Detalle.RootTable.Columns["Total"], AggregateFunction.Sum)); }