Exemple #1
0
        private void linkDispoInfo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var disposal = _asset.Disposals.FirstOrDefault();

            if (disposal != null)
            {
                var disposalForm = new AssetDisposal();
                disposalForm.ShowObject(disposal);
                var val = disposalForm.ShowDialog();
            }
        }
Exemple #2
0
        private void DisposeAsset()
        {
            var result = ViewHelper.ShowConfirmDialog("Are you sure you want to dispose this Asset ?");

            if (result == DialogResult.Yes)
            {
                var disposal = new Disposal()
                {
                    AssetId = _asset.AssetId
                };
                var disposalForm = new AssetDisposal();
                disposalForm.ShowObject(disposal);
                var val = disposalForm.ShowDialog();
                if (val == DialogResult.OK)
                {
                    if (DataChanged())
                    {
                        var res =
                            ViewHelper.ShowConfirmDialog("you haven't saved some asset information.Do you want to save ?");
                        if (res == DialogResult.Yes)
                        {
                            SaveChanges();
                            this.Close();
                            return;
                        }
                        else
                        {
                            this.Close();
                            return;
                        }
                    }
                    else
                    {
                        this.Close();
                        return;
                    }
                }
            }
        }