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