Ejemplo n.º 1
0
 public ActionResult GetQustion(String id)
 {
     String userid = HttpContext.User.Identity.Name;
     IList<BiZ.WenWen.WenWen> wenwens = new List<BiZ.WenWen.WenWen>();
     IList<BiZ.InterestCenter.Interest> interests = new List<BiZ.InterestCenter.Interest>();
     if (id != null)
     {
         interests = BiZ.InterestCenter.InterestFactory.GetMemberInterest(id, 0, 0);
     }
     else
     {
         interests = BiZ.InterestCenter.InterestFactory.GetMemberInterest(userid, 0, 0);
     }
     String[] ids = new String[interests.Count];
     if (interests != null && interests.Count > 0)
     {
         int i = 0;
         foreach (BiZ.InterestCenter.Interest interest in interests)
         {
             ids[i] = interest.ID;
             i++;
         }
         wenwens = BiZ.WenWen.WenWenProvider.GetRandomWenWen(6, ids);
     }
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwens);
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Ejemplo n.º 2
0
 public ActionResult NewQuestion()
 {
     IList<BiZ.WenWen.WenWen> wenwens = BiZ.WenWen.WenWenProvider.GetWenWens(1, 10);
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwens);
     return View(model);
 }
Ejemplo n.º 3
0
 public ActionResult Question(String id)
 {
     bool alreadyLogin = true;
     String userid = HttpContext.User.Identity.Name;
     IList<BiZ.WenWen.WenWen> wenwens = new List<BiZ.WenWen.WenWen>();
     IList<BiZ.InterestCenter.Interest> interests = new List<BiZ.InterestCenter.Interest>();
     if (id != null)
     {
         interests = BiZ.InterestCenter.InterestFactory.GetMemberInterest(id, 0, 0);
     }
     else
     {
         interests = BiZ.InterestCenter.InterestFactory.GetMemberInterest(userid, 0, 0);
     }
     String[] ids = new String[interests.Count];
     if (interests != null && interests.Count > 0)
     {
         int i = 0;
         foreach (BiZ.InterestCenter.Interest interest in interests)
         {
             ids[i] = interest.ID;
             i++;
         }
         wenwens = BiZ.WenWen.WenWenProvider.GetRandomWenWen(6, ids);
     }
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwens);
     model.UserID = userid;
     model.MemberID = id == null ? userid : id;
     model.AlreadyLogon = alreadyLogin;
     return View(model);
 }
Ejemplo n.º 4
0
 public ActionResult MyInterestTowwItem(List<BiZ.WenWen.WenWen> topiclist, int showcount)
 {
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel();
     model.UserID = HttpContext.User.Identity.Name;
     model.wenwenlist = topiclist;
     ViewData["showcount"] = showcount;
     return View(model);
 }
Ejemplo n.º 5
0
 public ActionResult MyWenWen()
 {
     string userid = User.Identity.Name;
     IList<BiZ.WenWen.WenWen> wenwen = BiZ.WenWen.WenWenProvider.GetWenWenForMember(userid, 0, 0);
     IList<BiZ.WenWen.WenWen> wenwens = BiZ.WenWen.WenWenProvider.GetWenWenForMemberIDs(userid, 0, 0);
     IList<BiZ.InterestCenter.Interest> interests = new List<BiZ.InterestCenter.Interest>();
     foreach (BiZ.WenWen.WenWen obj in wenwen)
     {
         if (wenwens.IndexOf(obj) <= 0)
         {
             wenwens.Add(obj);
         }
     }
     foreach (BiZ.WenWen.WenWen objs in wenwens)
     {
         if (objs.InterestID == null) continue;
         interests.Add(BiZ.InterestCenter.InterestFactory.GetInterest(objs.InterestID));
     }
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwens, interests);
     return View(model);
 }
