Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string redirect = "";

        try
        {
            m_Categories     = new Categories(WEB_CONSTR);
            m_CategoryStatus = new CategoryStatus(WEB_CONSTR);
            IpAddress        = Request.UserHostAddress;
            ActUserId        = MyConstants.ActUserId;
            if (ActUserId > 0)
            {
                if (!IsPostBack)
                {
                    bindData(-1);
                }
            }
            else
            {
                redirect = MyConstants.PRJ_ROOT + "/Login.aspx";
            }
        }
        catch (Exception ex)
        {
            LogFiles.WriteLog(ex.Message, LogFilePath + "\\Exception", LogFileName + "." + this.GetType().Name + "." + MethodBase.GetCurrentMethod().Name);
        }
        if (!string.IsNullOrEmpty(redirect))
        {
            Response.Redirect(redirect);
        }
    }
Beispiel #2
0
        public async Task <ApiResult <bool> > Updatestatus(int CategoryId, CategoryStatus status)
        {
            var category = await _context.Categories.FindAsync(CategoryId);

            if (category == null)
            {
                return(new ApiResultErrors <bool>($"Cannot find a category with id: {CategoryId}"));
            }
            category.Status = status;
            try
            {
                var change = await _context.SaveChangesAsync();

                if (change > 0)
                {
                    return(new ApiResultSuccess <bool>());
                }
                else
                {
                    return(new ApiResultErrors <bool>("Update faild"));
                }
            }
            catch (Exception ex)
            {
                return(new ApiResultErrors <bool>(ex.InnerException.Message));
            }
        }
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the value to convert into an instance of <see cref="CategoryStatus" />.</param>
 /// <returns>
 /// an instance of <see cref="CategoryStatus" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public static object ConvertFrom(dynamic sourceValue)
 {
     if (null == sourceValue)
     {
         return(null);
     }
     try
     {
         CategoryStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());
     }
     catch
     {
         // Unable to use JSON pattern
     }
     try
     {
         return(new CategoryStatus
         {
             ApiVersion = sourceValue.ApiVersion,
             Code = sourceValue.Code,
             Kind = sourceValue.Kind,
             MessageList = sourceValue.MessageList,
             State = sourceValue.State,
         });
     }
     catch
     {
     }
     return(null);
 }
