Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 /// <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));
 }