コード例 #1
0
        public static Service AddItem()
        {
            var addDialog = new AddEditServiceForm(new Service());

            if (addDialog.ShowDialog() == DialogResult.OK)
            {
                return(addDialog.Service);
            }

            return(null);
        }
コード例 #2
0
        public static Service EditItem(Service serviceToEdit)
        {
            if (serviceToEdit == null)
            {
                return(null);
            }

            var addDialog = new AddEditServiceForm(serviceToEdit);

            if (addDialog.ShowDialog() == DialogResult.OK)
            {
                return(addDialog.Service);
            }

            return(null);
        }