public ActionResult SchoolPicList(int id, int page = 1) { ViewCenters c = new ViewCenters(); using (CentersServiceClient client = new CentersServiceClient()) { c = client.GetCentersById(id); } int mycount = 0; ViewBag.url = Request.Url.AbsolutePath; ViewBag.id = id; ViewBag.C = c; ViewBag.evalcount = mycount; #region 机构相册 List <ViewYogaPicture> pic = null; using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { //机构相册分类5 pic = clientpic.GetListByType(id, 5); } #endregion return(View(pic)); }
/// <summary> /// 根据uid得到图片 /// </summary> /// <param name="id"></param> /// <param name="part">记录是否显示部分相册</param> /// <returns></returns> private List <ViewYogaPicture> GetImgs(int id, string PictureName, bool part) { List <ViewYogaPicture> listPic = new List <ViewYogaPicture>(); using (YogaPictureServiceClient picclient = new YogaPictureServiceClient()) { if (part) { int piccount = 0; if (!string.IsNullOrEmpty(PictureName)) { listPic = picclient.GetBackUidList(id, PictureName); piccount = listPic.Count(); } else { listPic = picclient.GetYogaPicturePageList(id, 1, 19, out piccount); } } else { listPic = picclient.GetUidList(id); } } return(listPic); }
public YogaPictureController() { client = new YogaPictureServiceClient(); list = new List <ViewYogaPicture>(); userDetclient = new YogaUserDetailServiceClient(); userclient = new YogaUserServiceClient(); modelclient = new YogisModelsServiceClient(); }
public JsonResult picCreate() { // TODO: Add insert logic here if (!string.IsNullOrEmpty(Request.Form["Diploma"])) { //相册 string[] strPic = Request.Form["Diploma"].ToString().Split(';'); string[] strpicContent = Request.Form["PictureContent"].ToString().TrimEnd('|').Split('|'); ViewYogaPicture picModel = new ViewYogaPicture(); for (int i = 0; i < strPic.Length - 1; i++) { #region if (!string.IsNullOrEmpty(strPic[i])) { picModel.PictureOriginal = strPic[i]; picModel.Uid = Convert.ToInt32(Request.Form["centerid"]); picModel.PictureType = 6; try { picModel.PictureContent = strpicContent[i]; } catch { picModel.PictureContent = ""; } picModel.CreateTime = DateTime.Now; picModel.CreateUser = 0;//登录用户ID picModel.PictureName = ""; picModel.PictureSmall = ""; picModel.AlbumId = 0; picModel.EvaluateId = 0; picModel.Comid = 0; picModel.PictureLarge = ""; picModel.PictureMiddle = ""; picModel.PircureSize = ""; picModel.CommentCount = 0; picModel.LikeCount = 0; picModel.NotLikeCount = 0; picModel.CommentLimite = 0; picModel.LastChangeTime = DateTime.Now; picModel.HitNum = 0; using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { clientpic.Add(picModel); } } #endregion } } return(Json(new { code = 0 })); }
/// <summary> /// 根据uid得到图片 /// </summary> /// <param name="id"></param> /// <param name="part">记录是否显示部分相册</param> /// <returns></returns> private List <ViewYogaPicture> GetImgs(int id) { List <ViewYogaPicture> listPic = new List <ViewYogaPicture>(); using (YogaPictureServiceClient picclient = new YogaPictureServiceClient()) { listPic = picclient.GetListByType(id, 5); } return(listPic); }
public string DeletePicbyid(string id) { ViewYogaPicture model = new ViewYogaPicture(); int delid = 0; using (YogaPictureServiceClient clipic = new YogaPictureServiceClient()) { delid = clipic.Delete(id); } return(delid.ToString()); }
public WriteLogController() { model = new ViewtWriteLog(); client = new tWriteLogServiceClient(); list = new List <ViewtWriteLog>(); userClient = new YogaUserServiceClient(); userDetclient = new YogaUserDetailServiceClient(); modelclient = new YogisModelsServiceClient(); method = new method(); learclient = new tLearingServiceClient(); picclient = new YogaPictureServiceClient(); }
/// <summary> /// 相册 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult IndexPic(int id) { using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { List <ViewYogaPicture> pic = clientpic.GetBackUidList(id); if (pic != null) { ViewBag.Pic = pic; } } ViewBag.centerid = id; return(View()); }
public YogaGuruController() { ViewBag.user = user; client = new YogisModelsServiceClient(); clientUser = new YogaUserServiceClient(); clientMsg = new tMessageServiceClient(); clientFoll = new FollowServiceClient(); clientDetail = new YogaUserDetailServiceClient(); logClient = new tWriteLogServiceClient(); clientPic = new YogaPictureServiceClient(); dicclient = new YogaDicItemServiceClient(); zanclient = new tZanModelsServiceClient(); method = new method(); #region 登录者的级别 if (user.UserType == 0) { ViewYogaUserDetail temp = new ViewYogaUserDetail(); temp = clientDetail.GetYogaUserDetailById(user.Uid); if (temp != null) { ViewBag.level = temp.Ulevel; } } else { ViewYogisModels vyogism = new ViewYogisModels(); vyogism = client.GetYogisModelsById(user.Uid); if (vyogism != null) { ViewBag.level = vyogism.YogisLevel; } } #endregion #region 站内信-信息数量 int tinstatcount = 0; int follcount = 0; int zancount = 0; int msgcount = 0; method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount); ViewBag.tinstatcount = tinstatcount; ViewBag.follcount = follcount; ViewBag.zancount = zancount; ViewBag.msgcount = msgcount; ViewBag.AllCount = tinstatcount + follcount + zancount + msgcount; #endregion }
public YogaPicController() { ViewBag.user = user; client = new YogaPictureServiceClient(); mclient = new YogisModelsServiceClient(); yogauserclient = new YogaUserDetailServiceClient(); list = new List <ViewYogaPicture>(); wlogclient = new tWriteLogServiceClient(); classclient = new ClassServiceClient(); method = new method(); classRepotclient = new ClassReportServiceClient(); #region 登录者的级别 if (user.UserType == 0) { ViewYogaUserDetail temp = new ViewYogaUserDetail(); temp = yogauserclient.GetYogaUserDetailById(user.Uid); if (temp != null) { ViewBag.level = temp.Ulevel; ViewBag.Gender = temp.Gender; } } else { ViewYogisModels vyogism = new ViewYogisModels(); vyogism = mclient.GetYogisModelsById(user.Uid); if (vyogism != null) { ViewBag.level = vyogism.YogisLevel; ViewBag.Gender = vyogism.Gender; } } #endregion #region 站内信-信息数量 int tinstatcount = 0; int follcount = 0; int zancount = 0; int msgcount = 0; method.InstationInfo(user.Uid, out tinstatcount, out follcount, out zancount, out msgcount); ViewBag.tinstatcount = tinstatcount; ViewBag.follcount = follcount; ViewBag.zancount = zancount; ViewBag.msgcount = msgcount; ViewBag.AllCount = tinstatcount + follcount + zancount + msgcount; #endregion }
public JsonResult AddReport() { JavaScriptSerializer seria = new JavaScriptSerializer(); ViewClassReport report = seria.Deserialize <ViewClassReport>(Request.Form["data"]); ClassReportServiceClient client = new ClassReportServiceClient(); report.UserId = 0; client.Add(report); //qiqi 2015-11-23 //start 把Content中图片添加到相册YogaPicture,类型:6 YogaPictureServiceClient picclient = new YogaPictureServiceClient(); Regex rg = new Regex("src=\"([^\"]+)\"", RegexOptions.IgnoreCase); var m = rg.Match(report.Content); while (m.Success) { ViewYogaPicture picModel = new ViewYogaPicture(); picModel.PictureOriginal = m.Groups[1].Value;//这里就是图片路径 picModel.PictureType = 6; picModel.CreateTime = DateTime.Now; picModel.PictureName = "活动相册"; picModel.Uid = 100316;//管理员 picModel.CreateUser = 100316; picModel.PictureContent = "活动相册"; picModel.HitNum = 0; picModel.iAudio = 1; picModel.PictureSmall = ""; picModel.AlbumId = 0; picModel.EvaluateId = 0; picModel.Comid = 0; picModel.PictureLarge = ""; picModel.PictureMiddle = ""; picModel.PircureSize = ""; picModel.CommentCount = 0; picModel.LikeCount = 0; picModel.NotLikeCount = 0; picModel.CommentLimite = 0; picModel.LastChangeTime = DateTime.Now; picclient.Add(picModel); m = m.NextMatch(); } //end return(Json(report)); }
public ActionResult IndexPic() { // TODO: Add insert logic here if (!string.IsNullOrEmpty(Request.Form["Diploma"])) { //相册 string[] strPic = Request.Form["Diploma"].ToString().Split(';'); string[] strpicContent = Request.Form["PictureContent"].ToString().TrimEnd('|').Split('|'); ViewYogaPicture picModel = new ViewYogaPicture(); using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { for (int i = 0; i < strPic.Length - 1; i++) { #region if (!string.IsNullOrEmpty(strPic[i])) { picModel.PictureOriginal = strPic[i]; picModel.Uid = Convert.ToInt32(Request.Form["centerid"]); picModel.PictureType = 5;//机构 try { picModel.PictureContent = strpicContent[i]; } catch { picModel.PictureContent = ""; } picModel.CreateTime = DateTime.Now; picModel.CreateUser = 0;//登录用户ID picModel.PictureName = ""; picModel.PictureSmall = ""; picModel.AlbumId = 0; picModel.EvaluateId = 0; picModel.Comid = 0; picModel.PictureLarge = ""; picModel.PictureMiddle = ""; picModel.PircureSize = ""; picModel.CommentCount = 0; picModel.LikeCount = 0; picModel.NotLikeCount = 0; picModel.CommentLimite = 0; picModel.LastChangeTime = DateTime.Now; picModel.HitNum = 0; List <ViewYogaPicture> list = clientpic.GetBackUidList(Convert.ToInt32(Request.Form["centerid"])); if (list.Count() == strPic.Length - 1 && list.Count() != 0) { //edit picModel.Pid = list[i].Pid; clientpic.Update(picModel); } else if (list.Count() == 0) { clientpic.Add(picModel); } else { #region del add if (i == 0) { for (int k = 0; k < list.Count(); k++) { clientpic.Delete(list[k].Pid.ToString()); } } clientpic.Add(picModel); #endregion } } } #endregion } } using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { List <ViewYogaPicture> pic = clientpic.GetBackUidList(Convert.ToInt32(Request.Form["centerid"])); if (pic != null) { ViewBag.Pic = pic; } } ViewBag.centerid = Request.Form["centerid"]; return(View()); }
// // GET: /Mechanism/Details/5 public ActionResult Details(int id, int page = 1) { int mycount = 0; ViewBag.url = Request.Url.AbsolutePath; ViewCenters c = GetAllMechanis(id, out mycount, page); ViewBag.C = c; ViewBag.evalcount = mycount; #region 机构相册 using (YogaPictureServiceClient clientpic = new YogaPictureServiceClient()) { //机构相册分类5 List <ViewYogaPicture> pic = clientpic.GetListByType(id, 5); if (pic != null) { ViewBag.Pic = pic; } } #endregion #region 机构星级分数 using (CenterStareServiceClient client = new CenterStareServiceClient()) { int count = 0; decimal price = 0; double centerclass = 0; double env = 0; double service = 0; List <ViewCenterStare> starelist = client.GetCentersPageList(id, out count); if (starelist != null && starelist.Count != 0) { price = (from s in starelist select s.Price).Average(); centerclass = (from s in starelist select s.Centerclass).Average(); env = (from s in starelist select s.Env).Average(); service = (from s in starelist select s.Service).Average(); } ViewBag.price = price; ViewBag.centerclass = centerclass; ViewBag.env = env; ViewBag.service = service; } #endregion #region 机构活动 ClassServiceClient classclient = new ClassServiceClient(); List <ViewClass> classlist = classclient.GetClassesByZhuanYe(0, page, c.CenterId, 3); ViewBag.classlist = classlist; #endregion ViewBag.Members = Members(id); Webdiyer.WebControls.Mvc.PagedList <ViewEvaluatesGroup> l = new Webdiyer.WebControls.Mvc.PagedList <ViewEvaluatesGroup>(ViewBag.EvalInfo, page, 10, mycount); if (Request.IsAjaxRequest()) { return(PartialView("GetAllMechanis", l)); } return(View(l)); }