Example #1
0
        public SelectView_Form(Form xParentForm, SQLTable xTbl, TableDockingFormXml xTableDockingFormXml, ViewXml CurrentViewXml, xml myXml,FormMode mode)
        {
            m_mode = mode;
            m_ParentForm = xParentForm;
            this.Owner = xParentForm;
            this.Icon = CodeTables.Properties.Resources.SelectViewIcon;
            m_xml = myXml;
            m_CurrentViewXml = CurrentViewXml;
            m_tbl = xTbl;
            m_TableDockingFormXml = xTableDockingFormXml;
            InitializeComponent();

            if (m_mode == FormMode.SELECT)
            {
                this.Text = lngRPM.s_SelectViewForTable.s + m_tbl.lngTableName.s;
                chkBoxSetAsDefault.Visible = true;
                this.btn_Select.Text = lngRPM.s_Select.s;
                this.btn_Cancel.Text = lngRPM.s_Cancel.s;
            }
            else
            {
                this.Text = lngRPM.s_DeleteViewForTable.s + m_tbl.lngTableName.s;
                chkBoxSetAsDefault.Visible = false;
                this.btn_Select.Text = lngRPM.s_Delete.s;
                this.btn_Cancel.Text = lngRPM.s_Close.s;
            }
            this.chkBoxSetAsDefault.Text = lngRPM.s_SelectAsDefaultView.s;
            lnlViewName.Text = lngRPM.s_SelectedView.s;
            foreach (ViewXml xViewXml in m_TableDockingFormXml.m_ViewXml)
            {
                this.rdblist_Views.Items.Add(xViewXml);
            }
        }
        private IEnumerable <CrmOperation> generateOperationCurrentSheet(ExcelSheetInfo currentSheet)
        {
            ExcelMatrix matrix;

            switch (currentSheet.sheetType)
            {
            case ExcelSheetInfo.ExcelSheetType.attribute:
                matrix = GlobalOperations.Instance.ExcelOperations.getExcelDataMatrix(currentSheet.excelsheet, ExcelColumsDefinition.MAXNUMBEROFCOLUMN, ExcelColumsDefinition.MAXNUMBEROFATTRIBUTE, ExcelColumsDefinition.SCHEMANAMEEXCELCOL);
                AttributeRequestGenerator reqGeneratorHelper = new AttributeRequestGenerator((AttributeExcelSheetsInfo)currentSheet, GlobalApplicationData.Instance.optionSetData);
                return(reqGeneratorHelper.generateCrmOperationRequest(matrix));

            case ExcelSheetInfo.ExcelSheetType.optionSet:
                matrix = GlobalOperations.Instance.ExcelOperations.getExcelDataMatrix(currentSheet.excelsheet, ExcelColumsDefinition.MAXNUMBEROFCOLUMN, ExcelColumsDefinition.MAXNUMBEROFATTRIBUTE, ExcelColumsDefinition.OPTIONSETVALUEEXCELCOL);
                OptionSetRequestGenerator optGenerator = new OptionSetRequestGenerator((OptionSetExcelSheetsInfo)currentSheet);
                return(optGenerator.generateCrmOperationRequest(matrix));

            case ExcelSheetInfo.ExcelSheetType.entity:
                matrix = GlobalOperations.Instance.ExcelOperations.getExcelDataMatrix(currentSheet.excelsheet, ExcelColumsDefinition.MAXNUMBEROFCOLUMN, ExcelColumsDefinition.MAXNUMBEROFATTRIBUTE, ExcelColumsDefinition.ENTITYSCHEMANAMEEXCELCOL);
                EntityRequestGenerator entGenerator = new EntityRequestGenerator((EntityExcelSheetsInfo)currentSheet);
                return(entGenerator.generateCrmOperationRequest(matrix));

            case ExcelSheetInfo.ExcelSheetType.view:
                MessageBox.Show("The view editor feature is released as Alpha Version. Please ensure to back up your CRM solution and report any issue on Codeplex project page.");
                matrix = GlobalOperations.Instance.ExcelOperations.getExcelDataMatrix(currentSheet.excelsheet, ExcelColumsDefinition.MAXNUMBEROFCOLUMN, ExcelColumsDefinition.MAXNUMBEROFATTRIBUTE, ExcelColumsDefinition.VIEWATTRIBUTENAME);
                return(ViewXml.generateCrmOperationRequest(matrix, (ViewExcelSheetsInfo)currentSheet));

            case ExcelSheetInfo.ExcelSheetType.form:
                MessageBox.Show("Forms are read only");
                this.Close();
                return(new List <CrmOperation>());
            }
            return(null);
        }
