private void RecalcRemainsAllMatBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { String errRECALC = ""; for (int i = 0; WhMatGridView.RowCount > i; ++i) { var row = WhMatGridView.GetRow(i) as WhMatGet_Result; try { DB.SkladBase().RecalcRemainsMat(row.MatId); } catch { errRECALC += row.MatName + ", "; } } if (errRECALC != "") { MessageBox.Show("Не вдалось перерахувати залишки по деяким позиціям: " + errRECALC); } else { MessageBox.Show("Залишки по всім позиціям перераховано!"); } RefreshWhBtn.PerformClick(); }
private void DeboningMatBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (focused_wh_mat == null) { return; } var rec = DB.SkladBase().MatRecipe.FirstOrDefault(w => w.MatId == focused_wh_mat.MatId && w.RType == 2); var wh_remain = WhRemainGridView.GetFocusedRow() as MatRemainByWh_Result; if (rec != null) { using (var f = new frmWBDeboning() { rec_id = rec.RecId, source_wid = wh_remain.WId }) { f.ShowDialog(); } RefreshWhBtn.PerformClick(); } else { MessageBox.Show("Не можливо виконати овалку, не знайдено рецепт!"); } }
private void RecalcRemainsMatBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { using (var db = DB.SkladBase()) { db.DeleteWhere <PosRemains>(w => w.MatId == focused_wh_mat.MatId); var pos = db.WMatTurn.Where(w => w.MatId == focused_wh_mat.MatId).OrderBy(o => o.OnDate).Select(s => new { s.PosId, s.WId, s.OnDate }).ToList().Distinct(); foreach (var item in pos) { db.SP_RECALC_POSREMAINS(item.PosId, focused_wh_mat.MatId, item.WId, item.OnDate, 0); } db.SaveChanges(); } // DB.SkladBase().RecalcRemainsMat(focused_wh_mat.MatId); RefreshWhBtn.PerformClick(); }
private void ShowAllItemsCheck_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { RefreshWhBtn.PerformClick(); }
private void ShowEmptyItemsCheck_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { RefreshWhBtn.PerformClick(); }