コード例 #1
0
        protected override Entity OnAdd()
        {
            var newItem = new Position();

            using (var frm = new frmPosition_Add())
            {
                frm.ItemData = newItem;
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return(null);
                }
            }

            App.LogAction("Payroll Position", "Created Position: " + newItem.Description);

            ItemDataCollection.Add(newItem);
            return(newItem);
        }
コード例 #2
0
        protected override bool OnEdit(Entity item)
        {
            var selectedItem = (Position)item;

            using (var frm = new frmPosition_Add())
            {
                if (selectedItem.Id != 0)
                {
                    selectedItem.RowStatus = RecordStatus.ModifiedRecord;
                }
                frm.ItemData = selectedItem;
                if (frm.ShowDialog() != DialogResult.OK)
                {
                    return(false);
                }
            }

            App.LogAction("Payroll Position", "Updated Position: " + selectedItem.Description);

            return(true);
        }