void c_btnDeleteClicked(int RowID)
 {
     try
     {
         varID = Convert.ToInt32(objQColl[RowID].ID);
         if (System.Windows.MessageBox.Show("Do You Really Want To Delete This Record ?", "->Delete Question", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
         {
             ClsQuestion.Delete(varID);
             System.Windows.MessageBox.Show("Record Deleted!!", "->Question Delete", MessageBoxButton.OK, MessageBoxImage.Information);
             FncFillGrid();
         }
     }
     catch (Exception exp)
     {
         exp.Data.Add("My Key", "c_btnDeleteClicked()--:--CtlQuestionAns.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);
     }
 }
Beispiel #2
0
        void c_btnEditClicked(int ID)
        {
            try
            {
                varState = 1;
                varID    = objQColl[ID].ID;
                MessageBox.Show("Question ID is - " + objQColl[ID].ID.ToString());

                ClsQuestion objQue = ClsQuestion.GetByQueID(objQColl[ID].ID);
                txtHeader.Text      = objQue.Header;
                txtName.Text        = objQue.Name;
                txtDescription.Text = objQue.Description;
                cmbCategory.Text    = objQue.Category;

                objAns = ClsAnswerCollection.GetAll(objQColl[ID].ID);

                txtNoOfOptions.Text = objAns.Count.ToString();

                FncSetOptions();
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "c_btnEditClicked()", "CtlQuestionAns.xaml.cs");
            }
        }
Beispiel #3
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClsQuestion objQue = new ClsQuestion();
                if (varState == 0)
                {
                    objQue.ID = -1;
                }
                else
                {
                    objQue.ID = varID;
                }
                objQue.Category    = cmbCategory.Text;
                objQue.Description = txtDescription.Text;
                objQue.Header      = txtHeader.Text;
                objQue.Name        = txtName.Text;
                objQue.ScriptID    = int.Parse(((ListBoxItem)cmbScript.SelectedItem).Tag.ToString());
                int Queueid = objQue.Save();

                ClsAnswer.Delete(Queueid);

                int count = 0;

                if (txtNoOfOptions.Text.ToString() != "")
                {
                    count = int.Parse(txtNoOfOptions.Text.ToString());
                }

                for (int i = 0; i < count; i++)
                {
                    ClsAnswer objAns = new ClsAnswer();
                    objAns.ID         = -1;
                    objAns.QuestionID = Queueid;
                    objAns.OptionName = txtOption[i].Text.ToString();
                    if (cmbOption[i].SelectedItem != null)
                    {
                        objAns.ActionQuestionID = int.Parse(((ListBoxItem)cmbOption[i].SelectedItem).Tag.ToString());
                    }
                    else
                    {
                        objAns.ActionQuestionID = Queueid;
                    }
                    objAns.Description = "";
                    objAns.Save();
                }

                FncFillGrid();
                FncClearAll();

                PrevOption = 0;
            }
            catch (Exception exp)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "btnSave_Click()", "CtlQuestionAns.xaml.cs");
            }
        }
