Пример #1
0
        /// <summary>
        /// Logic to save customer record
        /// </summary>
        private void SaveCustomer(bool IsNew)
        {
            if (!this.ValidateEntries())
                return;

            ObjectCustomer.CustomerInstance objParams = new ObjectCustomer.CustomerInstance();

            objParams.id = intCustomerId;
            objParams.customer_name = txtName.Text;
            objParams.org_no = txtOrgNo.Text;
            objParams.reference_no = txtReferenceNo.Text;
            objParams.active = chkActive.Checked;
            objParams.owner_name = txtOwner.Text;
            objParams.address = txtAddress.Text;
            objParams.description = txtDescription.Text;

            ObjectCustomer.SaveCustomer(IsNew, objParams);
            m_objParentControl.PopulateCustomerView();

            MessageBox.Show("Successfully updated!", m_MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.ParentForm.Close();
        }
Пример #2
0
 /// <summary>
 /// Constructor to initialize save type and the customer data object to edit
 /// </summary>
 public AddCustomer(SaveType eSaveType, ObjectCustomer.CustomerInstance objCustomer)
 {
     InitializeComponent();
     m_objCustomer = objCustomer;
     m_eSaveType = eSaveType;
 }
Пример #3
0
        /// <summary>
        /// Sets the focused view instance of the grid. Instantiates the objects that can be used for data manipulation.
        /// Where gcCustomer, is the current selected object in the grid view
        /// </summary>
        private void SetFocusedViewInstance()
        {
            m_objGridView = null;
            m_objCustomer = null;
            m_objCampaign = null;

            m_objGridView = (DevExpress.XtraGrid.Views.Grid.GridView) gcCustomer.FocusedView;
            m_objCustomer = (ObjectCustomer.CustomerInstance) m_objGridView.GetFocusedRow();

            m_objGridView = (DevExpress.XtraGrid.Views.Grid.GridView) gcCustomerCampaign.FocusedView;
            m_objCampaign = (ObjectCampaign.CampaignInstance) m_objGridView.GetFocusedRow();
        }