Exemplo n.º 1
0
        public ActionResult IsActive(TSS_Question q)
        {
            Response       res  = new Response();
            TSS_QuestionBL qb   = new TSS_QuestionBL();
            dbDataTable    dbtd = new dbDataTable();

            try
            {
                DataTable dt = dbtd.List();
                foreach (var item in q.Responses)
                {
                    if (item.ResponseText != null)
                    {
                        myDataTable.AddRow(dt, "Value1", q.QuestionId, "Value2", item.ResponseText, "Value3", item.ResponseValue, "Value4", item.SortOrder, "Value5", item.IsPassed,
                                           "Value6", item.MinValue, "Value7", item.MaxValue, "Value8", item.IsGps, "Value9", true);
                    }
                }
                q.CreatedOn = DateTime.Now;
                q.CreatedBy = ViewBag.UserId;

                if (q.QuestionId > 0)
                {
                    res.Value = qb.Manage("UpdateStatus", q, dt);
                }
                res.Status  = "success";
                res.Message = "Save successfully";
            }
            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }

            return(Json(res, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult Delete(Int64 Id)
        {
            Response res = new Response();

            try
            {
                TSS_QuestionBL qb = new TSS_QuestionBL();
                TSS_Question   q  = new TSS_Question();
                q.QuestionId = Id;
                qb.Manage("Delete", q, null);
                res.Status  = "success";
                res.Message = "Delete successfully";
            }
            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }