コード例 #1
0
        public ActionResult Save(SaveVoucherHistory savemodel)
        {
            if (ModelState.IsValid)
            {
                if (savemodel.ID == null)
                {
                    var model = new VoucherHistory
                    {
                    };
                    _voucherhistoryTask.Add(model);
                }
                else
                {
                    var model = _voucherhistoryTask.GetById((int)savemodel.ID);

                    if (model == null)
                    {
                        return(AlertMsg("参数错误", HttpContext.Request.UrlReferrer.PathAndQuery));
                    }



                    _voucherhistoryTask.Update(model);
                }
                return(AlertMsg("保存成功", HttpContext.Request.UrlReferrer.PathAndQuery));
            }
            return(View(savemodel));
        }
コード例 #2
0
 public void Update(VoucherHistory model)
 {
     _dao.Update(model);
 }
コード例 #3
0
 public void Add(VoucherHistory model)
 {
     _dao.Add(model);
 }