Example #1
0
 public ActionResult SaveOrUpdate(Account obj)
 {
     if (obj.Id > 0)
     {
         obj = this.AccountRepository.Get(obj.Id);
         TryUpdateModel(obj);
     }
     obj = this.AccountRepository.SaveOrUpdate(obj);
     return JsonSuccess(obj);
 }
Example #2
0
        public ActionResult GetAccount(int? id)
        {
            Account item = null;

            if (id.HasValue)
            {
                item = this.AccountRepository.Get(id.Value);
            }

            if (item == null )
            {
                item = new Account();
            }

            return JsonSuccess(item);
        }
Example #3
0
 public AccountModel(Account account)
 {
     this.Id = account.Id;
     this.CodeNo = account.CodeNo;
     this.Name = account.Name;
     this.CurAmount = account.CurAmount;
     this.BaseAmount = account.BaseAmount;
     this.Note = account.Note;
     this.CreateTimeString = account.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
 }
Example #4
0
 public static AccountModel From(Account account)
 {
     return new AccountModel(account);
 }