Beispiel #4
0
        public async Task <IActionResult> UpdatePrice(int categoryId, CategoryStatus status)
        {
            var result = await _CategoryService.Updatestatus(categoryId, status);

            if (result.IsSuccessed == false)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
 public Category(int id, string codeName, string fullName, string parentCategoryCodeName, CategoryType categoryType, CategoryStatus status, IList <Category> subCategories, long?count)
 {
     Id       = id;
     CodeName = codeName;
     FullName = fullName;
     ParentCategoryCodeName = parentCategoryCodeName;
     CategoryType           = categoryType;
     Status        = status;
     SubCategories = subCategories ?? new List <Category>();
     Count         = count ?? 0;
 }
Beispiel #6
0
        public static string GetCategoryTypeImgUrl(CategoryStatus status)
        {
            if (status == CategoryStatus.Active)
            {
                return("images/on.gif");
            }
            else if (status == CategoryStatus.Deactive)
            {
                return("images/off.gif");
            }

            return("");
        }
Beispiel #7
0
        public static int InsertCategory(string CategoryName, string CategoryDesc, CategoryStatus status, int UserID)
        {
            ForumCategory mCategory = new ForumCategory();

            mCategory.CategoryName   = CategoryName;
            mCategory.CategoryDesc   = CategoryDesc;
            mCategory.CategoryStatus = (int)status;
            mCategory.CreateDate     = DateTime.Now;
            mCategory.LastPost       = "Yazý yok ...";
            mCategory.CreatedBy      = UserID;
            mCategory.ArticlesCount  = 0;

            mCategory.Save();

            return(mCategory.CategoryID);
        }
Beispiel #8
0
        public static DataTable GetCategories(CategoryStatus status)
        {
            ForumCategory FCategory = new ForumCategory();

            if (status != CategoryStatus.All)
            {
                FCategory.CategoryStatus = (int)status;
            }

            DataTable dt = FCategory.LoadByParams().Tables[0];

            dt.DefaultView.Sort = "Order ASC";
            dt = dt.DefaultView.ToTable();

            return(dt);
        }
    public static string LocalizedName(this CategoryStatus self)
    {
        switch (self)
        {
        case CategoryStatus.Active:
            return(localizedNames[0]);

            break;

        case CategoryStatus.Inactive:
            return(localizedNames[1]);

            break;
        }
        return(null);
        //int index = (int)self - 1;
        //return localizedNames[index];
    }
Beispiel #10
0
 public static string GetCategoryStatusDesc(CategoryStatus status)
 {
     return(CategoryStatusDesc[(int)status]);
 }
 public Category(int id, string codeName, string fullName, CategoryType categoryType, CategoryStatus status, IList <Category> subCategories, long?count) : this(id, codeName, fullName, null, categoryType, status, subCategories, count)
 {
 }
 public Category(int id, string codeName, string fullName, CategoryType categoryType, CategoryStatus status) : this(id, codeName, fullName, null, categoryType, status, null, null)
 {
 }
 public Category(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = ParseInt(node["id"].Value <string>());
     }
     if (node["parentId"] != null)
     {
         this._ParentId = ParseInt(node["parentId"].Value <string>());
     }
     if (node["depth"] != null)
     {
         this._Depth = ParseInt(node["depth"].Value <string>());
     }
     if (node["partnerId"] != null)
     {
         this._PartnerId = ParseInt(node["partnerId"].Value <string>());
     }
     if (node["name"] != null)
     {
         this._Name = node["name"].Value <string>();
     }
     if (node["fullName"] != null)
     {
         this._FullName = node["fullName"].Value <string>();
     }
     if (node["fullIds"] != null)
     {
         this._FullIds = node["fullIds"].Value <string>();
     }
     if (node["entriesCount"] != null)
     {
         this._EntriesCount = ParseInt(node["entriesCount"].Value <string>());
     }
     if (node["createdAt"] != null)
     {
         this._CreatedAt = ParseInt(node["createdAt"].Value <string>());
     }
     if (node["updatedAt"] != null)
     {
         this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>());
     }
     if (node["description"] != null)
     {
         this._Description = node["description"].Value <string>();
     }
     if (node["tags"] != null)
     {
         this._Tags = node["tags"].Value <string>();
     }
     if (node["appearInList"] != null)
     {
         this._AppearInList = (AppearInListType)ParseEnum(typeof(AppearInListType), node["appearInList"].Value <string>());
     }
     if (node["privacy"] != null)
     {
         this._Privacy = (PrivacyType)ParseEnum(typeof(PrivacyType), node["privacy"].Value <string>());
     }
     if (node["inheritanceType"] != null)
     {
         this._InheritanceType = (InheritanceType)ParseEnum(typeof(InheritanceType), node["inheritanceType"].Value <string>());
     }
     if (node["userJoinPolicy"] != null)
     {
         this._UserJoinPolicy = (UserJoinPolicyType)ParseEnum(typeof(UserJoinPolicyType), node["userJoinPolicy"].Value <string>());
     }
     if (node["defaultPermissionLevel"] != null)
     {
         this._DefaultPermissionLevel = (CategoryUserPermissionLevel)ParseEnum(typeof(CategoryUserPermissionLevel), node["defaultPermissionLevel"].Value <string>());
     }
     if (node["owner"] != null)
     {
         this._Owner = node["owner"].Value <string>();
     }
     if (node["directEntriesCount"] != null)
     {
         this._DirectEntriesCount = ParseInt(node["directEntriesCount"].Value <string>());
     }
     if (node["referenceId"] != null)
     {
         this._ReferenceId = node["referenceId"].Value <string>();
     }
     if (node["contributionPolicy"] != null)
     {
         this._ContributionPolicy = (ContributionPolicyType)ParseEnum(typeof(ContributionPolicyType), node["contributionPolicy"].Value <string>());
     }
     if (node["membersCount"] != null)
     {
         this._MembersCount = ParseInt(node["membersCount"].Value <string>());
     }
     if (node["pendingMembersCount"] != null)
     {
         this._PendingMembersCount = ParseInt(node["pendingMembersCount"].Value <string>());
     }
     if (node["privacyContext"] != null)
     {
         this._PrivacyContext = node["privacyContext"].Value <string>();
     }
     if (node["privacyContexts"] != null)
     {
         this._PrivacyContexts = node["privacyContexts"].Value <string>();
     }
     if (node["status"] != null)
     {
         this._Status = (CategoryStatus)ParseEnum(typeof(CategoryStatus), node["status"].Value <string>());
     }
     if (node["inheritedParentId"] != null)
     {
         this._InheritedParentId = ParseInt(node["inheritedParentId"].Value <string>());
     }
     if (node["partnerSortValue"] != null)
     {
         this._PartnerSortValue = ParseInt(node["partnerSortValue"].Value <string>());
     }
     if (node["partnerData"] != null)
     {
         this._PartnerData = node["partnerData"].Value <string>();
     }
     if (node["defaultOrderBy"] != null)
     {
         this._DefaultOrderBy = (CategoryOrderBy)StringEnum.Parse(typeof(CategoryOrderBy), node["defaultOrderBy"].Value <string>());
     }
     if (node["directSubCategoriesCount"] != null)
     {
         this._DirectSubCategoriesCount = ParseInt(node["directSubCategoriesCount"].Value <string>());
     }
     if (node["moderation"] != null)
     {
         this._Moderation = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["moderation"].Value <string>());
     }
     if (node["pendingEntriesCount"] != null)
     {
         this._PendingEntriesCount = ParseInt(node["pendingEntriesCount"].Value <string>());
     }
     if (node["isAggregationCategory"] != null)
     {
         this._IsAggregationCategory = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["isAggregationCategory"].Value <string>());
     }
     if (node["aggregationCategories"] != null)
     {
         this._AggregationCategories = node["aggregationCategories"].Value <string>();
     }
     if (node["adminTags"] != null)
     {
         this._AdminTags = node["adminTags"].Value <string>();
     }
 }
