private void ChangeStatus(OpenCloseStatus newStatus) { this.Status = newStatus; base.MarkAsDirty(); this.Save(); }
private void warehousesChangeStat(OpenCloseStatus stat) { try { var rows = disp_grid_warehouse.SelectedRows; foreach (DataGridViewRow r in rows) { DataGridViewCellCollection c = r.Cells; int warehouseId = int.Parse(c["col_warehouseId"].Value.ToString()); RecordsDataSet.WarehouseRow warehouse = db.Warehouse.FindByid(warehouseId); warehouse.warehouseStatus = stat.ToString(); } dbmgr.UpdateAll(db); fillWarehouseGrid(); showSuccessMessage("Updated " + rows.Count + " item(s)"); } catch (Exception ex) { db.RejectChanges(); showErrorMessage("An Error Occured.\n\nDetails:\n" + ex.Message); } }