コード例 #1
0
        private void ShowInfo(int WebStatusID)
        {
            WebSiteData.WebStatus  bll   = new WebSiteData.WebStatus();
            WebSiteModel.WebStatus model = bll.GetModel(WebStatusID);

            this.lblWebStatusID.Text = model.WebStatusID.ToString();
            this.txtStatus.Text      = model.Status;
            this.txtRemark.Value     = model.Remark;
            this.txtColor.Text       = model.Color;
        }
コード例 #2
0
        /// <summary>
        /// 绑定状态
        /// </summary>
        private void WebStatusBind()
        {
            WebSiteData.WebStatus webStatus = new WebSiteData.WebStatus();
            //获得某一个站点所有的数据分类
            DataTable dt = webStatus.GetList("").Tables[0];

            this.ddlWebStatus.Items.Clear();
            this.ddlWebStatus.Items.Add(new ListItem("网站状态", ""));//默认值是0

            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["WebStatusID"].ToString();
                string Title = dr["Status"].ToString().Trim();
                this.ddlWebStatus.Items.Add(new ListItem(Title, Id));
            }
        }
コード例 #3
0
        public string RetutnStatusHTML(int id)
        {
            string strR = string.Empty;

            WebSiteModel.WebStatus model = new WebSiteData.WebStatus().GetModel(id);

            if (model != null)
            {
                strR = "<span style=\"color: " + model.Color + "; font-weight: bold\">" + model.Status + "</span>";
            }
            else
            {
                strR = "<span style=\"color:#000; font-weight: bold\">未设置状态</span>";
            }

            return(strR);
        }
コード例 #4
0
        private bool DoAdd()
        {
            bool result = true;

            WebSiteData.WebStatus  bll   = new WebSiteData.WebStatus();
            WebSiteModel.WebStatus model = new WebSiteModel.WebStatus();

            string Status = this.txtStatus.Text;
            string Remark = this.txtRemark.Value;
            string Color  = this.txtColor.Text;

            model.Status = Status;
            model.Remark = Remark;
            model.Color  = Color;

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return(result);
        }
コード例 #5
0
        /// <summary>
        /// 组合查询的条件
        /// </summary>
        /// <param name="_strWhere">组合条件</param>
        /// <param name="_orderby"></param>
        private void RptBind(string _strWhere, string _orderby)
        {
            //得到第几页数据
            this.page = DTRequest.GetQueryInt("page", 1);

            //绑定关键字
            this.txtKeywords.Text = this.keywords;

            WebSiteData.WebStatus mdata = new WebSiteData.WebStatus();

            //参数分别是:每页条数  第几页  查询条件 排序条件 数据总数
            this.rptList.DataSource = mdata.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount);
            this.rptList.DataBind();

            //绑定页码
            txtPageNum.Text = this.pageSize.ToString();
            string pageUrl = Utils.CombUrlTxt("WebStatusList.aspx", urlParamsPage, this.keywords, "__id__");

            PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8);
            litCount.Text         = this.totalCount.ToString();
        }
コード例 #6
0
        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            bool bl = true;//标记变量

            WebSiteData.WebStatus bll = new WebSiteData.WebStatus();

            //遍历提交过来的对象集合
            for (int i = 0; i < this.rptList.Items.Count; i++)
            {
                int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");

                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        //将捕获代码的程序 放置在最底层
                        bl = true;
                    }
                    else
                    {
                        //表示其中有一个选项没有删除成功
                        bl = false;
                        Response.Write("出错的ID为" + id.ToString());
                        break;
                    }
                }
            }

            if (bl)
            {
                JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("WebStatusList.aspx", urlParams, this.keywords), "Success");
            }
            else
            {
                JscriptMsg("批量删除操作中...有一个没有删除成功!", "back", "Error");
            }
        }
コード例 #7
0
        private bool DoEdit(int id)
        {
            bool result = true;

            WebSiteData.WebStatus  bll   = new WebSiteData.WebStatus();
            WebSiteModel.WebStatus model = bll.GetModel(id);

            int    WebStatusID = id;
            string Status      = this.txtStatus.Text;
            string Remark      = this.txtRemark.Value;
            string Color       = this.txtColor.Text;

            model.WebStatusID = WebStatusID;
            model.Status      = Status;
            model.Remark      = Remark;
            model.Color       = Color;

            if (!bll.Update(model))
            {
                result = false;
            }
            return(result);
        }