Beispiel #14
0
        public CategoryBaseFilter(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "idEqual":
                    this._IdEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "idIn":
                    this._IdIn = propertyNode.InnerText;
                    continue;

                case "idNotIn":
                    this._IdNotIn = propertyNode.InnerText;
                    continue;

                case "parentIdEqual":
                    this._ParentIdEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "parentIdIn":
                    this._ParentIdIn = propertyNode.InnerText;
                    continue;

                case "depthEqual":
                    this._DepthEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "fullNameEqual":
                    this._FullNameEqual = propertyNode.InnerText;
                    continue;

                case "fullNameStartsWith":
                    this._FullNameStartsWith = propertyNode.InnerText;
                    continue;

                case "fullNameIn":
                    this._FullNameIn = propertyNode.InnerText;
                    continue;

                case "fullIdsEqual":
                    this._FullIdsEqual = propertyNode.InnerText;
                    continue;

                case "fullIdsStartsWith":
                    this._FullIdsStartsWith = propertyNode.InnerText;
                    continue;

                case "fullIdsMatchOr":
                    this._FullIdsMatchOr = propertyNode.InnerText;
                    continue;

                case "createdAtGreaterThanOrEqual":
                    this._CreatedAtGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "createdAtLessThanOrEqual":
                    this._CreatedAtLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAtGreaterThanOrEqual":
                    this._UpdatedAtGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAtLessThanOrEqual":
                    this._UpdatedAtLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "tagsLike":
                    this._TagsLike = propertyNode.InnerText;
                    continue;

                case "tagsMultiLikeOr":
                    this._TagsMultiLikeOr = propertyNode.InnerText;
                    continue;

                case "tagsMultiLikeAnd":
                    this._TagsMultiLikeAnd = propertyNode.InnerText;
                    continue;

                case "appearInListEqual":
                    this._AppearInListEqual = (AppearInListType)ParseEnum(typeof(AppearInListType), propertyNode.InnerText);
                    continue;

                case "privacyEqual":
                    this._PrivacyEqual = (PrivacyType)ParseEnum(typeof(PrivacyType), propertyNode.InnerText);
                    continue;

                case "privacyIn":
                    this._PrivacyIn = propertyNode.InnerText;
                    continue;

                case "inheritanceTypeEqual":
                    this._InheritanceTypeEqual = (InheritanceType)ParseEnum(typeof(InheritanceType), propertyNode.InnerText);
                    continue;

                case "inheritanceTypeIn":
                    this._InheritanceTypeIn = propertyNode.InnerText;
                    continue;

                case "referenceIdEqual":
                    this._ReferenceIdEqual = propertyNode.InnerText;
                    continue;

                case "referenceIdEmpty":
                    this._ReferenceIdEmpty = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText);
                    continue;

                case "contributionPolicyEqual":
                    this._ContributionPolicyEqual = (ContributionPolicyType)ParseEnum(typeof(ContributionPolicyType), propertyNode.InnerText);
                    continue;

                case "membersCountGreaterThanOrEqual":
                    this._MembersCountGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "membersCountLessThanOrEqual":
                    this._MembersCountLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "pendingMembersCountGreaterThanOrEqual":
                    this._PendingMembersCountGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "pendingMembersCountLessThanOrEqual":
                    this._PendingMembersCountLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "privacyContextEqual":
                    this._PrivacyContextEqual = propertyNode.InnerText;
                    continue;

                case "statusEqual":
                    this._StatusEqual = (CategoryStatus)ParseEnum(typeof(CategoryStatus), propertyNode.InnerText);
                    continue;

                case "statusIn":
                    this._StatusIn = propertyNode.InnerText;
                    continue;

                case "inheritedParentIdEqual":
                    this._InheritedParentIdEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "inheritedParentIdIn":
                    this._InheritedParentIdIn = propertyNode.InnerText;
                    continue;

                case "partnerSortValueGreaterThanOrEqual":
                    this._PartnerSortValueGreaterThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerSortValueLessThanOrEqual":
                    this._PartnerSortValueLessThanOrEqual = ParseInt(propertyNode.InnerText);
                    continue;

                case "aggregationCategoriesMultiLikeOr":
                    this._AggregationCategoriesMultiLikeOr = propertyNode.InnerText;
                    continue;

                case "aggregationCategoriesMultiLikeAnd":
                    this._AggregationCategoriesMultiLikeAnd = propertyNode.InnerText;
                    continue;
                }
            }
        }
 public Task <ApiResult <string> > Updatestatus(int CategoryId, CategoryStatus status)
 {
     throw new NotImplementedException();
 }
