private void JoinAssoActivity(HttpContext context) { int itemid = Convert.ToInt32(context.Request["ItemId"]); jsonModel = bll.GetEntityById(itemid); if (jsonModel.errNum == 0) { string member = context.Request["LoginUID"]; Asso_Activity item = jsonModel.retData as Asso_Activity; item.Id = itemid; if (Convert.ToDateTime(item.StartTime).Date <= DateTime.Now.Date && DateTime.Now.Date <= Convert.ToDateTime(item.EndTime).Date) { jsonModel.errNum = -1; //活动进行中 } else if (DateTime.Now.Date > Convert.ToDateTime(item.EndTime).Date) { jsonModel.errNum = -2; //活动已结束 } else { item.JoinMembers += !string.IsNullOrEmpty(item.JoinMembers) ? ("," + member) : member; jsonModel = bll.Update(item); } } }
private void BrowsingTimesSet(HttpContext context) { int itemid = Convert.ToInt32(context.Request["ItemId"]); jsonModel = bll.GetEntityById(itemid); if (jsonModel.errNum == 0) { Asso_Activity item = jsonModel.retData as Asso_Activity; item.Id = itemid; item.BrowsingTimes = item.BrowsingTimes + 1; jsonModel = bll.Update(item); } }
private void AddAssoActivity(HttpContext context) { Asso_Activity item = new Asso_Activity(); item.Id = 0; item.AssoId = Convert.ToInt32(context.Request["AssoId"]); item.Name = context.Request["Name"]; item.StartTime = Convert.ToDateTime(context.Request["StartTime"]); item.EndTime = Convert.ToDateTime(context.Request["EndTime"]); item.Address = context.Request["Address"]; item.Content = HttpUtility.UrlDecode(context.Request["Content"]); item.AttachUrl = context.Request["AttachUrl"]; item.ActivityImg = context.Request["ActivityImg"]; item.CreateUID = context.Request["LoginUID"]; jsonModel = bll.EditAssoActivity(item); }
private void EditAssoActivity(HttpContext context) { int itemid = Convert.ToInt32(context.Request["ItemId"]); jsonModel = bll.GetEntityById(itemid); if (jsonModel.errNum == 0) { Asso_Activity item = jsonModel.retData as Asso_Activity; item.Id = itemid; item.Name = context.Request["Name"]; item.StartTime = Convert.ToDateTime(context.Request["StartTime"]); item.EndTime = Convert.ToDateTime(context.Request["EndTime"]); item.Address = context.Request["Address"]; item.Content = HttpUtility.UrlDecode(context.Request["Content"]); item.AttachUrl = context.Request["AttachUrl"]; item.ActivityImg = context.Request["ActivityImg"]; item.EditUID = context.Request["LoginUID"]; jsonModel = bll.EditAssoActivity(item); } }