public void Update() { RequestQuestionSenarioDAL R = new RequestQuestionSenarioDAL(); if (_Question_id != null && _Question_id != 0) { R.RequestQuestionSenario.Question_id = _Question_id; } if (_RegisterRequests_Id != null && _RegisterRequests_Id != 0) { R.RequestQuestionSenario.RegisterRequests_Id = _RegisterRequests_Id; } if (_Answers != null) { R.RequestQuestionSenario.Answers = _Answers; } if (_Entity_Order != null) { R.RequestQuestionSenario.Entity_Order = _Entity_Order; } R.Update(); }
public ActionResult QA() { int Id = int.Parse(Request.Params["Id"]); var model = new List <RequestQuestionSenarioViewModel>(); if (Id != 0) { model = RequestQuestionSenarioViewModel.GetRequestQuestionSenarioListByRegisterRequests_Id(Id); } foreach (var Q in model) { var Answers = Request.Params["Answers_" + Q.Id]; RequestQuestionSenarioDAL RQS = new RequestQuestionSenarioDAL(Q.Id); RQS.RequestQuestionSenario.Answers = Answers; RQS.Update(); } RegisterRequestsDAL rrDAL = new RegisterRequestsDAL(Id); rrDAL.RegisterRequests.RequestStatus = 2; rrDAL.Update(); ViewBag.ReturnUrl = "RegisterRequest/QA/" + Id; return(View()); }