做个有理想的人

ERP OA CMS SCM HR HIS

导航

ex

Posted on 2015-01-23 13:00  爱国思想家  阅读(96)  评论(0)    收藏  举报

public static class ex
    {
        public static int ToInt(this string s)
        {
            return int.Parse(s);
        }
    }
    public interface ISqlCom
    {
        int ToUpdate();
    }
    public class SqlCom : ISqlCom
    {
        string table;

        public string Table
        {
            get { return table; }
            set { table = value; }
        }
        Dictionary<string, object> fileds;

        public Dictionary<string, object> Fileds
        {
            get { return fileds; }
            set { fileds = value; }
        }
        string search;

        public string Search
        {
            get { return search; }
            set { search = value; }
        }
        public int ToUpdate()
        {
            return 0;
        }
    }
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlCom sql = new SqlCom();
            Dictionary<string, object> fileds = new Dictionary<string, object>();
            fileds.Add("name", this.TextBox1.Text.Trim().ToInt());
            sql.Table = "User";
            sql.Fileds = fileds;
            sql.ToUpdate();
        }
    }