Beispiel #4
0
 void c_btnDeleteClicked(int RowID)
 {
     varID = Convert.ToInt32(objQColl[RowID].ID);
     if (System.Windows.MessageBox.Show("Do You Really Want To Delete This Record ?", "Delete Question", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         ClsQuestion.Delete(varID);
         System.Windows.MessageBox.Show("Record Deleted!!", "Question Delete", MessageBoxButton.OK, MessageBoxImage.Information);
         FncFillGrid();
         if (objQColl.Count == 0)
         {
             btnDesigner.IsEnabled = false;
         }
     }
 }
Beispiel #5
0
 void c_btnDeleteClicked(int RowID)
 {
     try
     {
         varID = Convert.ToInt32(objQColl[RowID].ID);
         if (System.Windows.MessageBox.Show("Do You Really Want To Delete This Record ?", "->Delete Question", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
         {
             ClsQuestion.Delete(varID);
             System.Windows.MessageBox.Show("Record Deleted!!", "->Question Delete", MessageBoxButton.OK, MessageBoxImage.Information);
             FncFillGrid();
         }
     }
     catch (Exception exp)
     {
         VMuktiAPI.VMuktiHelper.ExceptionHandler(exp, "c_btnDeleteClicked()", "CtlQuestionAns.xaml.cs");
     }
 }
Beispiel #6
0
        void c_btnEditClicked(int ID)
        {
            varState = 1;
            varID    = objQColl[ID].ID;
            //     MessageBox.Show("Question ID is - " + objQColl[ID].ID.ToString());
            cnvAnswer.Children.Clear();
            ClsQuestion objQue = ClsQuestion.GetByQueID(objQColl[ID].ID);

            txtHeader.Text      = objQue.Header;
            txtName.Text        = objQue.Name;
            txtDescription.Text = objQue.Description;
            cmbCategory.Text    = objQue.Category;

            objAns = ClsAnswerCollection.GetAll(objQColl[ID].ID);

            txtNoOfOptions.Text = objAns.Count.ToString();

            FncSetOptions();
        }
        void c_btnEditClicked(int ID)
        {
            try
            {
                varState = 1;
                varID    = objQColl[ID].ID;
                MessageBox.Show("Question ID is - " + objQColl[ID].ID.ToString());

                ClsQuestion objQue = ClsQuestion.GetByQueID(objQColl[ID].ID);
                txtHeader.Text      = objQue.Header;
                txtName.Text        = objQue.Name;
                txtDescription.Text = objQue.Description;
                cmbCategory.Text    = objQue.Category;

                objAns = ClsAnswerCollection.GetAll(objQColl[ID].ID);

                txtNoOfOptions.Text = objAns.Count.ToString();

                FncSetOptions();
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "c_btnEditClicked()--:--CtlQuestionAns.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);
            }
        }
Beispiel #8
0
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            if (txtHeader.Text.Trim() != "" && txtDescription.Text.Trim() != "" && txtName.Text.Trim() != "")
            {
                ClsQuestion objQue = new ClsQuestion();
                if (varState == 0)
                {
                    objQue.ID = -1;
                }
                else
                {
                    objQue.ID = varID;
                }
                objQue.Category    = cmbCategory.Text;
                objQue.Description = txtDescription.Text;
                objQue.Header      = txtHeader.Text;
                objQue.Name        = txtName.Text;
                objQue.ScriptID    = int.Parse(((ListBoxItem)cmbScript.SelectedItem).Tag.ToString());
                int Queueid = objQue.Save();

                ClsAnswer.Delete(Queueid);

                int count = 0;

                if (txtNoOfOptions.Text.ToString() != "")
                {
                    count = int.Parse(txtNoOfOptions.Text.ToString());
                }

                for (int i = 0; i < count; i++)
                {
                    ClsAnswer objAns = new ClsAnswer();
                    objAns.ID         = -1;
                    objAns.QuestionID = Queueid;
                    objAns.OptionName = txtOption[i].Text.ToString();
                    if (cmbOption[i].SelectedItem != null)
                    {
                        objAns.ActionQuestionID = int.Parse(((ListBoxItem)cmbOption[i].SelectedItem).Tag.ToString());
                        objAns.Description      = "";
                        objAns.Save();
                    }
                    else
                    {
                        objAns.ActionQuestionID = Queueid;
                        MessageBox.Show("Fill Answer tab also");
                        break;
                    }
                }
                FncFillGrid();
                if (objQColl.Count != 0)
                {
                    btnDesigner.IsEnabled = true;
                }
                FncClearAll();
                PrevOption = 0;
            }
            else
            {
                MessageBox.Show("Fill all Information");
            }
        }
        void btnSave_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClsQuestion objQue = new ClsQuestion();
                if (varState == 0)
                {
                    objQue.ID = -1;
                }
                else
                {
                    objQue.ID = varID;
                }
                objQue.Category    = cmbCategory.Text;
                objQue.Description = txtDescription.Text;
                objQue.Header      = txtHeader.Text;
                objQue.Name        = txtName.Text;
                objQue.ScriptID    = int.Parse(((ListBoxItem)cmbScript.SelectedItem).Tag.ToString());
                int Queueid = objQue.Save();

                ClsAnswer.Delete(Queueid);

                int count = 0;

                if (txtNoOfOptions.Text.ToString() != "")
                {
                    count = int.Parse(txtNoOfOptions.Text.ToString());
                }

                for (int i = 0; i < count; i++)
                {
                    ClsAnswer objAns = new ClsAnswer();
                    objAns.ID         = -1;
                    objAns.QuestionID = Queueid;
                    objAns.OptionName = txtOption[i].Text.ToString();
                    if (cmbOption[i].SelectedItem != null)
                    {
                        objAns.ActionQuestionID = int.Parse(((ListBoxItem)cmbOption[i].SelectedItem).Tag.ToString());
                    }
                    else
                    {
                        objAns.ActionQuestionID = Queueid;
                    }
                    objAns.Description = "";
                    objAns.Save();
                }

                FncFillGrid();
                FncClearAll();

                PrevOption = 0;
            }
            catch (Exception exp)
            {
                exp.Data.Add("My Key", "btnSave_Click()--:--CtlQuestionAns.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);
            }
        }