public NModel.WebPager <NModel.DB_Area> LoadData(string ipAddress, string pagename) { BLL.DB_WebConfig bllwebcfg = new BLL.DB_WebConfig(); BLL.DB_Area bllArea = new BLL.DB_Area(); NModel.DB_WebConfig modelwebcfg = bllwebcfg.GetCodeModel(pagename); NModel.WebPager <NModel.DB_Area> model_pager = new NModel.WebPager <NModel.DB_Area>(); // model_pager.OutStr = Tool.NWeb.GetAddresByIp(ipAddress); string gocityName = Tool.NTool.GetCookieValue("gocityName"); if (!string.IsNullOrEmpty(gocityName)) { model_pager.OutStr = this.Server.UrlDecode(gocityName); } if (string.IsNullOrEmpty(model_pager.OutStr)) { model_pager.OutStr = "广州"; } // model_pager.OutObj = bllArea.GetListByName(model_pager.OutStr + "%"); model_pager.OutWebConfig = modelwebcfg != null ? modelwebcfg : new NModel.DB_WebConfig(); BLL.DB_Link bll_link = new BLL.DB_Link(); IList <NModel.DB_Link> List_link = bll_link.GetListByNumAndTop("1", 20); model_pager.IDictLink.Add("招聘友情链接", List_link); bll_link.Close(); bllArea.Close(); bllwebcfg.Close(); return(model_pager); }
public ActionResult Edit_DB_WebConfig() { this.Response.ContentType = "text/plain"; NModel.DB_WebConfig model = new NModel.DB_WebConfig(); BLL.DB_WebConfig dal = new BLL.DB_WebConfig(); String JsonStr = ""; bool isGet = Tool.NStr.PostForSetVal <NModel.DB_WebConfig>(ref model, ref JsonStr, ""); // 下面代码编写 if (isGet && //&& !string.IsNullOrEmpty(model.WebConfig_Code) && // !string.IsNullOrEmpty(model.WebConfig_Title) && ! // string.IsNullOrEmpty(model.WebConfig_Keywords) && // !string.IsNullOrEmpty(model.WebConfig_Description) && //// !string.IsNullOrEmpty(model.File_Category_Size)&& (model.WebConfig_ID > 0) ) { //取默认值 model.WebConfig_EditTime = DateTime.Parse(DateTime.Now.ToString("s")); bool isEdit = dal.EditFree(model, (long)model.WebConfig_ID) > 0 ? true : false; string msg = dal.ErrorMsg; if (!string.IsNullOrEmpty(msg)) { msg = "原因:" + msg; } if (isEdit) { this.Response.Write(Tool.NMsg.SetMsg("修改成功", "1")); this.Response.End(); } else { this.Response.Write(Tool.NMsg.SetMsg("修改失败" + msg, "0")); this.Response.End(); } dal.Close(); } else { this.Response.Write(Tool.NMsg.SetMsg("提交失败", "0")); this.Response.End(); } return(View()); }
//end public ActionResult Add_DB_WebConfig() { this.Response.ContentType = "text/plain"; NModel.DB_WebConfig model = new NModel.DB_WebConfig(); BLL.DB_WebConfig dal = new BLL.DB_WebConfig(); String JsonStr = ""; bool isGet = Tool.NStr.PostForSetVal <NModel.DB_WebConfig>(ref model, ref JsonStr, ""); // 下面代码编写 if (isGet //&& !string.IsNullOrEmpty(model.WebConfig_Code) && // !string.IsNullOrEmpty(model.WebConfig_Description) // &&!string.IsNullOrEmpty(model.WebConfig_Title) //&&!string.IsNullOrEmpty(model.WebConfig_Keywords ) { { model.WebConfig_EditTime = DateTime.Parse(DateTime.Now.ToString("s")); model.WebConfig_AddTime = DateTime.Parse(DateTime.Now.ToString("s")); // bool isAdd = dal.AddFree(model) > 0 ? true : false; if (isAdd) { this.Response.Write(Tool.NMsg.SetMsg("增加成功", "1")); this.Response.End(); } else { this.Response.Write(Tool.NMsg.SetMsg("增加失败" + dal.ErrorMsg, "1")); this.Response.End(); } } } else { this.Response.Write(Tool.NMsg.SetMsg("提交失败", "0")); } dal.Close(); return(View()); }
public NModel.NewsPager LoadConfig(string pagename, string linknum = "1", string linkdictName = "友情链接") { BLL.DB_WebConfig bllwebcfg = new BLL.DB_WebConfig(); NModel.DB_WebConfig modelwebcfg = bllwebcfg.GetCodeModel(pagename); NModel.NewsPager model_pager = new NModel.NewsPager(); bllwebcfg.Close(); model_pager.OutWebConfig = modelwebcfg != null ? modelwebcfg : new NModel.DB_WebConfig(); BLL.DB_Link bll_link = new BLL.DB_Link(); IList <NModel.DB_Link> List_link = bll_link.GetListByNumAndTop(linknum, 20); model_pager.IDictLink.Add(linkdictName, List_link); bll_link.Close(); return(model_pager); }