Beispiel #1
0
        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 }));
            }
        }
Beispiel #2
0
 protected override IActionInvoker CreateActionInvoker()
 {
     _dataobject = new DAL.SenUserCash(Request);
     this.InitData(_dataobject);
     return(base.CreateActionInvoker());
 }
Beispiel #3
0
 public ActionResult FieldChange()
 {
     DAL.SenUserCash _dataobject = new DAL.SenUserCash(Request);
     return(Json(_dataobject.FieldChange(), JsonRequestBehavior.AllowGet));
 }
Beispiel #4
0
 public ActionResult AutoComplete()
 {
     DAL.SenUserCash _dataobject = new DAL.SenUserCash(Request);
     return(Json(_dataobject.AutoComplete(), JsonRequestBehavior.AllowGet));
 }