Ejemplo n.º 6
0
        public ActionResult WenWen()
        {
            string memberID = HttpContext.User.Identity.Name;
            string _pageno = Request.QueryString["p"];
            string _type = Request.QueryString["t"];
            int type = 1;
            int pageno = 1;
            int pagesize = 10;
            if (!Int32.TryParse(_type, out type)) type = 1;
            if (!Int32.TryParse(_pageno, out pageno)) pageno = 1;

            IList<Moooyo.BiZ.WenWen.WenWen> listq;
            IList<Moooyo.BiZ.WenWen.WenWenAnswer> lista;
            Models.PageModels.InterestWenWenModel Model = null;
            int count = 0;
            if (type == 1)
            {
                listq = Moooyo.BiZ.WenWen.WenWenProvider.GetWenWenForMember(memberID, pagesize, pageno);
                Model = new Models.PageModels.InterestWenWenModel(listq);
                count = (int)Moooyo.BiZ.WenWen.WenWenProvider.GetWenWenAnswerForMemberCount(memberID);
            }
            else if (type == 2)
            {
                lista = Moooyo.BiZ.WenWen.WenWenProvider.GetWenWenAnswerForMember(memberID, pagesize, pageno);
                Model = new Models.PageModels.InterestWenWenModel(lista);
                count = Moooyo.BiZ.WenWen.WenWenProvider.GetWenWenCount(memberID);
            }
            Model.Pagger = new Models.PaggerObj();
            Model.Pagger.PageCount = (count + pagesize - 1) / pagesize;
            Model.Pagger.PageNo = pageno;
            Model.Pagger.PageSize = pagesize;
            Model.Pagger.PageUrl = "/Member/WenWen/?t=" + type + "&p=";
            ViewData["type"] = type;
            return View(Model);
        }
Ejemplo n.º 7
0
 public ActionResult GetWenWen(int pageno, String id)
 {
     int pageSize = int.Parse(CBB.ConfigurationHelper.AppSettingHelper.GetConfig("PlazaPageSize"));
     IList<BiZ.WenWen.WenWen> wenwenlist = BiZ.WenWen.WenWenProvider.GetWenWen(id, pageSize, pageno);
     int wenwencount = BiZ.WenWen.WenWenProvider.GetWenWen(id, 0, 0).Count;
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel();
     model.wenwenpagecount = wenwencount % pageSize == 0 ? wenwencount / pageSize : (wenwencount / pageSize) + 1;
     model.wenwenlist = wenwenlist;
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Ejemplo n.º 8
0
        public ActionResult UpdateWenWen(String wwid, String wwcontenthidden, String wwcontentimghidden)
        {
            String userid = HttpContext.User.Identity.Name;
            String title = wwcontenthidden.Length > 10 ? wwcontenthidden.Substring(0, 10) + "..." : wwcontenthidden;
            String fileName = string.Empty;
            String upimgstr = string.Empty;
            HttpFileCollectionBase files = Request.Files;
            if (files != null && files.Count > 0)
            {
                for (int i = 0; i < files.Count; i++)
                {
                    fileName = string.Empty;
                    HttpPostedFileBase fileobj = files[i];
                    if (fileobj.FileName != "")
                    {
                        fileName = DateTime.Now.ToString("yyyyMMddhhmmss") + CBB.Security.MD5Helper.getMd5Hash(fileobj.FileName) + ".jpg";
                        Moooyo.BiZ.Photo.Photo topicimgobj = new UpController().SavePhoto(userid, (int)BiZ.Photo.PhotoType.TopicImage, fileobj.InputStream, fileName);
                        upimgstr += topicimgobj.FileName + ",";
                    }
                }
            }
            upimgstr = upimgstr + wwcontentimghidden;

            CBB.ExceptionHelper.OperationResult obj = BiZ.WenWen.WenWenProvider.UpdateWenWen(wwid, title, wwcontenthidden, upimgstr);
            Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel();
            model.wenwen = BiZ.WenWen.WenWenProvider.GetWenWen(wwid);
            return RedirectToAction("ShowWenWen", "WenWen", new { wwid = wwid });
        }
Ejemplo n.º 9
0
 public ActionResult WenWen()
 {
     //只允许已登录用户访问自己
     bool alreadyLogin = true;
     String userId = HttpContext.User.Identity.Name;
     int wenwencount = BiZ.WenWen.WenWenProvider.GetWenWenCount(null);
     int[] indexlist = new int[3];
     Random ran = new Random();
     for (int i = 0; i < 3; i++) { indexlist[i] = ran.Next(wenwencount); }
     IList<BiZ.WenWen.WenWen> wenwens = new List<BiZ.WenWen.WenWen>();
     foreach (int index in indexlist) { wenwens.Add(BiZ.WenWen.WenWenProvider.GetWenWens(index, 1)[0]); }
     IList<BiZ.InterestCenter.Interest> interests = new List<BiZ.InterestCenter.Interest>();
     foreach (var obj in wenwens)
     {
         BiZ.InterestCenter.Interest interest = BiZ.InterestCenter.InterestFactory.GetInterest(obj.InterestID);
         interests.Add(interest);
     }
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwens, interests);
     ViewData["pagecount"] = wenwencount;
     model.UserID = userId;
     model.MemberID = userId;
     model.AlreadyLogon = alreadyLogin;
     return View(model);
 }
