예제 #1
0
        private void btnDesignCRM_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (cmbCRM.SelectedIndex!= -1)
                {
                    if (cnv == null)
                    {
                        cnv = new Canvas();
                        cnv.Height = 768;
                        cnv.Width = 1024;
                        cnv.SetValue(Canvas.LeftProperty, 0.0);
                        cnv.SetValue(Canvas.TopProperty, 0.0);
                        cnvView.Children.Clear();
                        //objDesginer = new ctlCRMDesigner(((ListBoxItem)(cmbCRM.SelectedItem)).Content.ToString());
                        objDesginer = new ctlCRMDesigner(((ListBoxItem)(cmbCRM.SelectedItem)).Tag.ToString());
                        //objDesginer = new ctlCRMDesigner(cmbCRM.SelectedItem.ToString());
                        //objDesginer.GetQuestions();
                        cnv.Children.Add(objDesginer);
                        cnvView.Children.Add(cnv);
                    }
                    else
                    {
                        cnv.Children.Clear();
                        cnv.Height = 768;
                        cnv.Width = 1024;
                        cnv.SetValue(Canvas.LeftProperty, 0.0);
                        cnv.SetValue(Canvas.TopProperty, 0.0);
                        //cnvView.Children.Clear();

                        //objDesginer = new ctlCRMDesigner(((ListBoxItem)(cmbCRM.SelectedItem)).Content.ToString());
                        objDesginer = new ctlCRMDesigner(((ListBoxItem)(cmbCRM.SelectedItem)).Tag.ToString());

                        //objDesginer = new ctlCRMDesigner(cmbCRM.SelectedItem.ToString());
                        //objDesginer.GetQuestions();
                        cnv.Children.Add(objDesginer);
                        cnvView.Children.Add(cnv);
                    }
                }
                else
                {
                    MessageBox.Show("Please Select any CRM Name");
                }
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "btnDesignCRM_Click()", "CtlCRM.xaml.cs");
            }
        }
        private void btnDesigner_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (cmbScript.Items.Count > 0)
                {
                    if (cmbScript.SelectedItem != null)
                    {
                        if (cnv == null)
                        {
                            cnv = new Canvas();

                            tbc = new TabControl();
                            
                            tbc.Height = 768;
                            tbc.Width = 1024;
                            tbc.SetValue(Canvas.LeftProperty, 0.0);
                            tbc.SetValue(Canvas.TopProperty, 0.0);

                            cnv.Height = 768;
                            cnv.Width = 1024;
                            cnv.SetValue(Canvas.LeftProperty, 0.0);
                            cnv.SetValue(Canvas.TopProperty, 0.0);
                            //ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            //ctlDesigner = new ctlCRMDesigner.FunCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());

                            ctlDesigner.SctiptID = int.Parse(((ListBoxItem)(cmbScript.SelectedItem)).Tag.ToString());


                            ctlDesigner.GetQuestions();


                            cnv.Children.Add(ctlDesigner);

                            cnvMain.Children.Add(cnv);
                            
                            if (c != null)
                            {
                                c.Visibility = Visibility.Collapsed;
                            }
                        }
                        else
                        {
                            cnv.Children.Clear();
                            cnv = new Canvas();
                            cnv.Height = 768;
                            cnv.Width = 1024;
                            cnv.SetValue(Canvas.LeftProperty, 0.0);
                            cnv.SetValue(Canvas.TopProperty, 0.0);
                            ctlDesigner = new ctlCRMDesigner(((ListBoxItem)(cmbScript.SelectedItem)).Content.ToString());
                            ctlDesigner.GetQuestions();
                            cnv.Children.Add(ctlDesigner);
                            cnvMain.Children.Add(cnv);

                            if (c != null)
                            {
                                c.Visibility = Visibility.Collapsed;
                            }
                        }
                    }
                    else
                    {
                        MessageBox.Show("Please Select the CRM first", "-> Designer", MessageBoxButton.OK, MessageBoxImage.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Currently there are no CRMs");
                }
                //NavigationService.GetNavigationService(this).Navigate(new Uri("pgDesigner.xaml", UriKind.RelativeOrAbsolute));
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "btnDesigner_Click()", "CtlQuestionAns.xaml.cs");
            }
        }