Exemplo n.º 1
0
        public JsonResult CheckCodeViewExitQuestion(string questiongroup, string code, string codeView)
        {
            int          ret;
            QUESTION_BUS bus = new QUESTION_BUS();
            QUESTION_OBJ obj;

            if (!string.IsNullOrEmpty(code))
            {
                //check for update
                obj = bus.GetByKey(new fieldpara("CODEVIEW", codeView, 0),
                                   new fieldpara("QUESTIONGROUPCODE", questiongroup, 0),
                                   new fieldpara("UNIVERSITYCODE", _ses.gUNIVERSITYCODE, 0));

                if (obj == null)
                {
                    //change codeview
                    ret = 1;
                }
                else
                {
                    //change other feature,not codeview
                    ret = code == obj.CODE ? 1 : -1;
                }
            }
            else
            {
                obj = bus.GetByKey(new fieldpara("CODEVIEW", codeView, 0),
                                   new fieldpara("UNIVERSITYCODE", _ses.gUNIVERSITYCODE, 0));
                ret = obj == null ? 1 : -1;
            }
            bus.CloseConnection();
            return(Json(new { sussess = ret }, JsonRequestBehavior.AllowGet));
        }