예제 #1
0
        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();
        }
예제 #2
0
        public static List <RequestQuestionSenarioViewModel> GetRequestQuestionSenarioListByRegisterRequests_Id(int RegisterRequests_Id)
        {
            List <RequestQuestionSenarioViewModel> RList = new List <RequestQuestionSenarioViewModel>();

            RequestQuestionSenarioDAL.GetRequestQuestionSenarioListByRegisterRequests_Id(RegisterRequests_Id).ForEach(r => RList.Add(new RequestQuestionSenarioViewModel(r)));
            return(RList);
        }
예제 #3
0
        public static List <RequestQuestionSenarioViewModel> GetRequestQuestionSenarioList()
        {
            List <RequestQuestionSenarioViewModel> RList = new List <RequestQuestionSenarioViewModel>();

            RequestQuestionSenarioDAL.GetRequestQuestionSenarioList().ForEach(r => RList.Add(new RequestQuestionSenarioViewModel(r)));
            return(RList);
        }
예제 #4
0
 public RequestQuestionSenarioViewModel(RequestQuestionSenarioDAL R)
 {
     _Id                  = R.RequestQuestionSenario.Id;
     _Question_id         = R.RequestQuestionSenario.Question_id.GetValueOrDefault();
     _RegisterRequests_Id = R.RequestQuestionSenario.RegisterRequests_Id.GetValueOrDefault();
     _Answers             = R.RequestQuestionSenario.Answers;
     _Entity_Order        = R.RequestQuestionSenario.Entity_Order.GetValueOrDefault();
 }
예제 #5
0
        public void Create()
        {
            RequestQuestionSenarioDAL R = new RequestQuestionSenarioDAL();

            //R.RequestQuestionSenario.Id = _Id;
            R.RequestQuestionSenario.Question_id         = _Question_id;
            R.RequestQuestionSenario.RegisterRequests_Id = _RegisterRequests_Id;
            R.RequestQuestionSenario.Answers             = _Answers;
            R.RequestQuestionSenario.Entity_Order        = _Entity_Order;

            R.Create();

            _Id = R.RequestQuestionSenario.Id;
        }
        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());
        }
예제 #7
0
 public IEnumerable GetRequestQuestionSenarioComboList()
 {
     return(RequestQuestionSenarioDAL.GetRequestQuestionSenarioComboList());
 }
예제 #8
0
        public void Delete()
        {
            RequestQuestionSenarioDAL R = new RequestQuestionSenarioDAL(_Id);

            R.Delete();
        }