コード例 #1
0
 void btnScript_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClsQuestionCollectionR objQueCollection = ClsQuestionCollectionR.GetAll(int.Parse(txtScript.Text));
         if (objQueCollection.Count > 0)
         {
             FncSetInnerCanvas();
         }
     }
     catch (Exception exp)
     {
         exp.Data.Add("My Key", "btnScript_Click()--:--CtlDynamicScript.xaml.cs--:--" + exp.Message + " :--:--");
         //ClsException.LogError(ex);
         //ClsException.WriteToErrorLogFile(ex);
         System.Text.StringBuilder sb = new StringBuilder();
         sb.AppendLine(exp.Message);
         sb.AppendLine();
         sb.AppendLine("StackTrace : " + exp.StackTrace);
         sb.AppendLine();
         sb.AppendLine("Location : " + exp.Data["My Key"].ToString());
         sb.AppendLine();
         sb1 = CreateTressInfo();
         sb.Append(sb1.ToString());
         VMuktiAPI.ClsLogging.WriteToTresslog(sb);
     }
 }
コード例 #2
0
        void btnScript_Click(object sender, RoutedEventArgs e)
        {
            ClsQuestionCollectionR objQueCollection = ClsQuestionCollectionR.GetAll(int.Parse(txtScript.Text));

            if (objQueCollection.Count > 0)
            {
                FncSetInnerCanvas();
            }
        }
コード例 #3
0
 void btnScript_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ClsQuestionCollectionR objQueCollection = ClsQuestionCollectionR.GetAll(int.Parse(txtScript.Text));
         if (objQueCollection.Count > 0)
         {
             FncSetInnerCanvas();
         }
     }
     catch (Exception exp)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "btnScript_Click()", "CtlDynamicScript.xaml.cs");
     }
 }
