/// <summary> /// Create a new StoreCategory object. /// </summary> /// <param name="categoryID">Initial value of the CategoryID property.</param> /// <param name="portalID">Initial value of the PortalID property.</param> /// <param name="displayOrder">Initial value of the DisplayOrder property.</param> /// <param name="createDate">Initial value of the CreateDate property.</param> /// <param name="name">Initial value of the Name property.</param> public static StoreCategory CreateStoreCategory(global::System.Int32 categoryID, global::System.Int32 portalID, global::System.Int32 displayOrder, global::System.DateTime createDate, global::System.String name) { StoreCategory storeCategory = new StoreCategory(); storeCategory.CategoryID = categoryID; storeCategory.PortalID = portalID; storeCategory.DisplayOrder = displayOrder; storeCategory.CreateDate = createDate; storeCategory.Name = name; return storeCategory; }
/// <summary> /// Deprecated Method for adding a new object to the StoreCategories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToStoreCategories(StoreCategory storeCategory) { base.AddObject("StoreCategories", storeCategory); }
public static void Insert(Hashtable values) { int _ParentCategoryId = 0; if (values["ParentCategoryId"].ToString() != "") { _ParentCategoryId = int.Parse(values["ParentCategoryId"].ToString()); } DAL.StoreCategory S = new DAL.StoreCategory { Name = values["Name"].ToString(), ParentCategoryId = _ParentCategoryId, Deleted = bool.Parse(values["Deleted"].ToString()), CreateDate = DateTime.Now, PortalID = Category.PortalID, DisplayOrder = GetMaxDisplayOrder() + 1, IsMenu = bool.Parse(values["IsMenu"].ToString()) }; Utils.DbContext.AddToStoreCategories(S); Utils.DbContext.SaveChanges(); if (_ParentCategoryId == 0) { _ParentCategoryId = S.CategoryID; S.ParentCategoryId = _ParentCategoryId; Utils.DbContext.SaveChanges(); } }