private void DeleteSB_Click(object sender, EventArgs e) { WareRemainsLogic remains = new WareRemainsLogic(manager); remains.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); manager.Save(); Fill(); }
public int Create(WareDocument document, int WareID, decimal UnitQuantity, decimal?SecondaryUnitQuantity, decimal PriceForUnit, decimal?DiscountForUnit, decimal?EndPriceForUnit, decimal EndPrice, int CurrencyID) { int result = 1; int userId = Compas.Logic.Security.CurrentSecurityContext.Identity.ID; WareDocumentDetail sr = new WareDocumentDetail(); sr.WareID = WareID; sr.UnitQuantity = UnitQuantity; if (SecondaryUnitQuantity != null) { sr.SecondaryUnitQuantity = Convert.ToDecimal(SecondaryUnitQuantity); } sr.DiscountForUnit = DiscountForUnit; sr.CurrencyID = CurrencyID; context.AddToWareDocumentDetails(sr); WareRemainsLogic remainsLogic = new WareRemainsLogic(manager); //remainsLogic.UpdateCurrentRemainByDocumentDetail(sr); return(result); }
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 DeleteSB_Click(object sender, EventArgs e) { WareRemainsLogic remains = new WareRemainsLogic(manager); remains.Delete(Convert.ToInt32(DataGV.SelectedRows[0].Cells["ID"].Value)); manager.Save(); Fill(); }
private void RecalculateSB_Click(object sender, EventArgs e) { WareRemainsLogic remains = new WareRemainsLogic(manager); if (universalFilter1.StartDate != null) { DialogResult result = MessageBox.Show(this, "Виконати перерахунок залишків починаючи з " + universalFilter1.StartDate.ToString() + "?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { remains.Recalculate(Convert.ToDateTime(universalFilter1.StartDate)); manager.Save(); Fill(); } } else { MessageBox.Show("Не задана початкова дата, перерахунок НЕ виконано"); } }
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 RecalculateSB_Click(object sender, EventArgs e) { WareRemainsLogic remains = new WareRemainsLogic(manager); if (universalFilter1.StartDate != null) { DialogResult result = MessageBox.Show(this, "Виконати перерахунок залишків починаючи з " + universalFilter1.StartDate.ToString() + "?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { remains.Recalculate(Convert.ToDateTime(universalFilter1.StartDate)); manager.Save(); Fill(); } } else { MessageBox.Show("Не задана початкова дата, перерахунок НЕ виконано"); } }