コード例 #4
0
        void btnYes_Click(object sender, RoutedEventArgs e)
        {
            ClsQuestionCollectionR objQueCollection = ClsQuestionCollectionR.GetAll(int.Parse(txtScript.Text));

            if (((Button)sender).Tag.ToString().ToLower() == "radiobutton")
            {
                foreach (object r in cnvPaint.Children)
                {
                    if (r.GetType() == typeof(RadioButton))
                    {
                        if (((RadioButton)r).IsChecked == true)
                        {
                            string[] str = ((RadioButton)r).Tag.ToString().Split(',');
                            CurrentQueCount = int.Parse(str[0]);
                            int optID = int.Parse(str[1]);
                            //MessageBox.Show("Option ID = " + optID.ToString());

                            //ClsAnswerR objAns = new ClsAnswerR();
                            //objAns.CallID = int.Parse(txtCall.Text.ToString());
                            //objAns.QusOptionID = int.Parse(optID.ToString());
                            //objAns.Save();

                            for (int k = 0; k < objQueCollection.Count; k++)
                            {
                                if (objQueCollection[k].ID == CurrentQueCount)
                                {
                                    //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml" , UriKind.RelativeOrAbsolute));
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            else if (varType == "CheckBox")
            {
                foreach (object r in cnvPaint.Children)
                {
                    if (r.GetType() == typeof(CheckBox))
                    {
                        if (((CheckBox)r).IsChecked == true)
                        {
                            string[] str = ((CheckBox)r).Tag.ToString().Split(',');
                            CurrentQueCount = int.Parse(str[0]);
                            int optID = int.Parse(str[1]);
                            //MessageBox.Show("Option ID = " + optID.ToString());

                            //ClsAnswerR objAns = new ClsAnswerR();
                            //objAns.CallID = int.Parse(txtCall.Text.ToString());
                            //objAns.QusOptionID = int.Parse(optID.ToString());
                            //objAns.Save();

                            for (int k = 0; k < objQueCollection.Count; k++)
                            {
                                if (objQueCollection[k].ID == CurrentQueCount)
                                {
                                    //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            else if (((Button)sender).Tag.ToString().ToLower() == "listbox")
            {
                foreach (object r in cnvPaint.Children)
                {
                    if (r.GetType() == typeof(ListBox))
                    {
                        for (int i = 0; i < ((ListBox)r).Items.Count; i++)
                        {
                            if (((ListBoxItem)((ListBox)r).Items[i]).IsSelected == true)
                            {
                                string[] str             = ((ListBoxItem)r).Tag.ToString().Split(',');
                                int      CurrentQueCount = int.Parse(str[0]);
                                int      optID           = int.Parse(str[1]);
                                //MessageBox.Show("Option ID = " + optID.ToString());

                                //ClsAnswerR objAns = new ClsAnswerR();
                                //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                //objAns.QusOptionID = int.Parse(optID.ToString());
                                //objAns.Save();

                                for (int k = 0; k < objQueCollection.Count; k++)
                                {
                                    if (objQueCollection[k].ID == CurrentQueCount)
                                    {
                                        //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            else if (((Button)sender).Tag.ToString().ToLower() == "combobox")
            {
                foreach (object r in cnvPaint.Children)
                {
                    if (r.GetType() == typeof(ComboBox))
                    {
                        for (int i = 0; i < ((ComboBox)r).Items.Count; i++)
                        {
                            if (((ComboBoxItem)((ComboBox)r).Items[i]).IsSelected == true)
                            {
                                string[] str             = ((ComboBoxItem)r).Tag.ToString().Split(',');
                                int      CurrentQueCount = int.Parse(str[0]);
                                int      optID           = int.Parse(str[1]);
                                //MessageBox.Show("Option ID = " + optID.ToString());

                                //ClsAnswerR objAns = new ClsAnswerR();
                                //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                //objAns.QusOptionID = int.Parse(optID.ToString());
                                //objAns.Save();

                                for (int k = 0; k < objQueCollection.Count; k++)
                                {
                                    if (objQueCollection[k].ID == CurrentQueCount)
                                    {
                                        //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
コード例 #5
0
        void btnYes_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClsQuestionCollectionR objQueCollection = ClsQuestionCollectionR.GetAll(int.Parse(txtScript.Text));

                if (((Button)sender).Tag.ToString().ToLower() == "radiobutton")
                {
                    foreach (object r in cnvPaint.Children)
                    {
                        if (r.GetType() == typeof(RadioButton))
                        {
                            if (((RadioButton)r).IsChecked == true)
                            {
                                string[] str = ((RadioButton)r).Tag.ToString().Split(',');
                                CurrentQueCount = int.Parse(str[0]);
                                int optID = int.Parse(str[1]);
                                //MessageBox.Show("Option ID = " + optID.ToString());

                                //ClsAnswerR objAns = new ClsAnswerR();
                                //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                //objAns.QusOptionID = int.Parse(optID.ToString());
                                //objAns.Save();

                                for (int k = 0; k < objQueCollection.Count; k++)
                                {
                                    if (objQueCollection[k].ID == CurrentQueCount)
                                    {
                                        //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml" , UriKind.RelativeOrAbsolute));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                else if (varType == "CheckBox")
                {
                    foreach (object r in cnvPaint.Children)
                    {
                        if (r.GetType() == typeof(CheckBox))
                        {
                            if (((CheckBox)r).IsChecked == true)
                            {
                                string[] str = ((CheckBox)r).Tag.ToString().Split(',');
                                CurrentQueCount = int.Parse(str[0]);
                                int optID = int.Parse(str[1]);
                                //MessageBox.Show("Option ID = " + optID.ToString());

                                //ClsAnswerR objAns = new ClsAnswerR();
                                //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                //objAns.QusOptionID = int.Parse(optID.ToString());
                                //objAns.Save();

                                for (int k = 0; k < objQueCollection.Count; k++)
                                {
                                    if (objQueCollection[k].ID == CurrentQueCount)
                                    {
                                        //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                else if (((Button)sender).Tag.ToString().ToLower() == "listbox")
                {
                    foreach (object r in cnvPaint.Children)
                    {
                        if (r.GetType() == typeof(ListBox))
                        {
                            for (int i = 0; i < ((ListBox)r).Items.Count; i++)
                            {
                                if (((ListBoxItem)((ListBox)r).Items[i]).IsSelected == true)
                                {
                                    string[] str             = ((ListBoxItem)r).Tag.ToString().Split(',');
                                    int      CurrentQueCount = int.Parse(str[0]);
                                    int      optID           = int.Parse(str[1]);
                                    //MessageBox.Show("Option ID = " + optID.ToString());

                                    //ClsAnswerR objAns = new ClsAnswerR();
                                    //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                    //objAns.QusOptionID = int.Parse(optID.ToString());
                                    //objAns.Save();

                                    for (int k = 0; k < objQueCollection.Count; k++)
                                    {
                                        if (objQueCollection[k].ID == CurrentQueCount)
                                        {
                                            //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }

                else if (((Button)sender).Tag.ToString().ToLower() == "combobox")
                {
                    foreach (object r in cnvPaint.Children)
                    {
                        if (r.GetType() == typeof(ComboBox))
                        {
                            for (int i = 0; i < ((ComboBox)r).Items.Count; i++)
                            {
                                if (((ComboBoxItem)((ComboBox)r).Items[i]).IsSelected == true)
                                {
                                    string[] str             = ((ComboBoxItem)r).Tag.ToString().Split(',');
                                    int      CurrentQueCount = int.Parse(str[0]);
                                    int      optID           = int.Parse(str[1]);
                                    //MessageBox.Show("Option ID = " + optID.ToString());

                                    //ClsAnswerR objAns = new ClsAnswerR();
                                    //objAns.CallID = int.Parse(txtCall.Text.ToString());
                                    //objAns.QusOptionID = int.Parse(optID.ToString());
                                    //objAns.Save();

                                    for (int k = 0; k < objQueCollection.Count; k++)
                                    {
                                        if (objQueCollection[k].ID == CurrentQueCount)
                                        {
                                            //this.NavigationService.Navigate(new Uri(objQueCollection[k].QuestionName + ".Xaml", UriKind.RelativeOrAbsolute));
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "btnYes_Click()--:--CtlDynamicScript.xaml.cs--:--" + exp.Message + " :--:--");
                //ClsException.LogError(ex);
                //ClsException.WriteToErrorLogFile(ex);
                System.Text.StringBuilder sb = new StringBuilder();
                sb.AppendLine(exp.Message);
                sb.AppendLine();
                sb.AppendLine("StackTrace : " + exp.StackTrace);
                sb.AppendLine();
                sb.AppendLine("Location : " + exp.Data["My Key"].ToString());
                sb.AppendLine();
                sb1 = CreateTressInfo();
                sb.Append(sb1.ToString());
                VMuktiAPI.ClsLogging.WriteToTresslog(sb);
            }
        }