Exemplo n.º 1
0
    /// <summary>
    /// 保存信息
    /// </summary>
    protected void ModelSave()
    {
        string Field = "ClassId,", Val = this.ClassId.SelectedValue + "{$split$}";
        mField mF = new mField();
        bField bF = new bField();

        mF.TableName = mm.TableName;
        DataSet ds = bF.FieldList(mF);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            string ValTemp = System.Web.HttpContext.Current.Request.Form[ds.Tables[0].Rows[i]["Field"].ToString()];
            if (ValTemp != string.Empty && ValTemp != null)
            {
                Field += ds.Tables[0].Rows[i]["Field"].ToString() + ",";
                Val   += HXD.ModelField.Common.FieldType.FormatField(ds.Tables[0].Rows[i]["Type"].ToString(), ds.Tables[0].Rows[i]["Field"].ToString()) + "{$split$}";
            }
        }
        if (mm.Id == 0)
        {
            bm.ModelInsert(mm.TableName, Field, Val);
        }
        else
        {
            bm.ModelUpdate(mm.Id, mm.TableName, Field, Val);
        }
        if (MenuId == 0)
        {
            Jscript.Alert("保存成功!", this.Page); binder();
        }
        else
        {
            Response.Redirect("Model_Manage.aspx?MenuId=" + MenuId);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 保存管理员信息
    /// </summary>
    protected void UserSave()
    {
        mU.UserName = this.UserName.Text;
        mU.UserPwd  = Encryp.DESEncrypt(this.UserPwd.Text);
        mField mF = new mField();
        bField bF = new bField();

        mF.TableName = mm.TableName;
        DataSet ds = bF.FieldList(mF);
        string  Field = "", Val = "";

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            Field += ds.Tables[0].Rows[i]["Field"].ToString() + ",";
            Val   += HXD.ModelField.Common.FieldType.FormatField(ds.Tables[0].Rows[i]["Type"].ToString(), ds.Tables[0].Rows[i]["Field"].ToString()) + "{$split$}";
        }
        if (mU.Id == 0)
        {
            Field += "Id";
            Val   += bU.UserInsert(mU).ToString();
            bm.ModelInsert(mm.TableName, Field, Val);
        }
        else
        {
            Field += "1";
            Val   += "1";
            bU.UserUpdate(mU);
            bm.ModelUpdate(mm.Id, mm.TableName, Field.Trim(','), Val.Trim(','));
        }
        StringDeal.Alter("保存完成!", "User_Manage.aspx?GroupId=" + mU.GroupId + "");
    }
Exemplo n.º 3
0
    /// <summary>
    /// 栏目模型绑定(获取所需字段)
    /// </summary>
    protected void SetBind()
    {
        DataSet ds = bF.FieldList(mF);//获取此信息模型字段

        DBList.DataSource = ds;
        DBList.DataBind();
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LoginCheck.AdminManage();
        TableId = StringDeal.ToInt(Request.QueryString["TableId"]);
        bTable bT = new bTable();

        mF.TableName = bT.GetTableName(TableId);

        if (!IsPostBack)
        {
            Operation();
            DBList.DataSource = bF.FieldList(mF);
            DBList.DataBind();
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// 模型绑定
    /// </summary>
    private void BindModel()
    {
        DataTable dt = new DataTable();

        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Title", typeof(string));
        dt.Columns.Add("Note", typeof(string));
        mField mF = new mField();
        bField bF = new bField();

        mF.TableName = mm.TableName;
        DataSet ds = bF.FieldList(mF);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            DataRow dr = dt.NewRow();
            dr["Name"]  = ds.Tables[0].Rows[i]["Field"];
            dr["Title"] = ds.Tables[0].Rows[i]["Title"];
            dr["Note"]  = ds.Tables[0].Rows[i]["Note"];
            dt.Rows.Add(dr);
        }
        this.DBList.DataSource = dt;
        this.DataBind();
    }