Beispiel #16
0
        public static void UpdateCategory(int CategoryID, string CategoryName, string CategoryDesc, CategoryStatus status)
        {
            ForumCategory mCategory = new ForumCategory();

            mCategory.Load(CategoryID);

            mCategory.CategoryName   = CategoryName;
            mCategory.CategoryDesc   = CategoryDesc;
            mCategory.CategoryStatus = (int)status;

            mCategory.Save();
        }
 public CategoryBaseFilter(JToken node) : base(node)
 {
     if (node["idEqual"] != null)
     {
         this._IdEqual = ParseInt(node["idEqual"].Value <string>());
     }
     if (node["idIn"] != null)
     {
         this._IdIn = node["idIn"].Value <string>();
     }
     if (node["idNotIn"] != null)
     {
         this._IdNotIn = node["idNotIn"].Value <string>();
     }
     if (node["parentIdEqual"] != null)
     {
         this._ParentIdEqual = ParseInt(node["parentIdEqual"].Value <string>());
     }
     if (node["parentIdIn"] != null)
     {
         this._ParentIdIn = node["parentIdIn"].Value <string>();
     }
     if (node["depthEqual"] != null)
     {
         this._DepthEqual = ParseInt(node["depthEqual"].Value <string>());
     }
     if (node["fullNameEqual"] != null)
     {
         this._FullNameEqual = node["fullNameEqual"].Value <string>();
     }
     if (node["fullNameStartsWith"] != null)
     {
         this._FullNameStartsWith = node["fullNameStartsWith"].Value <string>();
     }
     if (node["fullNameIn"] != null)
     {
         this._FullNameIn = node["fullNameIn"].Value <string>();
     }
     if (node["fullIdsEqual"] != null)
     {
         this._FullIdsEqual = node["fullIdsEqual"].Value <string>();
     }
     if (node["fullIdsStartsWith"] != null)
     {
         this._FullIdsStartsWith = node["fullIdsStartsWith"].Value <string>();
     }
     if (node["fullIdsMatchOr"] != null)
     {
         this._FullIdsMatchOr = node["fullIdsMatchOr"].Value <string>();
     }
     if (node["createdAtGreaterThanOrEqual"] != null)
     {
         this._CreatedAtGreaterThanOrEqual = ParseInt(node["createdAtGreaterThanOrEqual"].Value <string>());
     }
     if (node["createdAtLessThanOrEqual"] != null)
     {
         this._CreatedAtLessThanOrEqual = ParseInt(node["createdAtLessThanOrEqual"].Value <string>());
     }
     if (node["updatedAtGreaterThanOrEqual"] != null)
     {
         this._UpdatedAtGreaterThanOrEqual = ParseInt(node["updatedAtGreaterThanOrEqual"].Value <string>());
     }
     if (node["updatedAtLessThanOrEqual"] != null)
     {
         this._UpdatedAtLessThanOrEqual = ParseInt(node["updatedAtLessThanOrEqual"].Value <string>());
     }
     if (node["tagsLike"] != null)
     {
         this._TagsLike = node["tagsLike"].Value <string>();
     }
     if (node["tagsMultiLikeOr"] != null)
     {
         this._TagsMultiLikeOr = node["tagsMultiLikeOr"].Value <string>();
     }
     if (node["tagsMultiLikeAnd"] != null)
     {
         this._TagsMultiLikeAnd = node["tagsMultiLikeAnd"].Value <string>();
     }
     if (node["appearInListEqual"] != null)
     {
         this._AppearInListEqual = (AppearInListType)ParseEnum(typeof(AppearInListType), node["appearInListEqual"].Value <string>());
     }
     if (node["privacyEqual"] != null)
     {
         this._PrivacyEqual = (PrivacyType)ParseEnum(typeof(PrivacyType), node["privacyEqual"].Value <string>());
     }
     if (node["privacyIn"] != null)
     {
         this._PrivacyIn = node["privacyIn"].Value <string>();
     }
     if (node["inheritanceTypeEqual"] != null)
     {
         this._InheritanceTypeEqual = (InheritanceType)ParseEnum(typeof(InheritanceType), node["inheritanceTypeEqual"].Value <string>());
     }
     if (node["inheritanceTypeIn"] != null)
     {
         this._InheritanceTypeIn = node["inheritanceTypeIn"].Value <string>();
     }
     if (node["referenceIdEqual"] != null)
     {
         this._ReferenceIdEqual = node["referenceIdEqual"].Value <string>();
     }
     if (node["referenceIdEmpty"] != null)
     {
         this._ReferenceIdEmpty = (NullableBoolean)ParseEnum(typeof(NullableBoolean), node["referenceIdEmpty"].Value <string>());
     }
     if (node["contributionPolicyEqual"] != null)
     {
         this._ContributionPolicyEqual = (ContributionPolicyType)ParseEnum(typeof(ContributionPolicyType), node["contributionPolicyEqual"].Value <string>());
     }
     if (node["membersCountGreaterThanOrEqual"] != null)
     {
         this._MembersCountGreaterThanOrEqual = ParseInt(node["membersCountGreaterThanOrEqual"].Value <string>());
     }
     if (node["membersCountLessThanOrEqual"] != null)
     {
         this._MembersCountLessThanOrEqual = ParseInt(node["membersCountLessThanOrEqual"].Value <string>());
     }
     if (node["pendingMembersCountGreaterThanOrEqual"] != null)
     {
         this._PendingMembersCountGreaterThanOrEqual = ParseInt(node["pendingMembersCountGreaterThanOrEqual"].Value <string>());
     }
     if (node["pendingMembersCountLessThanOrEqual"] != null)
     {
         this._PendingMembersCountLessThanOrEqual = ParseInt(node["pendingMembersCountLessThanOrEqual"].Value <string>());
     }
     if (node["privacyContextEqual"] != null)
     {
         this._PrivacyContextEqual = node["privacyContextEqual"].Value <string>();
     }
     if (node["statusEqual"] != null)
     {
         this._StatusEqual = (CategoryStatus)ParseEnum(typeof(CategoryStatus), node["statusEqual"].Value <string>());
     }
     if (node["statusIn"] != null)
     {
         this._StatusIn = node["statusIn"].Value <string>();
     }
     if (node["inheritedParentIdEqual"] != null)
     {
         this._InheritedParentIdEqual = ParseInt(node["inheritedParentIdEqual"].Value <string>());
     }
     if (node["inheritedParentIdIn"] != null)
     {
         this._InheritedParentIdIn = node["inheritedParentIdIn"].Value <string>();
     }
     if (node["partnerSortValueGreaterThanOrEqual"] != null)
     {
         this._PartnerSortValueGreaterThanOrEqual = ParseInt(node["partnerSortValueGreaterThanOrEqual"].Value <string>());
     }
     if (node["partnerSortValueLessThanOrEqual"] != null)
     {
         this._PartnerSortValueLessThanOrEqual = ParseInt(node["partnerSortValueLessThanOrEqual"].Value <string>());
     }
     if (node["aggregationCategoriesMultiLikeOr"] != null)
     {
         this._AggregationCategoriesMultiLikeOr = node["aggregationCategoriesMultiLikeOr"].Value <string>();
     }
     if (node["aggregationCategoriesMultiLikeAnd"] != null)
     {
         this._AggregationCategoriesMultiLikeAnd = node["aggregationCategoriesMultiLikeAnd"].Value <string>();
     }
 }
