Esempio n. 1
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.HeadPortrait Models)
        {
            string sqlStr = " insert into [MS_HeadPortrait](TITLE,FILE_URL,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@TITLE,@FILE_URL,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 2
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.ProjectList Models)
        {
            string sqlStr = " insert into [MS_ProjectList](CREATE_GUID,PROJECT_ID,SYNOPSIS,EXPLAIN,SORT,CLASS_ID,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@PROJECT_ID,@SYNOPSIS,@EXPLAIN,@SORT,@CLASS_ID,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 3
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.TouchMsg Models)
        {
            string sqlStr = " insert into [MS_TouchMsg](USER_EMAIL,MSG,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP) values(@USER_EMAIL,@MSG,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 4
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.BigClass Models)
        {
            string sqlStr = " insert into [MS_BigClass](CREATE_GUID,CLASS_NAME,CLASS_CODE,SORT,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID,STATE) values(@CREATE_GUID,@CLASS_NAME,@CLASS_CODE,@SORT,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID,@STATE);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 5
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.LoginLog Models)
        {
            string sqlStr = " insert into [MS_LoginLog](LOGIN_ID,LOGIN_PWD,GUID,IP_ADDRESS,CITY,SUCCESS,STATE) values(@LOGIN_ID,@LOGIN_PWD,@GUID,@IP_ADDRESS,@CITY,@SUCCESS,@STATE);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 6
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.ProjectDetail Models)
        {
            string sqlStr = " insert into [MS_ProjectDetail](CREATE_GUID,TITLE,CONTENT,PROJECT_URL,DEMO_URL,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@TITLE,@CONTENT,@PROJECT_URL,@DEMO_URL,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 7
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.ArticeList Models)
        {
            string sqlStr = " insert into [MS_ArticeList](CREATE_GUID,ARTICE_ID,SORT,CLASS_ID,LABEL_ID,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@ARTICE_ID,@SORT,@CLASS_ID,@LABEL_ID,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 8
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.NAVS Models)
        {
            string sqlStr = " insert into [MS_NAVS](CREATE_GUID,TITLE,URL,POWER,CLASS_ID,TYPE,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@TITLE,@URL,@POWER,@CLASS_ID,@TYPE,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 9
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.DynamicPicture Models)
        {
            string sqlStr = " insert into [MS_DynamicPicture](CREATE_GUID,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 10
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.VisitLog Models)
        {
            string sqlStr = " insert into [MS_VisitLog](ENTRY_URL,VISIT_IP,VISIT_CITY,SESSION_GUID,STATE) values(@ENTRY_URL,@VISIT_IP,@VISIT_CITY,@SESSION_GUID,@STATE);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 11
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.ReaderLog Models)
        {
            string sqlStr = " insert into [MS_ReaderLog](ENTRY_URL,ARTICE_ID,PROJECT_ID,VISIT_IP,VISIT_CITY,SESSION_GUID,STATE,OUT_TIME) values(@ENTRY_URL,@ARTICE_ID,@PROJECT_ID,@VISIT_IP,@VISIT_CITY,@SESSION_GUID,@STATE,@OUT_TIME);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 12
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.NAV Models)
        {
            string sqlStr = " insert into [MS_NAV](TITLE,URL,POWER,CLASS,TYPE,STATE,BACKUP1) values(@TITLE,@URL,@POWER,@CLASS,@TYPE,@STATE,@BACKUP1);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 13
0
        /// <summary>
        ///根据id取得数据模型(返)一个Models)
        /// </summary>
        public Models.NAV GetModels(int id)
        {
            string sqlStr = " select top 1 * from [MS_NAV] where id = @id ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <Models.NAV>(sqlStr, new{ id = id }).SingleOrDefault());
            }
        }
Esempio n. 14
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.OperationLog Models)
        {
            string sqlStr = " insert into [MS_OperationLog](GUID,IP_ADDRESS,CITY,OPERATION_URL,PARAM_STRING,RESULT_STRING,STATE) values(@GUID,@IP_ADDRESS,@CITY,@OPERATION_URL,@PARAM_STRING,@RESULT_STRING,@STATE);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 取所有数据的数量
        /// </summary>
        public int GetCount()
        {
            string sqlStr = " select count(*) from [MS_NAV] ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr).SingleOrDefault());
            }
        }
Esempio n. 16
0
        /// <summary>
        ///添加一条数据(返)插入的数据的id)
        /// </summary>
        public int Add(Models.SelfSign Models)
        {
            string sqlStr = " insert into [MS_SelfSign](CREATE_GUID,CONTENT,CLASS_ID,STATE,LAST_CHANGE_TIME,LAST_CHANGE_IP,LAST_CHANGE_GUID) values(@CREATE_GUID,@CONTENT,@CLASS_ID,@STATE,@LAST_CHANGE_TIME,@LAST_CHANGE_IP,@LAST_CHANGE_GUID);select @@identity ";

            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr, Models).SingleOrDefault());
            }
        }
Esempio n. 17
0
        /// <summary>
        /// 按条件取所有数据的数量
        /// </summary>
        public int GetCount(string cond)
        {
            string sqlStr = " select count(*) from [MS_NAV] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <int>(sqlStr).SingleOrDefault());
            }
        }
Esempio n. 18
0
        /// <summary>
        ///按条件取多个字段的列表(返)一个List<Models>)
        /// </summary>
        public List <Models.NAV> GetListFields(string fields, string cond)
        {
            string sqlStr = " select " + fields + " from [MS_NAV] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <Models.NAV>(sqlStr).AsList());
            }
        }
Esempio n. 19
0
        /// <summary>
        ///按条件取一个字段的值(返)一个string)
        /// </summary>
        public string GetOneField(string field, string cond)
        {
            string sqlStr = " select top 1 " + field + " from [MS_NAV] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <string>(sqlStr).SingleOrDefault());
            }
        }
Esempio n. 20
0
        /// <summary>
        ///根据条件取得数据模型(返)一个Models)
        /// </summary>
        public Models.NAV GetModels(string cond)
        {
            string sqlStr = " select top 1 * from [MS_NAV] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <Models.NAV>(sqlStr).SingleOrDefault());
            }
        }
Esempio n. 21
0
        /// <summary>
        ///按条件取一个字段的列表(返)一个List<string>)
        /// </summary>
        public List <string> GetListField(string field, string cond)
        {
            string sqlStr = " select " + field + " from [MS_SelfSign] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <string>(sqlStr).AsList());
            }
        }
Esempio n. 22
0
        /// <summary>
        ///按条件取多个字段的值(返)一个Models)
        /// </summary>
        public Models.SelfSign GetFields(string fields, string cond)
        {
            string sqlStr = " select top 1 " + fields + " from [MS_SelfSign] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <Models.SelfSign>(sqlStr).SingleOrDefault());
            }
        }
Esempio n. 23
0
        /// <summary>
        ///按条件取得模型列表(返)一个List<Models>)
        /// </summary>
        public List <Models.SelfSign> GetListModels(string cond)
        {
            string sqlStr = " select * from [MS_SelfSign] where state not in (2) ";

            if (!string.IsNullOrEmpty(cond))
            {
                sqlStr += " and " + cond;
            }
            using (var connection = new ConnectionCode().GetConnection())
            {
                return(connection.Query <Models.SelfSign>(sqlStr).AsList());
            }
        }