public void InsertSecCategory(SecCategory secCategory)
 {
     try
     {
         mSecCategoryRepository.InsertSecCategory(secCategory, true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void InsertSecCategory(SecCategory secondCategory, bool isImmediateSave)
        {
            try
            {
                mContext.SecCategories.AddObject(secondCategory);

                if (isImmediateSave)
                {
                    mContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                // TODO: Add exception handling code here.
            }
        }
        public void UpdateSecCategory(SecCategory newSecondCategory, SecCategory origSecondCategory, bool isImmediateSave)
        {
            try
            {
                mContext.SecCategories.Attach(origSecondCategory);
                mContext.ApplyCurrentValues("SecCategories", newSecondCategory);

                if (isImmediateSave)
                {
                    mContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                // TODO: Add exception handling code here.
            }
        }
        public void DeleteSecCategory(SecCategory secondCategory, bool isImmediateSave)
        {
            try
            {
                mContext.SecCategories.Attach(secondCategory);
                mContext.SecCategories.DeleteObject(secondCategory);

                if (isImmediateSave)
                {
                    mContext.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                // TODO: Add exception handling code here.
                throw ex;
            }
        }
 public void UpdateSecCategory(SecCategory secCategory, SecCategory origSecCategory)
 {
     try
     {
         mSecCategoryRepository.UpdateSecCategory(secCategory, origSecCategory, true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 /// <summary>
 /// 用于向 SecCategories EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToSecCategories(SecCategory secCategory)
 {
     base.AddObject("SecCategories", secCategory);
 }
 /// <summary>
 /// 创建新的 SecCategory 对象。
 /// </summary>
 /// <param name="secCategoryID">secCategoryID 属性的初始值。</param>
 /// <param name="categoryID">categoryID 属性的初始值。</param>
 /// <param name="secCategoryName">secCategoryName 属性的初始值。</param>
 public static SecCategory CreateSecCategory(global::System.Int32 secCategoryID, global::System.Int32 categoryID, global::System.String secCategoryName)
 {
     SecCategory secCategory = new SecCategory();
     secCategory.secCategoryID = secCategoryID;
     secCategory.categoryID = categoryID;
     secCategory.secCategoryName = secCategoryName;
     return secCategory;
 }