Пример #1
0
        /// <summary>
        /// 添加新问题
        /// </summary>
        /// <param name="content">问题内容</param>
        /// <param name="typeid">问题类型id</param>
        /// <param name="regman">创建人</param>
        /// <param name="ishot">是否是热门问题</param>
        public Question AddQuestion(string title,string content,int typeid,bool ishot=false)
        {
            //验证信息

            var model = new Question()
            {
                title=title,
                content = content,
                typeid = typeid,
                regman = Common.CommonClass1.GetUserName(),
                regmanid=Common.CommonClass1.GetPartyIdCount(),
                regdate = DateTime.Now,
                ishot=ishot
            };
            return qs.Add(model);
        }
Пример #2
0
        public ActionResult AddQuestionV2(Question model)
        {
            model.regman = Common.CommonClass1.GetUserName();
            model.regmanid = Common.CommonClass1.GetPartyIdCount();

            var temp=qs.Add(model);
            return Json(temp, JsonRequestBehavior.AllowGet);
        }