Exemple #1
0
        private void EditMaterialBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (iw_det_row != null && _db.GetWayBillMakeDet(iw_det_row.WbillId).Any(a => a.MatId == iw_det_row.MatId && a.Rsv == 0))
            {
                using (var f = new frmIntermediateWeighingDet(_db, iw_det_row.Id, iw))
                {
                    f.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Редагувати заборонено, сировина вже зарезервована");
            }

            RefreshDet();
        }
Exemple #2
0
        private void barButtonItem2_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            _db.SaveChanges();

            var total            = _db.IntermediateWeighing.Where(w => w.WbillId == iw.WbillId).Sum(s => s.Amount);
            var amount_by_recipe = _db.WayBillMake.FirstOrDefault(w => w.WbillId == iw.WbillId).AmountByRecipe;

            if ((total ?? 0) > (amount_by_recipe ?? 0))
            {
                MessageBox.Show("Вага закладок по виробництву більша запланованої");

                return;
            }


            using (var f = new frmIntermediateWeighingDet(_db, Guid.NewGuid(), iw))
            {
                f.ShowDialog();
            }

            RefreshDet();
        }