Ejemplo n.º 10
0
 public ActionResult GetWenWenForMember(int pagesize, int pageno)
 {
     String userid = HttpContext.User.Identity.Name;
     IList<BiZ.WenWen.WenWen> wenwen = BiZ.WenWen.WenWenProvider.GetWenWenForMember(userid, pagesize, pageno);
     IList<BiZ.WenWen.WenWen> wenwenlist = new List<BiZ.WenWen.WenWen>();
     IList<int> wenwenanswerlist = new List<int>();
     IList<BiZ.InterestCenter.Interest> interestlist = new List<BiZ.InterestCenter.Interest>();
     foreach (var obj in wenwen)
     {
         IList<BiZ.WenWen.WenWenAnswer> answer = BiZ.WenWen.WenWenProvider.GetWenWenAnswer(obj.ID, 0, 0, 1);
         wenwenlist.Add(obj);
         wenwenanswerlist.Add(answer.Count);
         interestlist.Add(BiZ.InterestCenter.InterestFactory.GetInterest(obj.InterestID));
     }
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwenlist, wenwenanswerlist, interestlist);
     return Json(new JavaScriptSerializer().Serialize(model));
     //return View();
 }
Ejemplo n.º 11
0
 public ActionResult GetWenWenAnswer(String wenwenid, int pagesize, int pageno, int createdtimeorder)
 {
     int count = (int)BiZ.WenWen.WenWenProvider.GetWenWenAnswerCount(wenwenid);
     int pagecount = count % pagesize == 0 ? (int)count / pagesize : ((int)count / pagesize) + 1;
     int nextpageno = pageno + 1;
     IList<BiZ.WenWen.WenWenAnswer> answers = BiZ.WenWen.WenWenProvider.GetWenWenAnswer(wenwenid, pagesize, pageno, createdtimeorder);
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(count, pagecount, nextpageno, answers);
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Ejemplo n.º 12
0
 public ActionResult GetNextWenWen(int page)
 {
     IList<BiZ.WenWen.WenWen> wenwens = BiZ.WenWen.WenWenProvider.GetWenWens(page, 1);
     BiZ.WenWen.WenWen obj = new BiZ.WenWen.WenWen();
     if (wenwens != null && wenwens.Count > 0)
     {
         obj = wenwens[0];
     }
     BiZ.InterestCenter.Interest interestobj = BiZ.InterestCenter.InterestFactory.GetInterest(obj.InterestID);
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(obj, interestobj);
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Ejemplo n.º 13
0
 public ActionResult GetAnswerInterest(String memberid)
 {
     IList<BiZ.InterestCenter.Interest> interests = BiZ.InterestCenter.InterestFactory.GetMemberInterest(memberid, 10, 1);
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel();
     model.interests = interests;
     return Json(new JavaScriptSerializer().Serialize(model));
 }
Ejemplo n.º 14
0
 public ActionResult AddWenWens(String id)
 {
     String userid = HttpContext.User.Identity.Name;
     int wenwencount = BiZ.WenWen.WenWenProvider.GetWenWenCount(userid);
     int wenwenanswercount = (int)BiZ.WenWen.WenWenProvider.GetWenWenAnswerForMemberCount(userid);
     BiZ.InterestCenter.Interest interest = BiZ.InterestCenter.InterestFactory.GetInterest(id);
     Models.PageModels.InterestWenWenModel model = new Models.PageModels.InterestWenWenModel(wenwencount, wenwenanswercount, interest);
     model.UserID = userid;
     model.MemberID = userid;
     model.AlreadyLogon = true;
     return View(model);
 }