Exemplo n.º 1
0
        public void SaveChanges()
        {
            receivingBindingSource.EndEdit();
            var newGrn = InventoryHelper.GetNextGrnNo();

            receiving.GRN      = newGrn;
            receiving.StatusId = InventoryHelper.STATUS_PENDING;

            try
            {
                context.Receivings.AddObject(receiving);
                context.SaveChanges();
                var obj = context.Receivings.Single(r => r.GRN == newGrn);
                this.NewReceivingId = obj.ReceivingId;
                this.DialogResult   = DialogResult.OK;
                InventoryHelper.UpdateGRNumber(newGrn);
            }
            catch (Exception exception)
            {
                ViewHelper.ShowErrorMessage("Error saving new receiving record.", exception);
            }
        }
Exemplo n.º 2
0
 public void ShowObject(object keyValue)
 {
     receiving     = new Receiving();
     receiving.GRN = InventoryHelper.GetNextGrnNo();
     receivingBindingSource.DataSource = receiving;
 }