コード例 #1
0
        /////////////////////////////////////////////////////////////////
        ////////////// Data validation & form control ///////////////////
        /////////////////////////////////////////////////////////////////

        void EditEnabled(EditEnabledArgs args)
        {
            button1.Enabled  = args.Edit;
            button10.Enabled = args.Edit;
            button11.Enabled = args.Edit;

            button2.Enabled = args.Delete;
            button8.Enabled = args.Delete;
            button9.Enabled = args.Delete;

            button3.Enabled = args.Add;
            button6.Enabled = args.Add;
            button7.Enabled = args.Add;


            button4.Enabled = args.Confirm;
            button5.Enabled = args.Cancel;

            for (int i = 0; i < _userEntryProducts.Count; i++)
            {
                _userEntryProducts[i].Enabled = args.Products;
            }

            departmentsCombo.Enabled = args.Products;
            textBox7.Enabled         = args.Barcode;
            textBox8.Enabled         = args.Barcode;
            textBox9.Enabled         = args.Suppliers;
            textBox10.Enabled        = args.Suppliers;
            textBox11.Enabled        = args.Suppliers;
        }
コード例 #2
0
 void ButtonPressedActions(EditEnabledArgs eea, int actionInt, string status)
 {
     EditEnabled(eea);
     action      = actionInt;
     label1.Text = status;
 }