Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = DTRequest.GetQueryString("keywords", true);
            this.id       = DTRequest.GetQueryIntValue("id", 0);
            this.page     = DTRequest.GetQueryIntValue("page", 1);
            this.pageSize = GetPageSize(10); //每页数量

            if (!Page.IsPostBack)
            {
                //读取用户
                DTcms.Model.manager model = GetAdminInfo();

                //检查权限
                ChkAdminLevel("plugin_lable", DTEnums.ActionEnum.Show.ToString());

                //绑定数据
                BLL.plugin_lable bll   = new BLL.plugin_lable();
                DataSet          _list = bll.GetList(pageSize, page, CombSqlTxt(this.keywords), "sort_id asc,id asc", out totalCount);
                this.rptList.DataSource = _list;
                this.rptList.DataBind();

                //插入关键词
                this.txtKeywords.Text = Utils.Htmls(this.keywords);

                //绑定页码
                this.txtPageNum.Text = pageSize.ToString();
                string pageUrl = Utils.CombUrlTxt("index.aspx", "keywords={0}&page={1}", keywords, "__id__");
                PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
            }
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ViewState["PlanDate"] = Request["PlanDate"];
         manager = Session[DTKeys.SESSION_ADMIN_INFO] as DTcms.Model.manager;
         ShowInfo();
     }
 }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string id = "";
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             id = Request.QueryString["id"];
         }
         if (id != "")
         {
             this.hdfCurriculumID.Value = id;
             ShowInfo(id);
         }
         manager = Session[DTKeys.SESSION_ADMIN_INFO] as DTcms.Model.manager;
     }
 }
Ejemplo n.º 4
0
        private bool DoAdd()
        {
            BLL.lable   bll   = new BLL.lable();
            Model.lable model = new Model.lable();

            model.title      = txtTitle.Text;
            model.call_index = txtName.Text;
            model.is_lock    = int.Parse(rblHide.SelectedValue);
            model.sort_id    = int.Parse(txtSort.Text);
            model.type       = Utils.StrToInt(ddlType.SelectedValue, 0);
            model.content    = txtContent.Value;
            model.add_time   = DateTime.Now;
            //管理员
            DTcms.Model.manager adminModel = GetAdminInfo();
            model.user_name = adminModel.real_name;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "添加标签内容:" + model.title); //记录日志
                return(true);
            }
            return(false);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.manager GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 id,role_id,role_type,user_name,user_pwd,real_name,telephone,email,is_lock,add_time from dt_manager ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@id", SqlDbType.Int, 4)
            };
            parameters[0].Value = id;

            DTcms.Model.manager model = new DTcms.Model.manager();
            DataSet             ds    = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_id"] != null && ds.Tables[0].Rows[0]["role_id"].ToString() != "")
                {
                    model.role_id = int.Parse(ds.Tables[0].Rows[0]["role_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_type"] != null && ds.Tables[0].Rows[0]["role_type"].ToString() != "")
                {
                    model.role_type = int.Parse(ds.Tables[0].Rows[0]["role_type"].ToString());
                }
                if (ds.Tables[0].Rows[0]["user_name"] != null && ds.Tables[0].Rows[0]["user_name"].ToString() != "")
                {
                    model.user_name = ds.Tables[0].Rows[0]["user_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["user_pwd"] != null && ds.Tables[0].Rows[0]["user_pwd"].ToString() != "")
                {
                    model.user_pwd = ds.Tables[0].Rows[0]["user_pwd"].ToString();
                }
                if (ds.Tables[0].Rows[0]["real_name"] != null && ds.Tables[0].Rows[0]["real_name"].ToString() != "")
                {
                    model.real_name = ds.Tables[0].Rows[0]["real_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["telephone"] != null && ds.Tables[0].Rows[0]["telephone"].ToString() != "")
                {
                    model.telephone = ds.Tables[0].Rows[0]["telephone"].ToString();
                }
                if (ds.Tables[0].Rows[0]["email"] != null && ds.Tables[0].Rows[0]["email"].ToString() != "")
                {
                    model.email = ds.Tables[0].Rows[0]["email"].ToString();
                }
                if (ds.Tables[0].Rows[0]["is_lock"] != null && ds.Tables[0].Rows[0]["is_lock"].ToString() != "")
                {
                    model.is_lock = int.Parse(ds.Tables[0].Rows[0]["is_lock"].ToString());
                }
                if (ds.Tables[0].Rows[0]["add_time"] != null && ds.Tables[0].Rows[0]["add_time"].ToString() != "")
                {
                    model.add_time = DateTime.Parse(ds.Tables[0].Rows[0]["add_time"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public Model.manager GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,role_id,role_type,user_name,user_pwd,real_name,telephone,email,is_lock,add_time from dt_manager ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            DTcms.Model.manager model = new DTcms.Model.manager();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_id"] != null && ds.Tables[0].Rows[0]["role_id"].ToString() != "")
                {
                    model.role_id = int.Parse(ds.Tables[0].Rows[0]["role_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_type"] != null && ds.Tables[0].Rows[0]["role_type"].ToString() != "")
                {
                    model.role_type = int.Parse(ds.Tables[0].Rows[0]["role_type"].ToString());
                }
                if (ds.Tables[0].Rows[0]["user_name"] != null && ds.Tables[0].Rows[0]["user_name"].ToString() != "")
                {
                    model.user_name = ds.Tables[0].Rows[0]["user_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["user_pwd"] != null && ds.Tables[0].Rows[0]["user_pwd"].ToString() != "")
                {
                    model.user_pwd = ds.Tables[0].Rows[0]["user_pwd"].ToString();
                }
                if (ds.Tables[0].Rows[0]["real_name"] != null && ds.Tables[0].Rows[0]["real_name"].ToString() != "")
                {
                    model.real_name = ds.Tables[0].Rows[0]["real_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["telephone"] != null && ds.Tables[0].Rows[0]["telephone"].ToString() != "")
                {
                    model.telephone = ds.Tables[0].Rows[0]["telephone"].ToString();
                }
                if (ds.Tables[0].Rows[0]["email"] != null && ds.Tables[0].Rows[0]["email"].ToString() != "")
                {
                    model.email = ds.Tables[0].Rows[0]["email"].ToString();
                }
                if (ds.Tables[0].Rows[0]["is_lock"] != null && ds.Tables[0].Rows[0]["is_lock"].ToString() != "")
                {
                    model.is_lock = int.Parse(ds.Tables[0].Rows[0]["is_lock"].ToString());
                }
                if (ds.Tables[0].Rows[0]["add_time"] != null && ds.Tables[0].Rows[0]["add_time"].ToString() != "")
                {
                    model.add_time = DateTime.Parse(ds.Tables[0].Rows[0]["add_time"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.manager model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DTcms.Model.manager model)
 {
     return(dal.Add(model));
 }