示例#1
0
        public void DeleteHospitalSupply(int id)
        {
            HospitalSupply hospitalSupply = this._context.HospitalSupplies.FirstOrDefault(f => f.Id == id);

            this._context.HospitalSupplies.Remove(hospitalSupply);
            this._context.SaveChangesAsync();
        }
示例#2
0
        public HospitalSupply UpdateHospitalSupply(ref HospitalSupply hospitalSupply)
        {
            this._context.Entry(hospitalSupply).State = EntityState.Modified;
            this._context.Entry(hospitalSupply).Property("LastUpdate").CurrentValue = DateTime.Now;
            this._context.SaveChangesAsync();

            return(hospitalSupply);
        }
示例#3
0
 public ActionResult <HospitalSupply> UpdateHospitalSupply(HospitalSupply hospitalSupply)
 {
     this._serviceHospitalSupply.UpdateHospitalSupply(ref hospitalSupply);
     return(Ok(hospitalSupply));
 }
示例#4
0
 public ActionResult <HospitalSupply> CreateSupplyCategory(HospitalSupply hospitalSupply)
 {
     this._serviceHospitalSupply.CreateHospitalSupply(ref hospitalSupply);
     return(new CreatedAtRouteResult("GetHospitalSupply", new { id = hospitalSupply.Id }, hospitalSupply));
 }
示例#5
0
 public void CreateHospitalSupply(ref HospitalSupply hospitalSupply)
 {
     this._context.Add(hospitalSupply);
     this._context.SaveChangesAsync();
 }