Example #1
0
        public static ModulesEntity CreateModulesEntity(int createdByUserID, ISystemDateTime timeProvider)
        {
            ModulesEntity model = new ModulesEntity();

            model.CreatedBy  = createdByUserID;
            model.CreatedOn  = timeProvider.Now;
            model.ID         = 0;
            model.ModifiedBy = createdByUserID;
            model.ModifiedOn = timeProvider.Now;

            model.ModuleID    = 0;
            model.ModulePath  = string.Empty;
            model.ModuleTitle = string.Empty;
            model.Orders      = 0;
            model.ParentID    = 0;
            model.Status      = 0;

            return(model);
        }
Example #2
0
        /// <summary>
        /// Bind IDataReader to Entity
        /// </summary>
        public static ModulesEntity ReaderBind(IDataReader dataReader)
        {
            ModulesEntity model = new ModulesEntity();
            object        ojb;

            ojb = dataReader["ModuleID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ModuleID = (int)ojb;
                model.ID       = model.ModuleID;
            }
            model.ModuleTitle    = dataReader["ModuleTitle"].ToString();
            model.ModulePath     = dataReader["ModulePath"].ToString();
            model.DefaultPage    = dataReader["DefaultPage"].ToString();
            model.ClickFunctioin = dataReader["ClickFunctioin"].ToString();
            ojb = dataReader["ShowInMenu"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ShowInMenu = (bool)ojb;
            }
            ojb = dataReader["PageOrModule"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.PageOrModule = (int)ojb;
            }
            ojb = dataReader["Status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (int)ojb;
            }
            ojb = dataReader["Orders"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Orders = (int)ojb;
            }
            ojb = dataReader["ParentID"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ParentID = (int)ojb;
            }
            return(model);
        }