コード例 #1
0
        public int pcount = 0; //总条数

        #endregion Fields

        #region Methods

        public void RptBind(string strWhere)
        {
            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            DataSet ds = dal.GetList(strWhere);
            DataView dv = ds.Tables[0].DefaultView;
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pds = new PagedDataSource();
            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource = dv;
            pds.AllowPaging = true;
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize = AspNetPager1.PageSize;
            //获得总条数
            pcount = dv.Count;
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            //绑定数据
            rptList.DataSource = pds;
            rptList.DataBind();
        }
コード例 #2
0
        public void RptBind(string strWhere)
        {
            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            DataSet           ds  = dal.GetList(strWhere);
            DataView          dv  = ds.Tables[0].DefaultView;
            //利用PAGEDDAGASOURCE类来分页
            PagedDataSource pds = new PagedDataSource();

            AspNetPager1.RecordCount = dv.Count;
            pds.DataSource           = dv;
            pds.AllowPaging          = true;
            pds.CurrentPageIndex     = AspNetPager1.CurrentPageIndex - 1;
            pds.PageSize             = AspNetPager1.PageSize;
            //获得总条数
            pcount = dv.Count;
            if (this.pcount > 0)
            {
                this.lbtnDel.Enabled = true;
            }
            else
            {
                this.lbtnDel.Enabled = false;
            }
            //绑定数据
            rptList.DataSource = pds;
            rptList.DataBind();
        }
コード例 #3
0
        //添加招聘
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.caseTitle.Text.Trim().Length == 0)
            {
                strErr += "案例名称不能为空!\\n";
            }
            if (this.description.Text.Trim().Length == 0)
            {
                strErr += "案例描述不能为空!\\n";
            }
            if (this.solution.Text.Trim().Length == 0)
            {
                strErr += "解决方案不能为空!\\n";
            }
            if (this.txtImgUrl.Text.Trim().Length == 0)
            {
                strErr += "案例图片不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }

            Cms.Model.Solution model = new Cms.Model.Solution();
            model.Title        = this.caseTitle.Text;
            model.Description  = this.description.Text;
            model.SolutionPlan = this.solution.Text;
            model.SucCases     = this.SucCases.Text;
            model.ImageUrl     = this.txtImgUrl.Text;
            model.SortOrder    = Convert.ToInt32(sortOrder.Text);;
            model.IsLock       = Convert.ToInt32(isLock.SelectedValue);

            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            int ReId = dal.Add(model);

            if (ReId > 0)
            {
                MessageBox.Show(this, "案例增加成功!");
                //Coolite.Ext.Web.Ext.MessageBox.Alert("提示", "产品型号信息修改成功").Show();
            }
            else
            {
                MessageBox.Show(this, "添加过程中发生错误!");
                //Coolite.Ext.Web.Ext.MessageBox.Alert("提示", "发布过程中发生错误").Show();
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(Request.Params["SolutionID"] as string, out this.SolutionID))
     {
         Response.Write("<script>alert('您要查看的信息参数不正确或不存在!');history.go(-1);</script>");
         return;
     }
     if (!Page.IsPostBack)
     {
         Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
         model = dal.GetModel(SolutionID);
         ShowInfo();
     }
 }
コード例 #5
0
        //添加招聘
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";
            if (this.caseTitle.Text.Trim().Length == 0)
            {
                strErr += "案例名称不能为空!\\n";
            }
            if (this.description.Text.Trim().Length == 0)
            {
                strErr += "案例描述不能为空!\\n";
            }
            if (this.solution.Text.Trim().Length == 0)
            {
                strErr += "解决方案不能为空!\\n";
            }
            if (this.txtImgUrl.Text.Trim().Length == 0)
            {
                strErr += "案例图片不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }

            Cms.Model.Solution model = new Cms.Model.Solution();
            model.Title = this.caseTitle.Text;
            model.Description = this.description.Text;
            model.SolutionPlan = this.solution.Text;
            model.SucCases = this.SucCases.Text;
            model.ImageUrl = this.txtImgUrl.Text;
            model.SortOrder = Convert.ToInt32(sortOrder.Text); ;
            model.IsLock = Convert.ToInt32(isLock.SelectedValue);

            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            int ReId = dal.Add(model);
            if (ReId > 0)
            {
                MessageBox.Show(this, "案例增加成功!");
                //Coolite.Ext.Web.Ext.MessageBox.Alert("提示", "产品型号信息修改成功").Show();
            }
            else
            {
                MessageBox.Show(this, "添加过程中发生错误!");
                //Coolite.Ext.Web.Ext.MessageBox.Alert("提示", "发布过程中发生错误").Show();
            }
        }
コード例 #6
0
        //编辑操作
        protected void btnSave_Click(object sender, EventArgs e)
        {
            model.Id           = this.SolutionID;
            model.Title        = this.caseTitle.Text;
            model.Description  = this.description.Text;
            model.SolutionPlan = this.solution.Text;
            model.SucCases     = this.SucCases.Text;
            model.ImageUrl     = this.txtImgUrl.Text;
            model.SortOrder    = Convert.ToInt32(sortOrder.Text);;
            model.IsLock       = Convert.ToInt32(isLock.SelectedValue);

            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            dal.Update(model);
            ////保存日志
            MessageBox.Show(this, "解决方案修改成功!");
        }