Beispiel #18
0
 public Category()
 {
     this._synonyms = new List <string>();
     this._tags     = new List <string>();
     this._status   = CategoryStatus.Inactive;
 }
 public Category(int id, string codeName, string fullName, string parentCategoryCodeName, CategoryType categoryType, CategoryStatus status, IList <Category> subCategories) : this(id, codeName, fullName, parentCategoryCodeName, categoryType, status, subCategories, null)
 {
 }
Beispiel #20
0
        /// <summary>
        /// درج مقادیر اولیه در دیتابیس به هنگام ساخت دیتابیس
        /// </summary>
        /// <param name="context">شی دیتابیس اصلی برنامه</param>
        protected override void Seed(AsefianContext context)
        {
            foreach (var item in Language.GetList())
            {
                context.Language.Add(item);
            }
            #region Account
            foreach (var item in UserType.GetList())
            {
                context.UserType.Add(item);
            }
            foreach (var item in BalanceType.GetList())
            {
                context.BalanceType.Add(item);
            }
            foreach (var item in Browser.GetList())
            {
                context.Browser.Add(item);
            }
            foreach (var item in DeviceType.GetList())
            {
                context.DeviceType.Add(item);
            }
            foreach (var item in GroupStatus.GetList())
            {
                context.GroupStatus.Add(item);
            }
            foreach (var item in NotificationStatus.GetList())
            {
                context.NotificationStatus.Add(item);
            }
            foreach (var item in NotificationType.GetList())
            {
                context.NotificationType.Add(item);
            }
            foreach (var item in Account.Enum.OperatingSystem.GetList())
            {
                context.OperatingSystem.Add(item);
            }
            foreach (var item in Sex.GetList())
            {
                context.Sex.Add(item);
            }
            foreach (var item in TokenType.GetList())
            {
                context.TokenType.Add(item);
            }
            foreach (var item in UserAddressStatus.GetList())
            {
                context.UserAddressStatus.Add(item);
            }
            foreach (var item in UserFavoriteFolderStatus.GetList())
            {
                context.UserFavoriteFolderStatus.Add(item);
            }
            foreach (var item in UserFavoriteStatus.GetList())
            {
                context.UserFavoriteStatus.Add(item);
            }
            foreach (var item in UserStatus.GetList())
            {
                context.UserStatus.Add(item);
            }
            #endregion

            #region Blog

            foreach (var item in ArticleFileStatus.GetList())
            {
                context.ArticleFileStatus.Add(item);
            }

            foreach (var item in ArticleStatus.GetList())
            {
                context.ArticleStatus.Add(item);
            }

            foreach (var item in NewsStatus.GetList())
            {
                context.NewsStatus.Add(item);
            }
            #endregion

            #region Core
            foreach (var item in BranchStatus.GetList())
            {
                context.BranchStatus.Add(item);
            }
            foreach (var item in LocationType.GetList())
            {
                context.LocationType.Add(item);
            }
            foreach (var item in SliderContentStatus.GetList())
            {
                context.SliderContentStatus.Add(item);
            }
            foreach (var item in SliderStatus.GetList())
            {
                context.SliderStatus.Add(item);
            }
            foreach (var item in SliderType.GetList())
            {
                context.SliderType.Add(item);
            }
            #endregion

            #region Data
            foreach (var item in ExportStatus.GetList())
            {
                context.ExportStatus.Add(item);
            }
            foreach (var item in ContactUsStatus.GetList())
            {
                context.ContactUsStatus.Add(item);
            }
            foreach (var item in SpecialProjectStatus.GetList())
            {
                context.SpecialProjectStatus.Add(item);
            }
            foreach (var item in SpecialProjectFileStatus.GetList())
            {
                context.SpecialProjectFileStatus.Add(item);
            }
            foreach (var item in BrandStatus.GetList())
            {
                context.BrandStatus.Add(item);
            }
            foreach (var item in CategoryFeatureStatus.GetList())
            {
                context.CategoryFeatureStatus.Add(item);
            }
            foreach (var item in CategoryFeatureType.GetList())
            {
                context.CategoryFeatureType.Add(item);
            }
            foreach (var item in CategoryStatus.GetList())
            {
                context.CategoryStatus.Add(item);
            }
            foreach (var item in CategoryType.GetList())
            {
                context.CategoryType.Add(item);
            }
            foreach (var item in DownloadCenterStatus.GetList())
            {
                context.DownloadCenterStatus.Add(item);
            }
            foreach (var item in ProductFileStatus.GetList())
            {
                context.ProductFileStatus.Add(item);
            }
            foreach (var item in ProductFileType.GetList())
            {
                context.ProductFileType.Add(item);
            }
            foreach (var item in ProductFilterStatus.GetList())
            {
                context.ProductFilterStatus.Add(item);
            }
            foreach (var item in ProductFilterType.GetList())
            {
                context.ProductFilterType.Add(item);
            }
            foreach (var item in ProductFilterValueStatus.GetList())
            {
                context.ProductFilterValueStatus.Add(item);
            }
            foreach (var item in ProductStatus.GetList())
            {
                context.ProductStatus.Add(item);
            }
            foreach (var item in ServiceStatus.GetList())
            {
                context.ServiceStatus.Add(item);
            }
            #endregion

            #region Financial
            foreach (var item in CouponStatus.GetList())
            {
                context.CouponStatus.Add(item);
            }
            foreach (var item in CouponType.GetList())
            {
                context.CouponType.Add(item);
            }
            foreach (var item in DeliveryType.GetList())
            {
                context.DeliveryType.Add(item);
            }
            foreach (var item in InquiryStatus.GetList())
            {
                context.InquiryStatus.Add(item);
            }
            foreach (var item in InvoiceDetailStatus.GetList())
            {
                context.InvoiceDetailStatus.Add(item);
            }
            foreach (var item in InvoiceStatus.GetList())
            {
                context.InvoiceStatus.Add(item);
            }
            foreach (var item in PaymentType.GetList())
            {
                context.PaymentType.Add(item);
            }
            #endregion

            #region Support
            foreach (var item in FaqCategoryStatus.GetList())
            {
                context.FaqCategoryStatus.Add(item);
            }
            foreach (var item in FaqStatus.GetList())
            {
                context.FaqStatus.Add(item);
            }
            foreach (var item in MessageBoxStatus.GetList())
            {
                context.MessageBoxStatus.Add(item);
            }
            foreach (var item in NewsLetterStatus.GetList())
            {
                context.NewsLetterStatus.Add(item);
            }
            foreach (var item in TicketMessageType.GetList())
            {
                context.TicketMessageType.Add(item);
            }
            foreach (var item in TicketPriority.GetList())
            {
                context.TicketPriority.Add(item);
            }
            foreach (var item in TicketStatus.GetList())
            {
                context.TicketStatus.Add(item);
            }
            foreach (var item in MessageType.GetList())
            {
                context.MessageType.Add(item);
            }
            #endregion

            var admin = new User()
            {
                FirstName         = "مدیر",
                LastName          = "سیستم",
                MobileNumber      = "09122424519",
                MobileNumberValid = true,
                Email             = "*****@*****.**",
                EmailValid        = true,
                SexId             = Sex.Male.Id,
                TypeId            = UserType.Insider.Id,
                Password          = PasswordUtility.Encrypt("alialiali"),
                StatusId          = UserStatus.Active.Id,
                Permission        = 1,
                CreateDate        = DateTime.Now,
                ModifyDate        = DateTime.Now,
                CreateIp          = "::1",
                ModifyIp          = "::1"
            };
            context.User.Add(admin);
        }
 public Category(int id, string codeName, string fullName, string parentCategoryCodeName, CategoryType categoryType, CategoryStatus status, long?count) : this(id, codeName, fullName, parentCategoryCodeName, categoryType, status, null, count)
 {
 }
