コード例 #1
0
        private void AddUnusualRule(unusual_payment_rules toLoad)
        {
            int top = 20;

            if (_lastControl != null)
            {
                top = _lastControl.Bottom + 4;
            }
            ctlUnusualPaymentRule toAdd = new ctlUnusualPaymentRule();

            toAdd.AutoSave    = true;
            toAdd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            toAdd.LinkedRule  = null;
            toAdd.Location    = new System.Drawing.Point(6, top);
            toAdd.Name        = "ctlUnusualPaymentRuleAddNew";
            toAdd.OrderID     = toLoad.order_id;
            toAdd.Size        = new System.Drawing.Size(529, 25);
            toAdd.TabIndex    = toLoad.order_id;
            toAdd.Deleted    += toAdd_Deleted;
            grpExistingRules.Controls.Add(toAdd);

            toAdd.LinkedRule = toLoad;



            _lastControl = toAdd;
        }
コード例 #2
0
 public void Clear()
 {
     _loading            = true;
     _linkedRule         = null;
     txtProcessCode.Text = "";
     cmbAmountTypeDropdown.SelectedIndex = 0;
     cmbOperatorDropDown.SelectedIndex   = 0;
     nmbAmount.Value = 0;
     _loading        = false;
 }
コード例 #3
0
        private void LoadPaymentRules()
        {
            grpExistingRules.Controls.Clear();

            unusual_payment_rules toLoad = new unusual_payment_rules();

            DataTable allRules = toLoad.Search(toLoad.SearchSQL + " ORDER BY order_id");

            foreach (DataRow aRow in allRules.Rows)
            {
                toLoad.Load(aRow);
                AddUnusualRule(toLoad);
            }
        }
コード例 #4
0
        public void Save()
        {
            if (_linkedRule == null)
            {
                _linkedRule = new unusual_payment_rules();
            }
            _linkedRule.amount           = nmbAmount.Value;
            _linkedRule.amount_type_code = (unusual_payment_rules.AmountTypeCodes)cmbAmountTypeDropdown.SelectedIndex;
            _linkedRule.operator_code    = (unusual_payment_rules.OperatorCodes)cmbOperatorDropDown.SelectedIndex;
            _linkedRule.order_id         = _orderID;
            _linkedRule.process_code     = txtProcessCode.Text.Trim();

            _linkedRule.Save();
        }
コード例 #5
0
        public void LoadRule(unusual_payment_rules Linked_Rule)
        {
            _loading    = true;
            _linkedRule = Linked_Rule;

            if (_linkedRule != null)
            {
                nmbAmount.Value = _linkedRule.amount;
                cmbAmountTypeDropdown.SelectedIndex = (int)_linkedRule.amount_type_code;
                cmbOperatorDropDown.SelectedIndex   = (int)_linkedRule.operator_code;
                _orderID            = _linkedRule.order_id;
                txtProcessCode.Text = _linkedRule.process_code;
            }
            _loading = false;
        }