Ejemplo n.º 1
0
        private void UpdateAndConnection()
        {
            try
            {
                ConnectionObject selectedConnectionObject = connectionObjectList.Where <ConnectionObject>(x => x.ConnectionId == Convert.ToString(updateComboBoxItem.Value)).FirstOrDefault();
                ControlAndFillConnectionObject();
                Result result = crmHelper.ControlMSCRMConnection(newConnectionObject);
                if (!result.IsSuccess)
                {
                    MessageBox.Show(result.Message);
                }
                else
                {
                    newConnectionObject.ConnectionId = selectedConnectionObject.ConnectionId;
                    connectionXmlHelper.UpdateConnection(newConnectionObject);

                    ImportExcelForm importExcelForm = new ImportExcelForm();
                    importExcelForm.Show();
                    this.Visible = false;
                }
            }
            catch (ToolExcepiton ex)
            {
                MessageBox.Show(ex.CustomMessage);
            }
        }
Ejemplo n.º 2
0
        private void NewConnection()
        {
            bool isSave = Save_Chk.Checked;

            try
            {
                ControlAndFillConnectionObject();

                Result result = crmHelper.ControlMSCRMConnection(newConnectionObject);
                if (!result.IsSuccess)
                {
                    MessageBox.Show(result.Message);
                }
                else
                {
                    if (isSave)
                    {
                        if (string.IsNullOrWhiteSpace(SystemName_txt.Text))
                        {
                            toolException.CustomMessage = "Kayıt Yapabilmek İçin Kayıt Adı Alanı Doldurulması Zorunludur.";
                            throw toolException;
                        }

                        connectionXmlHelper.AddNewConnection(newConnectionObject);
                    }
                    ImportExcelForm importExcelForm = new ImportExcelForm();
                    importExcelForm.Show();
                    this.Visible = false;
                }
            }
            catch (ToolExcepiton ex)
            {
                MessageBox.Show(ex.CustomMessage);
            }
        }