public ActionResult SaveUpLoadCenter(UpLoadCenterEntity UpLoad) { try { if (Session["UpLoadUrl"] == null) { int begin = UpLoad.UpLoadUrl.IndexOf("/Images"); if (begin < 0) { UpLoad.UpLoadUrl = ""; } else { UpLoad.UpLoadUrl = UpLoad.UpLoadUrl.Substring(begin); } } else { UpLoad.UpLoadUrl = Session["UpLoadUrl"].ToString(); } string type = System.IO.Path.GetExtension(UpLoad.UpLoadUrl); UpLoad.UpLoadType = type.Split('.')[1]; var result = new BaseSetBC().SaveUpLoadCenter(UpLoad, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
//public ActionResult GetArticleImage(string id) //{ // try // { // return Json(new BaseSetBC().GetArticleImage(id), JsonRequestBehavior.AllowGet); // } // catch (Exception ex) // { // return Json(new List<VMImages>(), JsonRequestBehavior.AllowGet); // } //} public ActionResult SaveArticle(ArticleEntity Article) { try { //if (Session["ArticleImgUrl"] == null ) //{ // int begin = Article.ImageUrl.IndexOf("/Images"); // if (begin < 0) // { // Article.ImageUrl = ""; // } // else // { // Article.ImageUrl = Article.ImageUrl.Substring(begin); // } //} //else //{ // Article.ImageUrl = Session["ArticleImgUrl"].ToString(); //} var result = new BaseSetBC().SaveArticle(Article, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
public ActionResult SaveGroupBuyConfig(GroupBuyConfigEntity entity, string loginName) { try { BaseSetBC bc = new BaseSetBC(); //校验该课程是否已经有配置过 var vaild = bc.GetGroupBuyConfigByClassId(entity.ClassId); if (vaild != null && string.IsNullOrEmpty(entity.GroupBuyConfigId)) { return(Json("该课程已存在配置,无需配置")); } var result = bc.SaveGroupBuyConfig(entity, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
/// <summary> /// 根据键值key获取items /// </summary> /// <param name="key"></param> /// <returns></returns> public ActionResult GetDicItemsByDicKey(string key) { try { var result = new BaseSetBC().GetDicItemsByDicKey(key); return(Json(new BaseSetBC().GetDicItemsByDicKey(key), JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new List <DictionaryItemEntity>(), JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 获取所有首页图片 /// </summary> /// <returns></returns> public ActionResult GetAllIndexImages() { try { var result = new BaseSetBC().GetAllIndexImages(); result = result.Take(5).ToList(); return(Json(result, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new List <IndexImageEntity>(), JsonRequestBehavior.AllowGet)); } }
public ActionResult JobInfoDetail(string openid, string jobId) { ViewBag.Openid = openid; JobEntity entity = new JobEntity(); try { entity = new BaseSetBC().GetJobInfoByKey(jobId); } catch (Exception ex) { } return(View(entity)); }
public ActionResult SavePublicFunds(PublicFundsEntity entity) { try { var result = new BaseSetBC().SavePublicFunds(entity, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
public ActionResult SaveCompanyInfo(CompanyEntity company) { try { var result = new BaseSetBC().SaveCompanyInfo(company, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
/// <summary> /// 保存招聘信息 /// </summary> /// <param name="job"></param> /// <param name="loginName"></param> /// <returns></returns> public ActionResult SaveJobInfo(JobEntity job, string loginName) { try { var result = new BaseSetBC().SaveJobInfo(job, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
public ActionResult SaveHelpConfig(HelpConfigEntity entity, string loginName) { try { //if (Session["HelpImgUrl"] == null) //{ // int begin = entity.ImageUrl.IndexOf("/Images"); // if (begin < 0) // { // entity.ImageUrl = ""; // } // else // { // entity.ImageUrl = entity.ImageUrl.Substring(begin); // } //} //else //{ // entity.ImageUrl = Session["HelpImgUrl"].ToString(); //} BaseSetBC bc = new BaseSetBC(); //校验该课程是否已经有配置过 var vaild = bc.GetHelpConfigByClassId(entity.ClassId); if (vaild != null && string.IsNullOrEmpty(entity.HelpConfigId)) { return(Json("该课程已存在配置,无需配置")); } var result = bc.SaveHelpConfig(entity, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
public ActionResult SaveDicItem(DictionaryItemEntity dicItem, string loginName) { try { BaseSetBC bc = new BaseSetBC(); //根据DictionaryKey获取level var result = bc.SaveDicItem(dicItem, CurrentUserInfo.Account); if (result == 0) { return(Json(string.Empty)); } return(Json("保存成功")); } catch (Exception ex) { return(Json(string.Empty)); } }
public ActionResult GetLikeByOpenidAndId(string openid, string id) { try { var result = new BaseSetBC().GetLikeByOpenidAndId(openid, id); if (result == null) { return(Json(new LikeLogEntity(), JsonRequestBehavior.AllowGet)); } else { return(Json(result, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new LikeLogEntity(), JsonRequestBehavior.AllowGet)); } }
public ActionResult EnableArticle(string ArticleId, int status) { try { if (string.IsNullOrEmpty(ArticleId)) { return(Json(string.Empty)); } var result = new BaseSetBC().EnableArticle(ArticleId, status); if (result > 0) { return(Json("更新成功", JsonRequestBehavior.AllowGet)); } else { return(Json(string.Empty, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(string.Empty, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetDicInfoList(string key) { List <DictionaryInfo> DicList = new List <DictionaryInfo>(); List <DictionaryItemEntity> result = new BaseSetBC().GetAllDicKey(); List <DictionaryItemEntity> Level1 = result.Where(p => p.ItemId == key).ToList(); List <Cascader> cascader = new List <Cascader>(); foreach (var item in Level1) { DictionaryInfo model = new DictionaryInfo() { ItemId = item.ItemId, ItemKey = item.ItemKey, ItemValue = item.ItemValue, DictionaryKey = item.DictionaryKey, DictionaryLevel = item.DictionaryLevel }; Cascader ca = new Cascader() { id = item.ItemId, value = item.ItemKey, label = item.ItemValue, }; var result1 = result.Where(p => p.DictionaryKey == item.ItemId).ToList(); if (result1 != null && result1.Count > 0) { List <DictionaryInfo> nodes1 = new List <DictionaryInfo>(); List <Cascader> cascader1 = new List <Cascader>(); foreach (var i in result1) { DictionaryInfo model1 = new DictionaryInfo() { ItemId = i.ItemId, ItemKey = i.ItemKey, ItemValue = i.ItemValue, DictionaryKey = i.DictionaryKey, DictionaryLevel = i.DictionaryLevel }; Cascader ca1 = new Cascader() { id = i.ItemId, value = i.ItemKey, label = i.ItemValue, }; var result2 = result.Where(p => p.DictionaryKey == i.ItemId).ToList(); if (result2 != null && result2.Count > 0) { List <DictionaryInfo> nodes2 = new List <DictionaryInfo>(); List <Cascader> cascader2 = new List <Cascader>(); foreach (var j in result2) { DictionaryInfo model2 = new DictionaryInfo() { ItemId = j.ItemId, ItemKey = j.ItemKey, ItemValue = j.ItemValue, DictionaryKey = j.DictionaryKey, DictionaryLevel = j.DictionaryLevel }; Cascader ca2 = new Cascader() { id = j.ItemId, value = j.ItemKey, label = j.ItemValue, }; nodes2.Add(model2); cascader2.Add(ca2); } model1.SubDic = nodes2; ca1.children = cascader2; } nodes1.Add(model1); cascader1.Add(ca1); } model.SubDic = nodes1; ca.children = cascader1; } DicList.Add(model); cascader.Add(ca); } DicList = DicList.Where(p => p.ItemId == key).ToList(); cascader = cascader.Where(p => p.id == key).ToList(); return(Json(cascader, JsonRequestBehavior.AllowGet)); }