public virtual void Edit(long id) { target(Update, id); FileLang pf = FileLang.GetById(id); set("Name", pf.Name); }
public void Edit(int id) { target(Update, id); FileLang pf = FileLang.GetById(id); set("Name", pf.Name); }
public virtual void Delete(long id) { FileLang f = FileLang.GetById(id); if (f != null) { f.delete(); redirect(List); } }
public void Delete(int id) { FileLang f = FileLang.GetById(id); if (f != null) { f.delete(); redirect(List); } }
public virtual void Update(long id) { string name = ctx.Post("Name"); if (strUtil.IsNullOrEmpty(name)) { echoError("请填写名称"); return; } FileLang pf = FileLang.GetById(id); pf.Name = name; pf.update(); echoToParentPart(lang("opok")); }
public void Update(int id) { string name = ctx.Post("Name"); if (strUtil.IsNullOrEmpty(name)) { errors.Add("请填写名称"); run(Edit, id); return; } FileLang pf = FileLang.GetById(id); pf.Name = name; pf.update(); echoRedirect(lang("opok"), List); }
public virtual void SaveSort() { long id = ctx.PostLong("id"); String cmd = ctx.Post("cmd"); FileLang data = FileLang.GetById(id); List <FileLang> list = FileLang.GetAll(); if (cmd == "up") { new SortUtil <FileLang>(data, list).MoveUp(); echoRedirect("ok"); } else if (cmd == "down") { new SortUtil <FileLang>(data, list).MoveDown(); echoRedirect("ok"); } else { echoError(lang("exUnknowCmd")); } }