コード例 #7
0
        public static string solutionList()
        {
            Cms.DAL.Solutions dal    = new Cms.DAL.Solutions();
            StringBuilder     strTxt = new StringBuilder();
            DataSet           ds     = dal.GetList("IsLock = 0");
            DataTable         tbl    = ds.Tables[0];

            if (tbl.Rows.Count > 0)
            {
                for (int j = 0; j < tbl.Rows.Count; j++)
                {
                    DataRow row = tbl.Rows[j];
                    strTxt.Append("<table width=\"900\" height=\"200\" cellpadding=\"0\" cellspacing=\"0\" style=\"position:relative;left:50px;\">");
                    strTxt.Append("<tr>");
                    strTxt.Append("<td width=\"200\" align=\"right\" valign=\"top\">");
                    strTxt.Append("<img src=\"Tools/Http_ImgLoad.ashx?w=180&h=135&gurl=" + row["ImageUrl"].ToString() + "\" width=\"180\" height=\"135\" style=\"position:relative;top:20px;right:10px;\"/>");
                    strTxt.Append("</td>");
                    strTxt.Append("<td width=\"5\" valign=\"middle\">");
                    strTxt.Append("<img src=\"Images/vdivider.gif\" width=\"10\" height=\"150\"/>");
                    strTxt.Append("</td>");
                    strTxt.Append("<td width=\"695\" valign=\"top\">");
                    strTxt.Append("<div class=\"divider02\" width=\"100%\" style=\"position:relative;top:10px;\"></div>");
                    strTxt.Append("<div  style=\"position:relative;top:15px; left:25px;\">");
                    strTxt.Append("<ul>");
                    strTxt.Append("<li><span class=\"solutionText01\">" + row["CaseTitle"].ToString() + ":</span><span class=\"solutionText02\">" + row["Description"].ToString() + "</span></li>");
                    strTxt.Append("<li><span class=\"solutionText01\">解决方案:</span><span class=\"solutionText02\">" + row["Solution"].ToString() + "</span></li>");
                    if (!string.IsNullOrEmpty(row["SucCases"].ToString()))
                    {
                        strTxt.Append("<li><span class=\"solutionText01\">成功案例:</span><span class=\"solutionText02\">" + row["SucCases"].ToString() + "</span></li>");
                    }
                    strTxt.Append("</ul>");
                    strTxt.Append("</div>");
                    strTxt.Append("</td>");
                    strTxt.Append("</tr>");
                    strTxt.Append("</table>");
                }
            }
            else
            {
                strTxt.Append("暂无解决方案!");
            }

            return(strTxt.ToString());
        }
コード例 #8
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);

            Cms.DAL.Solutions  dal   = new Cms.DAL.Solutions();
            Cms.Model.Solution model = dal.GetModel(id);
            switch (e.CommandName.ToLower())
            {
            case "ibtnlock":
                if (model.IsLock == 1)
                {
                    dal.UpdateField(id, "IsLock=0");
                }
                else
                {
                    dal.UpdateField(id, "IsLock=1");
                }
                break;
            }
            RptBind("");
        }
コード例 #9
0
        public static string solutionList()
        {
            Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
            StringBuilder strTxt = new StringBuilder();
            DataSet ds = dal.GetList("IsLock = 0");
            DataTable tbl = ds.Tables[0];

            if (tbl.Rows.Count > 0)
            {
                for (int j = 0; j < tbl.Rows.Count; j++)
                {
                    DataRow row = tbl.Rows[j];
                    strTxt.Append("<table width=\"900\" height=\"200\" cellpadding=\"0\" cellspacing=\"0\" style=\"position:relative;left:50px;\">");
                    strTxt.Append("<tr>");
                    strTxt.Append("<td width=\"200\" align=\"right\" valign=\"top\">");
                    strTxt.Append("<img src=\"Tools/Http_ImgLoad.ashx?w=180&h=135&gurl=" + row["ImageUrl"].ToString() + "\" width=\"180\" height=\"135\" style=\"position:relative;top:20px;right:10px;\"/>");
                    strTxt.Append("</td>");
                    strTxt.Append("<td width=\"5\" valign=\"middle\">");
                    strTxt.Append("<img src=\"Images/vdivider.gif\" width=\"10\" height=\"150\"/>");
                    strTxt.Append("</td>");
                    strTxt.Append("<td width=\"695\" valign=\"top\">");
                    strTxt.Append("<div class=\"divider02\" width=\"100%\" style=\"position:relative;top:10px;\"></div>");
                    strTxt.Append("<div  style=\"position:relative;top:15px; left:25px;\">");
                    strTxt.Append("<ul>");
                    strTxt.Append("<li><span class=\"solutionText01\">" + row["CaseTitle"].ToString() + ":</span><span class=\"solutionText02\">" + row["Description"].ToString() + "</span></li>");
                    strTxt.Append("<li><span class=\"solutionText01\">解决方案:</span><span class=\"solutionText02\">" + row["Solution"].ToString() + "</span></li>");
                    if (!string.IsNullOrEmpty(row["SucCases"].ToString()))
                         strTxt.Append("<li><span class=\"solutionText01\">成功案例:</span><span class=\"solutionText02\">"+row["SucCases"].ToString()+"</span></li>");
                    strTxt.Append("</ul>");
                    strTxt.Append("</div>");
                    strTxt.Append("</td>");
                    strTxt.Append("</tr>");
                    strTxt.Append("</table>");
                }
            }
            else
                strTxt.Append("暂无解决方案!");

            return strTxt.ToString();
        }
コード例 #10
0
 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     int id = Convert.ToInt32(((Label)e.Item.FindControl("lb_id")).Text);
     Cms.DAL.Solutions dal = new Cms.DAL.Solutions();
     Cms.Model.Solution model = dal.GetModel(id);
     switch (e.CommandName.ToLower())
     {
         case "ibtnlock":
             if (model.IsLock == 1)
                 dal.UpdateField(id, "IsLock=0");
             else
                 dal.UpdateField(id, "IsLock=1");
             break;
     }
     RptBind("");
 }