Example #3
0
        protected override void OnSelectionAction(Microsoft.ManagementConsole.Action action, AsyncStatus status)
        {
            ProfileDb selProfile = (ProfileDb)this.SelectedNodes[0].Tag;

            switch ((string)action.Tag)
            {
            case "EditProfile":
                EditProfile editProfile = new EditProfile(selProfile.profile, false);
                if (this.SnapIn.Console.ShowDialog(editProfile) == DialogResult.OK)
                {
                    // Save the profile to the profiles directory
                    editProfile.profile.SaveXml(caInfo.ProfilesLocation);
                    Refresh();
                }
                break;

            case "ViewXMLProfile":
                ViewXml view = new ViewXml(selProfile.file);
                this.SnapIn.Console.ShowDialog(view);
                break;

            case "CopyProfile":
                EditProfile copyProfile = new EditProfile(selProfile.profile, true);
                if (this.SnapIn.Console.ShowDialog(copyProfile) == DialogResult.OK)
                {
                    // Save the profile to the profiles directory
                    copyProfile.profile.SaveXml(caInfo.ProfilesLocation);

                    // Update
                    caInfo.RefreshProfiles();
                    Refresh();
                }
                break;

            case "DeleteProfile":
                DialogResult result = MessageBox.Show("Delete: " + selProfile.profile.Name, "Delete Profile", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    caInfo.RemoveProfile(selProfile);
                    Refresh();
                }
                break;
            }
        }
Example #4
0
        private bool FindView(ref int Index, ViewXml xViewXmlToFind)
        {
            if (m_TableDockingFormXml.m_ViewXml != null)
            {
                int i = 0;
                int iCount = m_TableDockingFormXml.m_ViewXml.Count();
                for (i = 0; i < iCount; i++)
                {

                    if (m_TableDockingFormXml.m_ViewXml[i].Name.Equals(xViewXmlToFind.Name))
                    {
                        Index = i;
                        return true;
                    }
                }
            }
            return false;
        }
Example #5
0
        public TableView_Form(int iIndex, DBTableControl dbTables, SQLTable tbl, TableDockingForm dtF, ViewXml xViewXml)
        {
            m_Index = iIndex;
            m_DBTables = dbTables;
            m_tbl = tbl;
            m_TableDockingForm = dtF;
            m_ViewXml = xViewXml;
            m_pTableDockingFormXml = m_DBTables.m_xml.GetTableDockingFormXml(m_tbl.TableName);
            if (m_pTableDockingFormXml.m_TableViewFormXml[iIndex] == null)
            {
                m_pTableDockingFormXml.m_TableViewFormXml[iIndex] = new TableViewFormXml();
            }
            m_pTableDockingFormXml.m_TableViewFormXml[iIndex].m_DefaultViewXml = xViewXml;
            InitializeComponent();

            dataGridView_Table.ReadOnly = true;

            tsmi_Select_View.Text = lngRPM.s_SelectView.s;
            this.Text = lngRPM.s_View.s + " " + m_Index.ToString() + "   " + m_tbl.lngTableName.s;
            //            this.Text = m_tbl.lngTableName.s + " " + lngRPM.s_View.s + ":" + m_ViewXml.Name;
            string csError = "";
            this.label_PrimaryView.Text = lngRPM.s_PrimaryView.s;
            this.label_ViewName.Text = lngRPM.s_View.s;
            chkBox_BindWith_EditTable_Form.Text = lngRPM.s_ConnectWithEditTableForm.s;
            FillDataTable(ref csError);
        }
Example #6
0
 private void tsmi_Select_View_Click(object sender, EventArgs e)
 {
     SelectView_Form SelectView_FormDialog = new SelectView_Form(this, m_tbl, m_pTableDockingFormXml, m_ViewXml, m_DBTables.m_xml, SelectView_Form.FormMode.SELECT);
     if (SelectView_FormDialog.ShowDialog() == DialogResult.OK)
     {
         m_ViewXml = SelectView_FormDialog.m_ViewXml_Selected;
         string csError = "";
         if (SelectView_FormDialog.bDefaultView)
         {
             m_pTableDockingFormXml.m_TableViewFormXml[m_Index].m_DefaultViewXml = SelectView_FormDialog.m_ViewXml_Selected;
             m_pTableDockingFormXml.m_TableViewFormXml[m_Index].sDefaultView = SelectView_FormDialog.m_ViewXml_Selected.Name;
         }
         FillDataTable(ref csError);
     }
 }