コード例 #1
0
    /// <summary>
    /// 保存
    /// </summary>
    protected void btnCon_Click(object sender, EventArgs e)
    {
        Test_Model.sys_sysfiles model = new Test_Model.sys_sysfiles();
        model.classId = Tools.StringHelp.GetInt(this.ddlParentMD.SelectedValue);
        string tempStr = this.txtName.Value.Trim().Replace("'", "");

        //string tempStr = Tools.StringHelp.FilterSymbolStr(this.txtName.Value.Trim());
        model.fielsName  = tempStr;
        model.filesUrl   = this.txtPath.Value.Trim();
        model.describe   = Tools.StringHelp.CutStirngNormal(this.txtDescribe.Value.Trim(), 20, 0);//数据库中该字段长度是20位
        model.showLeft   = Tools.StringHelp.GetInt(this.rdShowLeft.SelectedValue) == 10 ? true : false;
        model.filesOrder = Tools.StringHelp.GetInt(this.txtIntOrder.Value.Trim());
        model.addTime    = DateTime.Now;
        model.addUser    = adminGetCount;
        model.addUserId  = int.Parse(adminGetId);

        DataSet ds = common.GetList(" select fielsName from tb_sys_sysfiles where fielsName='" + Tools.StringHelp.FilterSymbolStr(tempStr) + "' ");

        if (!Tools.Validator.CheckDataSet(ds, 0))
        {
            if (bg_bllSM.Add(model) > 0)
            {
                Response.Redirect("Manage_Page.aspx");
            }
            else
            {
                FinalMessage("保存失败", "", 1);
            }
        }
    }
コード例 #2
0
ファイル: Edit_Page.aspx.cs プロジェクト: joyhen/mywork
    /// <summary>
    /// 绑定页面数据
    /// </summary>
    private void BindData()
    {
        if (string.IsNullOrEmpty(temp) || !Tools.Validator.IsPositiveInt(temp))
            FinalMessage("UTL解析错误,请勿在Url中添加非法关键词!", "Manage_Page.aspx", 1);

        ModFilses = bg_bllSM.GetModel(Tools.StringHelp.GetInt(temp));
        if (ModFilses != null)
        {
            this.txtName.Value = ModFilses.fielsName.Trim();
            this.txtPath.Value = ModFilses.filesUrl.Trim();
            this.txtDescribe.Value = ModFilses.describe.Trim();
            this.txtIntOrder.Value = ModFilses.filesOrder.ToString().Trim();
            Tools.WebControl.SeRadioButtonList(this.rdShowLeft, ModFilses.showLeft == true ? "10" : "20");
            Tools.WebControl.SetSelectedList(this.ddlParentMD, ModFilses.classId.ToString());
        }
    }
コード例 #3
0
    /// <summary>
    /// 绑定页面数据
    /// </summary>
    private void BindData()
    {
        if (string.IsNullOrEmpty(temp) || !Tools.Validator.IsPositiveInt(temp))
        {
            FinalMessage("UTL解析错误,请勿在Url中添加非法关键词!", "Manage_Page.aspx", 1);
        }

        ModFilses = bg_bllSM.GetModel(Tools.StringHelp.GetInt(temp));
        if (ModFilses != null)
        {
            this.txtName.Value     = ModFilses.fielsName.Trim();
            this.txtPath.Value     = ModFilses.filesUrl.Trim();
            this.txtDescribe.Value = ModFilses.describe.Trim();
            this.txtIntOrder.Value = ModFilses.filesOrder.ToString().Trim();
            Tools.WebControl.SeRadioButtonList(this.rdShowLeft, ModFilses.showLeft == true ? "10" : "20");
            Tools.WebControl.SetSelectedList(this.ddlParentMD, ModFilses.classId.ToString());
        }
    }
コード例 #4
0
ファイル: Add_Page.aspx.cs プロジェクト: joyhen/mywork
    /// <summary>
    /// 保存
    /// </summary>
    protected void btnCon_Click(object sender, EventArgs e)
    {
        Test_Model.sys_sysfiles model = new Test_Model.sys_sysfiles();
        model.classId = Tools.StringHelp.GetInt(this.ddlParentMD.SelectedValue);
        string tempStr = this.txtName.Value.Trim().Replace("'", "");
        //string tempStr = Tools.StringHelp.FilterSymbolStr(this.txtName.Value.Trim());
        model.fielsName = tempStr;
        model.filesUrl = this.txtPath.Value.Trim();
        model.describe = Tools.StringHelp.CutStirngNormal(this.txtDescribe.Value.Trim(), 20, 0);//数据库中该字段长度是20位
        model.showLeft = Tools.StringHelp.GetInt(this.rdShowLeft.SelectedValue) == 10 ? true : false;
        model.filesOrder = Tools.StringHelp.GetInt(this.txtIntOrder.Value.Trim());
        model.addTime = DateTime.Now;
        model.addUser = adminGetCount;
        model.addUserId = int.Parse(adminGetId);

        DataSet ds = common.GetList(" select fielsName from tb_sys_sysfiles where fielsName='" + Tools.StringHelp.FilterSymbolStr(tempStr) + "' ");
        if (!Tools.Validator.CheckDataSet(ds, 0))
        {
            if (bg_bllSM.Add(model) > 0)
                Response.Redirect("Manage_Page.aspx");
            else
                FinalMessage("保存失败", "", 1);
        }
    }