Beispiel #22
0
        public Category(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "id":
                    this._Id = ParseInt(propertyNode.InnerText);
                    continue;

                case "parentId":
                    this._ParentId = ParseInt(propertyNode.InnerText);
                    continue;

                case "depth":
                    this._Depth = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerId":
                    this._PartnerId = ParseInt(propertyNode.InnerText);
                    continue;

                case "name":
                    this._Name = propertyNode.InnerText;
                    continue;

                case "fullName":
                    this._FullName = propertyNode.InnerText;
                    continue;

                case "fullIds":
                    this._FullIds = propertyNode.InnerText;
                    continue;

                case "entriesCount":
                    this._EntriesCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "createdAt":
                    this._CreatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAt":
                    this._UpdatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "description":
                    this._Description = propertyNode.InnerText;
                    continue;

                case "tags":
                    this._Tags = propertyNode.InnerText;
                    continue;

                case "appearInList":
                    this._AppearInList = (AppearInListType)ParseEnum(typeof(AppearInListType), propertyNode.InnerText);
                    continue;

                case "privacy":
                    this._Privacy = (PrivacyType)ParseEnum(typeof(PrivacyType), propertyNode.InnerText);
                    continue;

                case "inheritanceType":
                    this._InheritanceType = (InheritanceType)ParseEnum(typeof(InheritanceType), propertyNode.InnerText);
                    continue;

                case "userJoinPolicy":
                    this._UserJoinPolicy = (UserJoinPolicyType)ParseEnum(typeof(UserJoinPolicyType), propertyNode.InnerText);
                    continue;

                case "defaultPermissionLevel":
                    this._DefaultPermissionLevel = (CategoryUserPermissionLevel)ParseEnum(typeof(CategoryUserPermissionLevel), propertyNode.InnerText);
                    continue;

                case "owner":
                    this._Owner = propertyNode.InnerText;
                    continue;

                case "directEntriesCount":
                    this._DirectEntriesCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "referenceId":
                    this._ReferenceId = propertyNode.InnerText;
                    continue;

                case "contributionPolicy":
                    this._ContributionPolicy = (ContributionPolicyType)ParseEnum(typeof(ContributionPolicyType), propertyNode.InnerText);
                    continue;

                case "membersCount":
                    this._MembersCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "pendingMembersCount":
                    this._PendingMembersCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "privacyContext":
                    this._PrivacyContext = propertyNode.InnerText;
                    continue;

                case "privacyContexts":
                    this._PrivacyContexts = propertyNode.InnerText;
                    continue;

                case "status":
                    this._Status = (CategoryStatus)ParseEnum(typeof(CategoryStatus), propertyNode.InnerText);
                    continue;

                case "inheritedParentId":
                    this._InheritedParentId = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerSortValue":
                    this._PartnerSortValue = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerData":
                    this._PartnerData = propertyNode.InnerText;
                    continue;

                case "defaultOrderBy":
                    this._DefaultOrderBy = (CategoryOrderBy)StringEnum.Parse(typeof(CategoryOrderBy), propertyNode.InnerText);
                    continue;

                case "directSubCategoriesCount":
                    this._DirectSubCategoriesCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "moderation":
                    this._Moderation = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText);
                    continue;

                case "pendingEntriesCount":
                    this._PendingEntriesCount = ParseInt(propertyNode.InnerText);
                    continue;

                case "isAggregationCategory":
                    this._IsAggregationCategory = (NullableBoolean)ParseEnum(typeof(NullableBoolean), propertyNode.InnerText);
                    continue;

                case "aggregationCategories":
                    this._AggregationCategories = propertyNode.InnerText;
                    continue;
                }
            }
        }