示例#1
0
 /// <summary>
 /// Constructor to initialize save type and the sub campaign data object to edit
 /// </summary>
 public AddSubCampaign(SaveType eSaveType, ObjectSubCampaign.SubCampaignInstance objSubCampaign)
 {
     InitializeComponent();
     m_objSubCampaign = objSubCampaign;
     m_eSaveType = eSaveType;
 }
示例#2
0
        /// <summary>
        /// Sets the focused view instance of the grid. Instantiates the objects that can be used for data manipulation.
        /// </summary>
        private void SetFocusedViewInstance(eGridViewType GridViewType)
        {
            m_objGridView = null;
            switch (GridViewType)
            {
                case eGridViewType.SubCampaign:
                {
                    m_objSubCampaign = null;
                    m_objGridView = gcSubCampaign.FocusedView as GridView;
                    m_objSubCampaign = m_objGridView.GetFocusedRow() as ObjectSubCampaign.SubCampaignInstance;
                    if (m_objSubCampaign != null && !m_OnEditMode)
                        SelectedSubCampaignId = m_objSubCampaign.id;
                    break;
                }

                case eGridViewType.SubCampaignInternalUser:
                {
                    m_objSubCampaignInternalUser = null;
                    m_objGridView = (DevExpress.XtraGrid.Views.Grid.GridView)gcInternalUser.FocusedView;
                    m_objSubCampaignInternalUser = (CTSubCampaignInternalUsers)m_objGridView.GetFocusedRow();
                    break;
                }

                case eGridViewType.SubCampaignCustomerUser:
                {
                    m_objSubCampaignCustomerUser = null;
                    m_objGridView = (DevExpress.XtraGrid.Views.Grid.GridView)gcCustomerUser.FocusedView;
                    m_objSubCampaignCustomerUser = (CTSubCampaignCustomerUsers)m_objGridView.GetFocusedRow();
                    break;
                }

                case eGridViewType.SubCampaignUserRole:
                {
                    m_objSubCampaignUserRole = null;
                    //m_objGridView = (GridView) gcUserRole.FocusedView;
                    //m_objSubCampaignUserRole = (CTSubCampaignUserRole) m_objGridView.GetFocusedRow();
                    break;
                }
            }
        }
示例#3
0
        /// <summary>
        /// Logic to save campaign record
        /// </summary>
        private void SaveSubCampaign(bool IsNew)
        {
            if (!this.ValidateEntries())
                return;

            WaitDialog.Show(ParentForm, "Saving data...");
            ObjectSubCampaign.SubCampaignInstance objParams = new ObjectSubCampaign.SubCampaignInstance();

            if (m_objSubCampaign != null)
                objParams.id = m_objSubCampaign.id;

            objParams.sub_campaign_name = txtName.Text;
            objParams.campaign_id = (int)cboCampaign.EditValue;
            objParams.customer_id = (int)cboCustomer.EditValue;
            objParams.owner_id = (int)cboOwner.EditValue;
            objParams.list_id = 0; //todo: implement this later if finalized -> objParams.list_id = (int) cboList.SelectedValue;
            objParams.start_date = Convert.ToDateTime(dpStartDate.EditValue);
            objParams.end_date = Convert.ToDateTime(dpEndDate.EditValue);
            objParams.sub_campaign_priority = Convert.ToInt32(cboPriority.Text);
            objParams.sub_campaign_status = cboStatus.Text;
            objParams.description = txtDescription.Text;
            m_objParentControl.SelectedSubCampaignId = ObjectSubCampaign.SaveSubCampaign(IsNew, objParams);
            m_objParentControl.PopulateSubCampaignView();

            WaitDialog.Close();
            MessageBox.Show("Successfully updated!", m_MessageBoxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.ParentForm.Close();
        }