Exemplo n.º 1
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));
        }
Exemplo n.º 2
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));
        }