private void OnRowChanged(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { // try { // } catch (Exception) { } finally { OnValidateForm(null, null); } }
private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { // this.grdSchedule.Update(); int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.TrailerLogTableRow entry = (DispatchDataset.TrailerLogTableRow) this.mSchedule.TrailerLogTable.Select("ID=" + id)[0]; FreightGateway.ChangeTrailerEntry(entry); Refresh(); }
private void OnGridAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { //Validate; update assignment order by assignment try { //Update assignment this.grdAssignments.DisplayLayout.Bands[0].Columns["Assign"].ResetSortIndicator(); this.grdAssignments.DisplayLayout.Bands[0].Columns["Assign"].SortIndicator = SortIndicator.Descending; this.grdAssignments.Refresh(); } catch (Exception) { } }
private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { // try { this.grdSchedule.Update(); int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.LoadTenderLogTableRow loadtender = (DispatchDataset.LoadTenderLogTableRow) this.mSchedule.LoadTenderLogTable.Select("ID=" + id)[0]; FreightGateway.UpdateLoadTenderEntry(loadtender); Refresh(); } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); } }
private void OnScheduleAfterRowUpdate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { // try { this.grdSchedule.Update(); int id = Convert.ToInt32(this.grdSchedule.ActiveRow.Cells["ID"].Value); DispatchDataset.ClientInboundScheduleTableRow appointment = (DispatchDataset.ClientInboundScheduleTableRow) this.mSchedule.ClientInboundScheduleTable.Select("ID=" + id)[0]; FreightGateway.ChangeClientInboundFreight(appointment); Refresh(); } catch (Exception ex) { App.ReportError(ex, true, LogLevel.Warning); } }
private void dgvDatos_BeforeRowActivate(object sender, Infragistics.Win.UltraWinGrid.RowEventArgs e) { try { string _item = e.Row.Cells[(int)Columnas1.Articulo].Value.ToString(); #region Stock - Ideal using (SqlConnection connection = new SqlConnection(Datos.Clases.Constantes.conectionLog)) { using (SqlCommand command = new SqlCommand("sp_Compras", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@TipoConsulta", 3); command.Parameters.AddWithValue("@ItemCode", _item); command.Parameters.AddWithValue("@Zona_Comprar", "IMPORTACION USA"); SqlDataAdapter da = new SqlDataAdapter(); DataTable table = new DataTable(); da.SelectCommand = command; da.Fill(table); table.TableName = "Detalle"; var qryHeader = (from item in table.AsEnumerable() group item by new { ItemCode = item.Field <string>("ItemCode"), Zona = item.Field <string>("Zona") } into grouped select new { ItemCode = grouped.Key.ItemCode, Zona = grouped.Key.Zona, Ideal = grouped.Sum(ix => ix.Field <decimal>("Ideal")), Stock = grouped.Sum(ix => ix.Field <decimal>("Stock")), Solicitado = grouped.Sum(ix => ix.Field <decimal>("Solicitado")) }).ToList(); DataTable tbl_header = new DataTable(); tbl_header = Datos.Clases.ListConverter.ToDataTable(qryHeader); tbl_header.TableName = "Header"; DataSet ds = new DataSet(); ds.Tables.Add(tbl_header); ds.Tables.Add(table); ds.Relations.Add("UNION", ds.Tables[0].Columns["Zona"], ds.Tables[1].Columns["Zona"]); dgvStocks.DataSource = null; dgvStocks.DataSource = ds; dgvStocks.Rows.ExpandAll(true); } } #endregion #region Ventas using (SqlConnection connection = new SqlConnection(Datos.Clases.Constantes.conectionLog)) { using (SqlCommand command = new SqlCommand("sp_HistorialVentas", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@TipoConsulta", 1); command.Parameters.AddWithValue("@Articulo", _item); command.Parameters.AddWithValue("@Zona", "IMPORTACION USA"); SqlDataAdapter da = new SqlDataAdapter(); DataTable table = new DataTable(); da.SelectCommand = command; da.Fill(table); table.TableName = "Detalle"; var qryHeader = (from item in table.AsEnumerable() group item by new { ItemCode = item.Field <string>("Artículo"), Zona = item.Field <string>("Zona") } into grouped select new { ItemCode = grouped.Key.ItemCode, Zona = grouped.Key.Zona, M1 = grouped.Sum(ix => ix.Field <decimal>(3)), M2 = grouped.Sum(ix => ix.Field <decimal>(4)), M3 = grouped.Sum(ix => ix.Field <decimal>(5)), M4 = grouped.Sum(ix => ix.Field <decimal>(6)), M5 = grouped.Sum(ix => ix.Field <decimal>(7)), M6 = grouped.Sum(ix => ix.Field <decimal>(8)), M7 = grouped.Sum(ix => ix.Field <decimal>(9)), M8 = grouped.Sum(ix => ix.Field <decimal>(10)), M9 = grouped.Sum(ix => ix.Field <decimal>(11)), M10 = grouped.Sum(ix => ix.Field <decimal>(12)), M11 = grouped.Sum(ix => ix.Field <decimal>(13)), M12 = grouped.Sum(ix => ix.Field <decimal>(14)), MT = grouped.Sum(ix => ix.Field <decimal>(15)) }).ToList(); DataTable tbl_header = new DataTable(); tbl_header = Datos.Clases.ListConverter.ToDataTable(qryHeader); tbl_header.TableName = "Header"; DataSet ds = new DataSet(); ds.Tables.Add(tbl_header); ds.Tables.Add(table); ds.Relations.Add("UNION", ds.Tables[0].Columns["Zona"], ds.Tables[1].Columns["Zona"]); dgvVentas.DataSource = null; dgvVentas.DataSource = ds; dgvVentas.Rows.ExpandAll(true); } } #endregion } catch (Exception) { } }