//public DataTable SelBy(int status, string flow, string skey) //{ // List<SqlParameter> sp = new List<SqlParameter>(); // string where = "1=1 "; // if (status != -100) { where += " AND Status=" + status; } // if (!string.IsNullOrEmpty(skey)) { where += " AND Tittle LIKE @skey"; sp.Add(new SqlParameter("skey", "%" + skey + "%")); } // if (!string.IsNullOrEmpty(flow)) { where += " AND Flow =@flow"; sp.Add(new SqlParameter("flow", flow)); } // return DBCenter.Sel(TbName, where, PK + " DESC", sp); //} /// <summary> /// 使用该版词条替代原有的词条 /// </summary> public void Apply(int id) { B_Baike bkBll = new B_Baike(); M_BaikeEdit source = SelReturnModel(id); M_Baike target = bkBll.SelModelByFlow(source.Flow); ConverToEdit(target, source, "all"); target.Status = 1; bkBll.UpdateByID(target); }
public IActionResult BKEditor_Add() { M_Baike bkMod = GetModel_Editor(ref err); M_BaikeEdit editMod = new M_BaikeEdit(); if (!string.IsNullOrEmpty(err)) { return(WriteErr(err)); } bkMod.Contents = Request.Form["Contents_T"]; bkMod.Brief = Request.Form["Brief_T"]; bkMod.BriefImg = Request.Form["pic_hid"]; bkMod.Extend = Request.Form["info_hid"]; bkMod.Reference = Request.Form["refence_hid.Value"]; bkMod.UpdateTime = DateTime.Now; bkMod.Classification = Request.Form["class_hid"]; //bkMod.Editnumb++; bkMod.Btype = RequestEx["BType_T"].Replace(" ", ""); if (bkMod.ID < 1)//新建百科(新百科也需要管理员审核) { bkMod.Status = (int)ZLEnum.ConStatus.UnAudit; bkMod.UserId = mu.UserID; bkMod.UserName = mu.UserName; bkMod.Tittle = Tittle; bkMod.ID = bkBll.insert(bkMod); editBll.ConverToEdit(editMod, bkMod, "all"); editBll.Insert(editMod); //function.WriteSuccessMsg("创建百科成功", "/Baike/Details?ID=" + bkMod.ID); } else if (EditID > 0) //修改自己填的未审核百科 { editMod = editBll.SelReturnModel(EditID); editBll.ConverToEdit(editMod, bkMod, "all"); editBll.UpdateByID(editMod); } else if (Mid > 0) //存为新的版本,待审核,并跳至用户中心处 { editBll.ConverToEdit(editMod, bkMod); editMod.Status = (int)ZLEnum.ConStatus.UnAudit; editMod.UserId = mu.UserID; editMod.UserName = mu.UserName; editMod.OldID = Mid; editBll.Insert(editMod); } else { return(WriteErr("保存条件不正确")); } return(WriteOK("操作成功,请等待管理员审核", "/User/Guest/BaikeContribution")); }
public IActionResult CompBaike() { M_BaikeEdit editMod = editBll.SelReturnModel(EditID); M_Baike bkMod = bkBll.SelModelByFlow(editMod.Flow); if (bkMod == null) { bkMod = new M_Baike(); } if (editMod == null) { editMod = new M_BaikeEdit(); } ViewBag.editMod = editMod; return(View(bkMod)); }
protected void MyBind() { M_Baike bkMod = bkBll.SelReturnModel(Mid); if (bkMod == null) { function.WriteErrMsg("该词条不存在!"); } M_BaikeEdit editMod = new M_BaikeEdit(); if (EditID > 0)//版本预览模式(指定一个版本记录的id查看详情) { editMod = editBll.SelReturnModel(EditID); if (editMod == null) { function.WriteErrMsg("该词条不存在或审核未通过!"); } if (b_User.GetLogin().UserID != editMod.UserId && !badmin.CheckLogin()) { function.WriteErrMsg("您没有权限查看此词条信息!"); } } Contents_div.InnerHtml = bkMod.Contents; tittle_sp.InnerText = bkMod.Tittle; cate_sp.InnerText = "( " + bkMod.Classification + " )"; Brief_L.Text = bkMod.Brief; if (string.IsNullOrEmpty(bkMod.BriefImg)) { pic_div.Visible = false; } else { pic_img.Src = bkMod.BriefImg; } info_hid.Value = bkMod.Extend; refence_hid.Value = bkMod.Reference; //词条标签 string[] btypeArr = bkMod.Btype.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (string item in btypeArr) { BType_L.Text += "<a href='/Guest/Baike/Search.aspx?btype=" + HttpUtility.UrlEncode(item) + "' class='btype_a' target='_blank'>" + item + "</a>"; } }
public bool UpdateByID(M_BaikeEdit model) { return(DBCenter.UpdateByID(model, model.ID)); }
public int Insert(M_BaikeEdit model) { return(DBCenter.Insert(model)); }