protected void grdQuiz_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            string questionId = ((Label)grdQuiz.Rows[e.RowIndex].FindControl("lblQuestionId")).Text;
            string question   = ((TextBox)grdQuiz.Rows[e.RowIndex].FindControl("txtQuestion")).Text;

            string option = ((RadioButtonList)grdQuiz.Rows[e.RowIndex].FindControl("lblOption")).SelectedItem.Value;

            var optionList = ((RadioButtonList)grdQuiz.Rows[e.RowIndex].FindControl("lblOption"));

            professor_Quiz_WCFLib.questionModel      quesM = new professor_Quiz_WCFLib.questionModel();
            List <professor_Quiz_WCFLib.optionModel> re    = new List <professor_Quiz_WCFLib.optionModel>();

            //int count = opt.Option.Count();
            foreach (ListItem item in optionList.Items)
            {
                int i = 0;
                if (item.Selected)
                {
                    i = 1;
                }
                re.Add(new professor_Quiz_WCFLib.optionModel {
                    option_value = item.Text, isAnswer = i, PK_Option_id = Convert.ToInt32(item.Value)
                });
            }
            quesM.question       = question;
            quesM.question_type  = "Objective";
            quesM.PK_Question_id = Convert.ToInt32(questionId);
            quesM.FK_Quiz_id     = 50;
            quesM.optionModel    = re.ToArray();
            professor_Quiz_WCFLib.ProfessorQuizClient proxy = new professor_Quiz_WCFLib.ProfessorQuizClient();

            bool rr = proxy.UpdateQuestion(quesM);
        }
        private professor_Quiz_WCFLib.optionModel[] OptionData(int quiestionId)
        {
            professor_Quiz_WCFLib.ProfessorQuizClient p = new professor_Quiz_WCFLib.ProfessorQuizClient();

            professor_Quiz_WCFLib.optionModel[] optModel = p.GetAllOptionByQues(quiestionId);

            return(optModel);
        }
 private void GetQuizData(int quizId)
 {
     professor_Quiz_WCFLib.ProfessorQuizClient proxy     = new professor_Quiz_WCFLib.ProfessorQuizClient();
     professor_Quiz_WCFLib.questionModel[]     quesModel = proxy.GetAllQuestionByQuiz(quizId);
     //try End
     grdQuiz.DataSource = quesModel;
     grdQuiz.DataBind();
 }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            LinkButton link = (LinkButton)sender;

            int questionId = Convert.ToInt32(link.CommandArgument);

            professor_Quiz_WCFLib.ProfessorQuizClient proxy = new professor_Quiz_WCFLib.ProfessorQuizClient();

            bool w = proxy.DeleteQuestion(questionId);
        }