public ActionResult Add(FormCollection form, GX_XLZX gxXlzx) { gxXlzx.ID = new Common().GetRandom(); gxXlzx.NAME = form["name"]; gxXlzx.ROLEID = ConvertUtility.ToDecimal(form["roleId"]); gxXlzx.CREATEBY = CurrentUser.UserName; gxXlzx.CREATETIME = DateTime.Now; gxXlzxBusiness.AddEntity(gxXlzx); return(Json(gxXlzxBusiness.SaveChange() > 0 ? AjaxResult.Error("数据操作成功!") : AjaxResult.Error("数据操作失败!"))); }
public ActionResult Edit(FormCollection form, GX_XLZX gxXlzx) { decimal id = ConvertUtility.ToDecimal(form["Id"]); var model = gxXlzxBusiness.Find(id); if (model == null) { return(Json(AjaxResult.Error("未找到需要更新的数据!"))); } gxXlzx.NAME = form["name"]; gxXlzx.ROLEID = ConvertUtility.ToDecimal(form["roleId"]); gxXlzx.CREATEBY = model.CREATEBY; gxXlzx.CREATETIME = model.CREATETIME; gxXlzx.MODIFYBY = CurrentUser.UserName; gxXlzx.MODIFYTIME = DateTime.Now; gxXlzxBusiness.UpdateEntity(gxXlzx); return(Json(gxXlzxBusiness.SaveChange() > 0 ? AjaxResult.Error("数据操作成功!") : AjaxResult.Error("数据操作失败!"))); }
public void UpdateEntity(GX_XLZX gxXlzx) { GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw); gxXlzxRepository.UpdateEntity(gxXlzx); }
public void DeleteEntity(GX_XLZX gxXlzx) { GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw); gxXlzxRepository.DeleteEntity(gxXlzx); }
public void AddEntity(GX_XLZX gxXlzx) { GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw); gxXlzxRepository.AddEntity(gxXlzx); }