Beispiel #1
0
        public virtual DataTable GetByFieldToTable(String Field, Object Value)
        {
            String[] Fields = new String[1];
            Fields[0] = Field;
            Object[] Values = new Object[1];
            Values[0] = Value;
            string sql = RootLibrary.GetScriptGetByField(this, Fields, Values);

            return(Provider.ExecuteToDataTable(sql));
        }
Beispiel #2
0
        public virtual Object Get()
        {
            string    sql     = RootLibrary.GetScriptGet(this);
            DataTable dtTable = Provider.ExecuteToDataTable(sql);

            if (dtTable.Rows.Count > 0)
            {
                return(RootLibrary.GetObjectValue(dtTable.Rows[0], this));
            }
            return(null);
        }
Beispiel #3
0
        public virtual long Insert()
        {
            string sql = RootLibrary.GetScriptInsert(this);

            Provider.ExecuteNonQuery(sql);
            if (RootLibrary.IsIdentity(this))
            {
                return(long.Parse(Provider.ExecuteScalar("Select @@IDENTITY").ToString()));
            }
            return(-1);
        }
Beispiel #4
0
        public static WebPage GetByPage(string page)
        {
            string    sql     = @"select * from QLCV_WebPage where Page='" + page + "' and Type='" + NumCode.UPWEB + "'";
            DataTable dtTable = ServerProvider.ExecuteToDataTable(sql);

            if (dtTable.Rows.Count > 0)
            {
                WebPage cus = new WebPage();
                return((WebPage)RootLibrary.GetObjectValue(dtTable.Rows[0], cus));
            }
            return(null);
        }
Beispiel #5
0
        public static WebPage Get(long ID)
        {
            string    sql     = @"select * from QLCV_WebPage where ID=" + ID;
            DataTable dtTable = ServerProvider.ExecuteToDataTable(sql);

            if (dtTable.Rows.Count > 0)
            {
                WebPage cus = new WebPage();
                return((WebPage)RootLibrary.GetObjectValue(dtTable.Rows[0], cus));
            }
            return(null);
        }
Beispiel #6
0
        public virtual Object[] GetAll()
        {
            string    sql     = RootLibrary.GetScriptGetAll(this);
            DataTable dtTable = Provider.ExecuteToDataTable(sql);

            Object[] objects = new Object[dtTable.Rows.Count];
            for (int i = 0; i < dtTable.Rows.Count; i++)
            {
                objects[i] = RootLibrary.GetObjectValue(dtTable.Rows[i], this);
            }
            return(objects);
        }
Beispiel #7
0
        public virtual Object[] GetByField(String Field, Object Value)
        {
            String[] Fields = new String[1];
            Fields[0] = Field;
            Object[] Values = new Object[1];
            Values[0] = Value;
            string    sql     = RootLibrary.GetScriptGetByField(this, Fields, Values);
            DataTable dtTable = Provider.ExecuteToDataTable(sql);

            Object[] objects = new Object[dtTable.Rows.Count];
            for (int i = 0; i < dtTable.Rows.Count; i++)
            {
                objects[i] = RootLibrary.GetObjectValue(dtTable.Rows[i], this);
            }
            return(objects);
        }
Beispiel #8
0
        public virtual void Update()
        {
            string sql = RootLibrary.GetScriptUpdate(this);

            Provider.ExecuteNonQuery(sql);
        }
Beispiel #9
0
        public virtual DataTable GetAllToTable()
        {
            string sql = RootLibrary.GetScriptGetAll(this);

            return(Provider.ExecuteToDataTable(sql));
        }