コード例 #1
0
        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("数据操作失败!")));
        }
コード例 #2
0
        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("数据操作失败!")));
        }
コード例 #3
0
        public void UpdateEntity(GX_XLZX gxXlzx)
        {
            GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw);

            gxXlzxRepository.UpdateEntity(gxXlzx);
        }
コード例 #4
0
        public void DeleteEntity(GX_XLZX gxXlzx)
        {
            GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw);

            gxXlzxRepository.DeleteEntity(gxXlzx);
        }
コード例 #5
0
        public void AddEntity(GX_XLZX gxXlzx)
        {
            GxXlzxRepository gxXlzxRepository = new GxXlzxRepository(uw);

            gxXlzxRepository.AddEntity(gxXlzx);
        }