public ActionResult Add(string RoleName, string RoleDesc) { T_RoleInfo model = new T_RoleInfo(); model.id = StringHelper.GetGuid(); model.RoleName = RoleName; model.RoleDesc = RoleDesc; model.CreateDate = DateTime.Now; try { rolebll.Add(model); return(Json(new { success = true, msg = "操作成功" })); } catch { return(Json(new { success = false, msg = "操作失败" })); } }
public ActionResult Edit(string id, string RoleName, string RoleDesc) { T_RoleInfo model = rolebll.GetById(id); model.RoleName = RoleName; model.RoleDesc = RoleDesc; model.CreateDate = DateTime.Now; try { if (rolebll.Update(model)) { return(Json(new { success = true, msg = "操作成功" })); } else { return(Json(new { success = false, msg = "操作失败" })); } } catch { return(Json(new { success = false, msg = "操作失败" })); } }
/// <summary> /// 编辑 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Edit(string id) { T_RoleInfo model = rolebll.GetById(id); return(View(model)); }
/// <summary> /// 更新实体 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(T_RoleInfo model) { return(dal.Update(model)); }
/// <summary> /// 删除实体 /// </summary> /// <param name="id"></param> /// <returns></returns> public bool Delete(T_RoleInfo model) { return(dal.Delete(model)); }
/// <summary> /// 插入一条记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public void Add(T_RoleInfo model) { dal.Add(model); }