Exemple #1
0
        public List <TSS_Question> SectionQuestions(Int64 Id)
        {
            try
            {
                TSS_QuestionBL      qb  = new TSS_QuestionBL();
                TSS_ResponseBL      rb  = new TSS_ResponseBL();
                TSS_QuestionLogicBL qlb = new TSS_QuestionLogicBL();
                var que =
                    new TSS_QuestionBL().GetQuestionsWithOptions("GET_Questions_BY_SECTIONID_API", 0, Id.ToString()).OrderBy(s => s.SortOrder).ToList();
                //var que = qb.ToList("GET_QUESTION_BY_SECTION", Id.ToString());
                //foreach (var q in que)
                //{
                //    //q.Responses = rb.ToList("GET_BY_QUESTIONID", q.QuestionId.ToString());
                //    q.Responses = rb.ToList("GET_RESPONSE_BY_SITEQUESTION", q.QuestionId.ToString());
                //}

                foreach (var q in que)
                {
                    q.QuestionLogics = qlb.ToList("GET_BY_QUESTIONID", q.QuestionId.ToString());
                }
                return(que);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public JsonResult ToList(string Filter, string Value)
        {
            TSS_QuestionLogicBL qlb = new TSS_QuestionLogicBL();
            var rec = qlb.ToList(Filter, Value);

            return(Json(rec, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
 public List <TSS_QuestionLogic> SectionQuestionLogic(Int64 sectionId)
 {
     try
     {
         TSS_QuestionLogicBL qlb = new TSS_QuestionLogicBL();
         var qLogic = qlb.ToList("GET_BY_SECTIONID", sectionId.ToString());
         return(qLogic);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #4
0
        public ActionResult Delete(Int64 Id)
        {
            Response res = new Response();

            try
            {
                TSS_QuestionLogicBL sb = new TSS_QuestionLogicBL();

                sb.Manage("Delete", Id.ToString(), null);
                res.Status  = "success";
                res.Message = "Delete successfully";
            }
            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Exemple #5
0
        public ActionResult New(TSS_QuestionLogic ql, Int64[] ToQuestions)
        {
            string ToQuestionId = string.Join(",", ToQuestions);

            Response            res  = new Response();
            TSS_QuestionLogicBL qlb  = new TSS_QuestionLogicBL();
            dbDataTable         dbdt = new dbDataTable();

            try
            {
                DataTable dt = dbdt.List();

                myDataTable.AddRow(dt, "Value1", ql.SurveyId, "Value2", ql.SectionId, "Value3", ql.FromQuestionId, "Value4", ToQuestionId, "Value5", ql.ConditionId,
                                   "Value6", ql.ResponseId, "Value7", ql.ActionId, "Value8", true);

                res.Value   = qlb.Manage("Insert", "", dt);
                res.Status  = "success";
                res.Message = "Update successfully";

                //+++++++++++++++++++++++++++++++++++
                //deleteExistingRows(ql.FromQuestionId, ToQuestions);E:\TFS Projects\SWI\WebApplication\Areas\Survey\Views\QuestionLogic\

                //for (int i = 0; i < ToQuestions.Length; i++)
                //{
                //    DataTable dt = dbdt.List();

                //    myDataTable.AddRow(dt, "Value1", ql.SurveyId, "Value2", ql.SectionId, "Value3", ql.FromQuestionId, "Value4", ToQuestions[i], "Value5", ql.ConditionId,
                //                           "Value6", ql.ResponseId, "Value7", ql.ActionId, "Value8", true);
                //    res.Value = qlb.Manage("Insert", "", dt);
                //}
                //res.Status = "success";
                //res.Message = "Update successfully";
                //------------------------------------
            }

            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Exemple #6
0
        public void GetSectionQuestions()
        {
            TSS_QuestionBL      qb  = new TSS_QuestionBL();
            TSS_ResponseBL      rb  = new TSS_ResponseBL();
            TSS_QuestionLogicBL qlb = new TSS_QuestionLogicBL();
            var que =
                new TSS_QuestionBL().GetQuestionsWithOptions("GET_Questions_BY_SECTIONID_API", 0, 70293.ToString());

            //var que = qb.ToList("GET_QUESTION_BY_SECTION", Id.ToString());
            //foreach (var q in que)
            //{
            //    //q.Responses = rb.ToList("GET_BY_QUESTIONID", q.QuestionId.ToString());
            //    q.Responses = rb.ToList("GET_RESPONSE_BY_SITEQUESTION", q.QuestionId.ToString());
            //}

            foreach (var q in que)
            {
                q.QuestionLogics = qlb.ToList("GET_BY_QUESTIONID", q.QuestionId.ToString());
            }
        }