public ActionResult AddCash(Guid UserId, FormCollection formcontext) { try { var _senuserobject = new DAL.SenUser(Request); var _senusercashobject = new DAL.SenUserCash(Request); decimal amount = Services.ExConvert.String2Decimal(formcontext["Amount"]); _senuserobject.AddCash(UserId, amount); var senusercash = _senusercashobject.GetNew(null); senusercash.UserId = UserId; senusercash.VoucherDate = DateTime.UtcNow; senusercash.CreateDate = DateTime.UtcNow; senusercash.Amount = amount; senusercash.Description = "Ứng tiền"; senusercash.CashType = 0; senusercash.UserName = User.Identity.Name; _senusercashobject.Insert(senusercash); #region email thong bao #endregion if (this.Request["action_return"] != null) { return(Redirect(this.Request["action_return"])); } return(Json(new { ketqua = "success" })); } catch (Exception ex) { ModelState.AddModelError("sumerror", "Lỗi."); if (this.Request["action_return"] != null) { return(Redirect(this.Request["action_return"])); } //return Content("failed"); return(Json(new { ketqua = ex.Message })); } }
public ActionResult Create(int?UserCashId) { return(PartialView(this._updateview, _dataobject.GetNew(UserCashId))); }