Example #1
0
        /// <summary>
        /// Xóa đối tượng theo id
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id"></param>
        /// <returns></returns>
        /// Created by: nvcuong (05/03/2018)
        public int DeleteEntityById(object id)
        {
            string storeName = GenerateProcUtility <T> .DeleteEntityByPrimaryKey();

            var    entity    = Activator.CreateInstance <T>();
            string tableName = entity.GetType().Name;

            return(Delete(storeName, new object[] { id }));
        }
Example #2
0
        /// <summary>
        /// Xóa đối tượng theo với nhiều tham số đầu vào
        /// </summary>
        /// <typeparam name="T">entiy</typeparam>
        /// <param name="param">mảng các tham số truyền vào</param>
        /// <returns></returns>
        /// Created by: nvcuong (05/03/2018)
        public int DeleteEntity_ByMultiParam(object[] param)
        {
            string strProc = GenerateProcUtility <T> .DeleteEntityByPrimaryKey();

            var    entity    = Activator.CreateInstance <T>();
            string tableName = entity.GetType().Name;

            return(Delete(strProc, new object[] { param }));
        }
Example #3
0
        public int DeleteMenuGroups(string groupID)
        {
            string storeName = GenerateProcUtility <MenuGroup> .DeleteEntityByPrimaryKey();

            return(DeleteFood(storeName, groupID));
        }
Example #4
0
 /// <summary>
 /// Xóa entity
 /// </summary>
 /// <param name="entity">Entity cần xóa (hàm chưa hoàn chỉnh)</param>
 /// <returns></returns>
 /// Created by: nvcuong (17/04/2017)
 public virtual int Delete()
 {
     return(base.Delete(GenerateProcUtility <T> .DeleteEntityByPrimaryKey(), new object[] { }));
 }