public IHttpActionResult Post_Create_MoneyIncome([FromBody] m_MoneyInCome requset) { try { var res = _MoneyIncome.CreateMoneyIncom(requset); return(Json(res)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public MoneyIncom CreateMoneyIncom(m_MoneyInCome input) { var res = db.MoneyIncoms.Add(new MoneyIncom { user_id = input.user_id, member_id = input.member_id, paid = input.paid, Create_dt = DateTime.Now }); int save = db.SaveChanges(); if (save > 0) { return(res); } return(null); }