/// <summary> /// delete by primary key /// </summary> /// <param name="keys">primary key</param> /// <returns>true for succesfully deleted</returns> public bool Delete(CHITIETNHAPKeys keys) { CHITIETNHAP a = GetAllEntities().ToList().Where(p => p.ID == keys.ID).FirstOrDefault(); bool ans; ans = _dataObject.Delete(keys); try { NHAPTHUOCFactory NHAPTHUOCService = new NHAPTHUOCFactory(); NHAPTHUOC nhapthuoc = NHAPTHUOCService.GetAllEntities().ToList() .Where(p => p.ID == a.NHAPTHUOCID) .FirstOrDefault(); NHAPTHUOCService.Update(nhapthuoc); } catch { } return(ans); }
/// <summary> /// get CHITIETNHAP by primary key. /// </summary> /// <param name="keys">primary key</param> /// <returns>Student</returns> public CHITIETNHAP GetByPrimaryKey(CHITIETNHAPKeys keys) { return(_dataObject.SelectByPrimaryKey(keys)); }