Exemple #1
0
        public void SaveChanges()
        {
            issueBindingSource.EndEdit();
            var newIssueNo = InventoryHelper.GetNextIssueNo();

            issue.IssueNo  = newIssueNo;
            issue.StatusId = InventoryHelper.STATUS_PENDING;

            try
            {
                context.Issues.AddObject(issue);
                context.SaveChanges();
                var obj = context.Issues.Single(i => i.IssueNo == newIssueNo);
                this.IssueId      = obj.IssueId;
                this.DialogResult = DialogResult.OK;
                InventoryHelper.UpdateIssueNo(newIssueNo);
            }
            catch (Exception exception)
            {
                ViewHelper.ShowErrorMessage("Error saving new issue record.", exception);
            }
        }
Exemple #2
0
 public void ShowObject(object keyValue)
 {
     issue         = new Issue();
     issue.IssueNo = InventoryHelper.GetNextIssueNo();
     issueBindingSource.DataSource = issue;
 }