private void Fill() { manager = new ContextManager(); WareRemainsLogic remains = new WareRemainsLogic(manager); DataGV.AutoGenerateColumns = false; int? structureObjectId = null; int? wareCategoryId = null; int? wareId = null; string wareCode = ""; DateTime?startDate = null; DateTime?endDate = null; structureObjectId = universalFilter1.StructureObjectID; wareCategoryId = universalFilter1.WareCategoryID; wareId = universalFilter1.WareID; startDate = universalFilter1.StartDate; endDate = universalFilter1.EndDate; List <RemainView> result = remains.GetAllView(structureObjectId, wareId, startDate, endDate, wareCategoryId); DataGV.DataSource = result.OrderByDescending(a => a.StartDate).ToList(); DataGV.Update(); }
private void Fill() { DocumentPaymentsLogic payments = new DocumentPaymentsLogic(manager); DataGV.AutoGenerateColumns = false; ListToDataTable listToDataTable = new ListToDataTable(); List <ViewPayment> paymentsList = new List <ViewPayment>(); if (documentId == null) { paymentsList = payments.GetAllViewByPeriod(StartDateDTP.Value, EndDateDTP.Value); } else { paymentsList = payments.GetAllViewByDocumentID(Convert.ToInt32(documentId)); StartDateDTP.Enabled = false; EndDateDTP.Enabled = false; } DataGV.DataSource = listToDataTable.ToDataTable <ViewPayment>(paymentsList); DgvFilterManager filterManager = new DgvFilterManager(DataGV); DataGV.Update(); SummaryDataGV.AutoGenerateColumns = true; var groupResult = from p in paymentsList group p by new { p.FullEmployeeName, p.PaymentTypeName } into myGroup where myGroup.Count() > 0 select new { myGroup.Key.FullEmployeeName, myGroup.Key.PaymentTypeName, Count = myGroup.Count(), Suma = myGroup.Sum(a => a.Suma) }; SummaryDataGV.DataSource = groupResult.ToList(); SummaryDataGV.Update(); }
private void Fill() { StaffEmployeeSalariesLogic salariesLogic = new StaffEmployeeSalariesLogic(manager); DataGV.AutoGenerateColumns = false; if (employeeId != null) { DataGV.DataSource = salariesLogic.GetViewByEmployeeID(Convert.ToInt32(employeeId)); } else { DataGV.DataSource = salariesLogic.GetView(); } StaffEmployeeLogic employees = new StaffEmployeeLogic(manager); if (employeeId != null) { StaffEmployee employee = employees.Get(Convert.ToInt32(employeeId)); EmployeeL.Text = employee.LastName + " " + employee.FirstName + " " + employee.MiddleName; } else { EmployeeL.Text = "Всі працівники"; } DataGV.Update(); }
private void DataGV_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { DataGridView.HitTestInfo hti = DataGV.HitTest(e.X, e.Y); if (hti.Type == DataGridViewHitTestType.RowHeader || hti.Type == DataGridViewHitTestType.Cell) { DataGV.CurrentCell = DataGV.Rows[hti.RowIndex].Cells[0]; if (e.Button == System.Windows.Forms.MouseButtons.Right) { DataGV.CurrentCell = DataGV.Rows[hti.RowIndex].Cells[0]; DataGVContextMenu.Show(this, e.Location); } string oGuid = DataGV.CurrentRow.Cells["Guid"].Value.ToString(); Helper.ZoomWindowAndHilight(oGuid); if (Helper._CurrentIndex != hti.RowIndex) { BtnUndo.Enabled = false; Helper._CurrentIndex = hti.RowIndex; } } }
private void FillGrid() { ContextManager manager = new ContextManager(); StaffStructureObjectsLogic StructureObjects = new StaffStructureObjectsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = StructureObjects.GetAll(); BindingSource bs = new BindingSource(); //bs.DataSource = StructureObjects.GetAll().Select(x => new { // x.ID, // x.Name, // x.Active, // x.AllowServices, // ParrentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name) // }); bs.DataSource = StructureObjects.GetHeirarchyView(); DataGV.DataSource = bs; //ataGridView1.DataSource = StructureObjects.GetAll();//.Select(x => new { x.ID, x.Name, x.Active, x.AllowServices, ParrentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name) }); //foreach (var a in StructureObjects.GetAll().Select(x => new { x.ID, x.Name, x.Active, x.AllowServices, ParentStructureObjectName = (x.StaffStructureObject1 == null ? "" : x.StaffStructureObject1.Name) })) //{ // MessageBox.Show(a.ParentStructureObjectName /* + (a.StaffStructureObject1 == null ? "" : a.StaffStructureObject1.Name)*/); //} DataGV.Update(); manager.CloseContext(); }
private void Fill() { ContractorsLogic contractors = new ContractorsLogic(manager); DataGV.AutoGenerateColumns = false; List <Contractor> resultA = contractors.GetAll(); List <ContractorView> contractorsView = new List <ContractorView>(); foreach (Contractor a in resultA) { ContractorView c = new ContractorView(a, manager); contractorsView.Add(c); } view = new SortableBindingList <ContractorView>(contractorsView); DataGV.DataSource = view; DataGV.AutoResizeRows(); DataGV.Update(); PersonCB.SelectedIndex = 0; ContractorTypesDDL.Items.Clear(); ContractorTypesLogic types = new ContractorTypesLogic(manager); ContractorTypesDDL.DisplayMember = "Name"; ContractorTypesDDL.ValueMember = "ID"; ContractorType all = new ContractorType(); all.ID = -1; all.Name = " - всі - "; ContractorTypesDDL.Items.Add(all); foreach (var a in types.GetAll()) { ContractorTypesDDL.Items.Add(a); } ContractorTypesDDL.SelectedIndex = 0; }
/// <summary> /// Заповнення таблиці працівників для відображення /// </summary> private void FillGrid() { manager = new ContextManager(); DataGV.Rows.Clear(); StaffEmployeeLogic employees = new StaffEmployeeLogic(manager); DataGV.AutoGenerateColumns = false; int enterpriseId; int?StructureObjectId = null; if (StructureObjectsCB.SelectedIndex > 0) { StructureObjectId = Convert.ToInt32(StructureObjectsCB.SelectedValue); } BindingSource bs = new BindingSource(); StaffEmployeePositionsLogic employeePositions = new StaffEmployeePositionsLogic(manager); //bs.DataSource = employees.GetAll(enterpriseId); if (StructureObjectId != null) { bs.DataSource = employeePositions.GetAll(StructureObjectId); } else { bs.DataSource = employees.GetAll(); } DataGV.DataSource = bs; DataGV.Update(); DataGV.Refresh(); }
private void ketnoidata() { DataGV.Dgv = dataGridView1; dataGridView1.DataSource = DataGV.ketnoidata(); DataGV.Dgv = dataGridView1; }
private void Fill() { ContractorTypesLogic types = new ContractorTypesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = types.GetAll(); DataGV.Update(); }
private void Fill() { StaffShiftsLogic shifts = new StaffShiftsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = shifts.GetAll(); DataGV.Update(); }
private void Fill() { EnterprisesLogic Enterprises = new EnterprisesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = Enterprises.GetAll(); DataGV.Update(); }
private void Fill() { WareExtrasLogic extras = new WareExtrasLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = extras.GetAll(); DataGV.Update(); }
private void Fill() { WareManufacturersLogic shifts = new WareManufacturersLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = shifts.GetAll(); DataGV.Update(); }
private void Fill() { WareDiscountRulesLogic rulesLogic = new WareDiscountRulesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = rulesLogic.GetAllByDiscountID(discountId); DataGV.Update(); }
private void Fill() { WareDiscountTypesLogic currencies = new WareDiscountTypesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = currencies.GetAll(); DataGV.Update(); }
private void Fill() { CWCarBrandsLogic brands = new CWCarBrandsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = brands.GetAll(); DataGV.Update(); }
private void Fill() { StaffPositionsLogic positions = new StaffPositionsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = positions.GetAll(); DataGV.Update(); }
private void Fill() { WareUnitsLogic units = new WareUnitsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = units.GetAll(); DataGV.Update(); }
private void Fill() { WarePriceGroupsLogic groups = new WarePriceGroupsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = groups.GetAll(); DataGV.Update(); }
private void Fill() { DocumentPaymentTypesLogic types = new DocumentPaymentTypesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = types.GetAll(); DataGV.Update(); }
private void Fill() { StaffTeamsLogic teams = new StaffTeamsLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = teams.GetByStructureObject(StructureObjectId); DataGV.Update(); }
private void Fill() { CWCategoriesLogic Categories = new CWCategoriesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = Categories.GetAll(); DataGV.Update(); }
private void FillFilter() { List <PricesView> viewList = new List <PricesView>(); viewList = view.Where(a => (universalFilter1.WareID == null || a.WareID == universalFilter1.WareID)).ToList(); SortableBindingList <PricesView> filteredView = new SortableBindingList <PricesView>(viewList); DataGV.DataSource = filteredView; DataGV.Update(); }
private void DataGV_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) { int index = e.RowIndex; if (index > 0) { DataGV.ClearSelection(); DataGV.Rows[index].Selected = true; } }
private void Fill(string columnName) { WaresLogic wares = new WaresLogic(manager); DataGV.AutoGenerateColumns = false; int?categoryId = null; int?manufacturerId = null; int?unitId = null; //string name = wareFilterUC1.WareName; categoryId = wareFilterUC1.CategoryID; manufacturerId = wareFilterUC1.ManufacturerID; unitId = wareFilterUC1.UnitID; BindingSource bs = new BindingSource(); var waresList = wares.GetAll("", categoryId, manufacturerId, unitId).Select(a => new { a.ID, Name = a.Name, UnitName = a.WareUnit != null ? a.WareUnit.Name : "", ManufacturerName = a.WareManufacturer != null ? a.WareManufacturer.Name : "", CategoryName = a.WareCategory != null ? a.WareCategory.Name : "", SecondaryUnitID = a.SecondaryUnitID != null ? a.SecondaryUnitID : null, SecondaryUnitName = a.WareUnit1 != null ? a.WareUnit1.Name : "", SecondaryUnitQuantity = a.SecondaryUnitQuantity != null ? a.SecondaryUnitQuantity : null, a.WareCodes });//.OrderBy(a => a.CategoryName).ThenBy(a=> a.Name).ToList(); List <WareView> viewList = new List <WareView>(); foreach (var a in waresList) { WareView wv = new WareView(); wv.ID = a.ID; wv.Name = a.Name; wv.CategoryName = a.CategoryName; wv.ManufacturerName = a.ManufacturerName; wv.UnitName = a.UnitName; wv.SecondaryUnitID = a.SecondaryUnitID; wv.SecondaryUnitName = a.SecondaryUnitName; wv.SecondaryUnitQuantity = a.SecondaryUnitQuantity; wv.WareCodes = a.WareCodes.ToList(); viewList.Add(wv); } //BindingListView<WareView> view = new BindingListView<WareView>(viewList); //bs.DataSource = view; //bs.Sort = columnName; view = new SortableBindingList <WareView>(viewList); DataGV.DataSource = view; DataGV.Update(); }
private void FillDataGV() { Compas.Logic.Config.ConfigurationParametersLogic configurationsLogic = new ConfigurationParametersLogic(manager); ListToDataTable listToDataTable = new ListToDataTable(); DataGV.AutoGenerateColumns = false; DataGV.DataSource = listToDataTable.ToDataTable <ViewConfigurationParameter>(configurationsLogic.GetAllView()); DgvFilterManager filterManager = new DgvFilterManager(DataGV); DataGV.Update(); }
private void Fill() { DataGV.Rows.Clear(); DataGV.ClearSelection(); FillCategoriesHierarchy(null, "", true); WareCategoriesLogic cl = new WareCategoriesLogic(manager); DataGV.AutoGenerateColumns = false; DataGV.DataSource = items;//cl.GetAll(); DataGV.Update(); }
private void Fill() { CWCarModelsLogic models = new CWCarModelsLogic(manager); DataGV.AutoGenerateColumns = false; if (brandId != null) { DataGV.DataSource = models.GetAll(Convert.ToInt32(brandId)); } else { DataGV.DataSource = models.GetAll(); } DataGV.Update(); }
private void Fill() { CardsLogic cardsLogic = new CardsLogic(manager); DataGV.AutoGenerateColumns = false; List <CardView> view = cardsLogic.GetAll().Select(a => new CardView(a)).ToList(); ListToDataTable listToDataTable = new ListToDataTable(); DataGV.DataSource = listToDataTable.ToDataTable <CardView>(view); DgvFilterManager filterManager = new DgvFilterManager(DataGV); DataGV.Update(); }
private void FillDataGV() { WareDiscountsLogic discounts = new WareDiscountsLogic(manager); DataGV.AutoGenerateColumns = false; int?discountTypeId = null; if (DiscountTypesCB.SelectedItem != null) { discountTypeId = Convert.ToInt32(DiscountTypesCB.SelectedValue); } bool?active = ActiveCB.Checked; DataGV.DataSource = discounts.GetAll(discountTypeId, active); DataGV.Update(); }