public int UpdateAduitStatus(string id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("UPDATE SolderPasteDifferRecord  SET AduitStatus = '" + Convert.ToBase64String(UTF8Encoding.Unicode.GetBytes("已确认")) + "' WHERE Id = '" + id + "'");
            return(DbHelperSql.ExecuteSql(strSql.ToString()));
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(big_data.Model.UnifiedAddressLibraryUserInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update UnifiedAddressLibraryUserInfo set ");
            strSql.Append("UnifiedAddressLibraryID=@UnifiedAddressLibraryID,");
            strSql.Append("UserIDList=@UserIDList,");
            strSql.Append("AddTime=@AddTime");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UnifiedAddressLibraryID", SqlDbType.Int,        4),
                new SqlParameter("@UserIDList",              SqlDbType.NVarChar,  -1),
                new SqlParameter("@AddTime",                 SqlDbType.DateTime2,  8),
                new SqlParameter("@ID",                      SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UnifiedAddressLibraryID;
            parameters[1].Value = model.UserIDList;
            parameters[2].Value = model.AddTime;
            parameters[3].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.PublicityType model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update PublicityType set ");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("Name=@Name,");
            strSql.Append("IsDeleted=@IsDeleted");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CreateTime",        SqlDbType.DateTime2,          8),
                new SqlParameter("@Name",              SqlDbType.VarChar,          255),
                new SqlParameter("@IsDeleted",         SqlDbType.Int,                4),
                new SqlParameter("@ID",                SqlDbType.Int,                4),
                new SqlParameter("@PublicityTypeUUID", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.CreateTime;
            parameters[1].Value = model.Name;
            parameters[2].Value = model.IsDeleted;
            parameters[3].Value = model.ID;
            parameters[4].Value = model.PublicityTypeUUID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Haikan.LabSystemCore.Model.CreditCardBehavior model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update CreditCardBehavior set ");
            strSql.Append("CardNo=@CardNo,");
            strSql.Append("DeviceID=@DeviceID,");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("ProjectID=@ProjectID");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CardNo",    SqlDbType.VarChar, 255),
                new SqlParameter("@DeviceID",  SqlDbType.VarChar, 255),
                new SqlParameter("@AddTime",   SqlDbType.VarChar, 255),
                new SqlParameter("@ProjectID", SqlDbType.Int,       4),
                new SqlParameter("@ID",        SqlDbType.Int, 4)
            };
            parameters[0].Value = model.CardNo;
            parameters[1].Value = model.DeviceID;
            parameters[2].Value = model.AddTime;
            parameters[3].Value = model.ProjectID;
            parameters[4].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.searchl model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update searchl set ");
            strSql.Append("text=@text,");
            strSql.Append("url=@url");
            strSql.Append(" where guid=@guid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@text", SqlDbType.VarChar,          255),
                new SqlParameter("@url",  SqlDbType.VarChar,          255),
                new SqlParameter("@guid", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.text;
            parameters[1].Value = model.url;
            parameters[2].Value = model.guid;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.SystemUserRoleMapping model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update SystemUserRoleMapping set ");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("AddPeople=@AddPeople");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@AddTime",        SqlDbType.NVarChar,         255),
                new SqlParameter("@AddPeople",      SqlDbType.NVarChar,         255),
                new SqlParameter("@SystemUserUUID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@SystemRoleUUID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@ID",             SqlDbType.Int, 4)
            };
            parameters[0].Value = model.AddTime;
            parameters[1].Value = model.AddPeople;
            parameters[2].Value = model.SystemUserUUID;
            parameters[3].Value = model.SystemRoleUUID;
            parameters[4].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(big_data.Model.RegionInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update RegionInfo set ");
            strSql.Append("RegionID=@RegionID,");
            strSql.Append("RegionX=@RegionX,");
            strSql.Append("RegionY=@RegionY,");
            strSql.Append("AddTime=@AddTime");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@RegionID", SqlDbType.Int,         4),
                new SqlParameter("@RegionX",  SqlDbType.VarChar,   255),
                new SqlParameter("@RegionY",  SqlDbType.VarChar,   255),
                new SqlParameter("@AddTime",  SqlDbType.DateTime2,   8),
                new SqlParameter("@ID",       SqlDbType.Int, 4)
            };
            parameters[0].Value = model.RegionID;
            parameters[1].Value = model.RegionX;
            parameters[2].Value = model.RegionY;
            parameters[3].Value = model.AddTime;
            parameters[4].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(HeqiaoDaoshiCore.Model.searchl model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into searchl(");
            strSql.Append("guid,text,url)");
            strSql.Append(" values (");
            strSql.Append("@guid,@text,@url)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@guid", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@text", SqlDbType.VarChar,          255),
                new SqlParameter("@url",  SqlDbType.VarChar, 255)
            };
            parameters[0].Value = Guid.NewGuid();
            parameters[1].Value = model.text;
            parameters[2].Value = model.url;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 9
0
        public bool Update(int programButtonID, int programID, string buttonID, string Url)
        {
            var strSql = new StringBuilder();

            strSql.Append("UPDATE tbLOG_Program_Button SET ");
            strSql.Append(" Program_ID = @Program_ID ,Button_ID = @Button_ID , Url = @Url ");
            strSql.Append("FROM tbLOG_Program_Button LPB ");
            strSql.Append("LEFT JOIN ( ");
            strSql.Append("SELECT  * FROM    ( SELECT    Program_ID ,Button_ID ,ROW_NUMBER() OVER ( PARTITION BY Program_ID,Button_ID ORDER BY Program_Button_ID ASC ) RN FROM      tbLOG_Program_Button  WHERE Program_ID=@Program_ID AND Button_ID=@Button_ID ) AS T WHERE  T.RN > 1 ");
            strSql.Append(" ) TPB ");
            strSql.Append("ON LPB.Program_ID = TPB.Program_ID AND LPB.Button_ID = TPB.Button_ID ");
            strSql.Append("WHERE LPB.Program_ID=@Program_ID AND LPB.Button_ID=@Button_ID AND TPB.Program_ID IS NULL  ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Program_Button_ID", SqlDbType.VarChar,  50),
                new SqlParameter("@Program_ID",        SqlDbType.VarChar,  50),
                new SqlParameter("@Button_ID",         SqlDbType.VarChar, 200),
                new SqlParameter("@Url",               SqlDbType.VarChar, 100)
            };
            parameters[0].Value = programButtonID;
            parameters[1].Value = programID;
            parameters[2].Value = buttonID;
            parameters[3].Value = Url;

            var resultCount = DbHelperSql.ExecuteSql(DbHelperSql.DefaultUpdateConn, strSql.ToString(), parameters);

            if (resultCount == 0)
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(Guid HotelRoomUuid, int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("delete from HotelRoom ");
            strSql.Append(" where HotelRoomUuid=@HotelRoomUuid and ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@HotelRoomUuid", SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@ID",            SqlDbType.Int, 4)
            };
            parameters[0].Value = HotelRoomUuid;
            parameters[1].Value = ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(Guid SystemIconUUID, int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("delete from SystemIcon ");
            strSql.Append(" where SystemIconUUID=@SystemIconUUID and ID=@ID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SystemIconUUID", SqlDbType.UniqueIdentifier, 16),
                new SqlParameter("@ID",             SqlDbType.Int, 4)
            };
            parameters[0].Value = SystemIconUUID;
            parameters[1].Value = ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 12
0
        /// <summary>
        /// 创建一个只有一个Id主键的空表
        /// </summary>
        /// <param name="tablename"></param>
        /// <param name="defaultColumns"></param>
        /// <returns></returns>
        public bool CreateTable(string tablename, params string[] defaultColumns)
        {
            if (_providerConfig.DbProvider == DbProvider.MySql)
            {
                var sqlClause = string.Format(@"  CREATE TABLE IF NOT EXISTS `{0}` (`Id` int(11) NOT NULL AUTO_INCREMENT,PRIMARY KEY (`Id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;", tablename);
                DbHelperMySql.ExecuteSql(_providerConfig.DbConnectionString, sqlClause);
            }
            else
            {
                var sqlClause = string.Format(@"IF NOT EXISTS(SELECT * FROM sysobjects where id=OBJECT_ID('{0}') and xtype='U')
BEGIN CREATE TABLE {0} (
    [Id]          INT           NOT NULL IDENTITY, 
    PRIMARY KEY CLUSTERED ([Id] ASC));
END", tablename);
                DbHelperSql.ExecuteSql(_providerConfig.DbConnectionString, sqlClause);
            }
            foreach (var column in defaultColumns)
            {
                if (!string.IsNullOrEmpty(column) && !ColumHasExists(tablename, column))
                {
                    AddColumn(tablename, column, TemplateColumnDataType.TemplateString, 255);
                }
            }
            return(true);
        }
Exemplo n.º 13
0
        public void UpdateMatIDByPartNo(string partNo, string matId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("UPDATE ResponseInfo  SET MatID = '" + matId + "' WHERE PartNo = '" + partNo + "'");
            DbHelperSql.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 14
0
        /// <summary>
        /// 批量删除章节
        /// </summary>
        /// <param name="ids">章节编号集合</param>
        /// <returns></returns>
        public static int BatchDelete(string ids)
        {
            ids = ids.Trim().Replace(" ", "").Replace(",", "','");
            string strSql = string.Format(@"DELETE FROM dbo.Chapters WHERE (Id IN ('{0}'));", ids);

            return(DbHelperSql.ExecuteSql(strSql));
        }
Exemplo n.º 15
0
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public bool UpdateState(int id, int state)
        {
            var sql  = " update CoAgent set [State] = " + state + " where id='" + id + "'";
            var rows = DbHelperSql.ExecuteSql(sql);

            return(rows > 0);
        }
Exemplo n.º 16
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(ClassLibrary1.Model.TcqType model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update TcqType set ");
            strSql.Append("Tcqid=@Tcqid,");
            strSql.Append("TcqName=@TcqName");
            strSql.Append(" where Tcqguid=@Tcqguid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Tcqid",   SqlDbType.Int,                4),
                new SqlParameter("@TcqName", SqlDbType.VarChar,          255),
                new SqlParameter("@Tcqguid", SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value = model.Tcqid;
            parameters[1].Value = model.TcqName;
            parameters[2].Value = model.Tcqguid;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 17
0
        public bool UpdatePwd(int id, string password)
        {
            var sql  = " update CoAgent set Password = '******' where Id='" + id + "'";
            var rows = DbHelperSql.ExecuteSql(sql);

            return(rows > 0);
        }
Exemplo n.º 18
0
        public bool UpdateState(string id, int state)
        {
            var sql  = " update CoAgent set [State] = " + state + " where  Id in (" + id + ")";
            var rows = DbHelperSql.ExecuteSql(sql);

            return(rows > 0);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.Treasurerecord model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Treasurerecord set ");
            strSql.Append("UserUUID=@UserUUID,");
            strSql.Append("Content=@Content,");
            strSql.Append("Createtime=@Createtime");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@UserUUID",           SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@Content",            SqlDbType.NVarChar,         255),
                new SqlParameter("@Createtime",         SqlDbType.NVarChar,         255),
                new SqlParameter("@TreasurerecordUUID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@ID",                 SqlDbType.Int, 4)
            };
            parameters[0].Value = model.UserUUID;
            parameters[1].Value = model.Content;
            parameters[2].Value = model.Createtime;
            parameters[3].Value = model.TreasurerecordUUID;
            parameters[4].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 20
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="id"></param>
        /// <param name="objUpdate"></param>
        /// <returns></returns>
        public static bool UpdateById <T>(object id, object objUpdate) where T : class
        {
            var t   = typeof(T);
            var sql = t.GeneratePartialUpdateSqlById <T>(id, objUpdate);
            var i   = DbHelperSql.ExecuteSql(sql, AdoUtil.GetParameters(objUpdate).AppendParameters <T>(id));

            return(i > 0);
        }
Exemplo n.º 21
0
        public void UpdateMatIDToResponseDicByPartNo(string productPartNo, string lineNo, string MaterialsPartNo)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("UPDATE ResponseDic SET MaterialsPartNo = '" + MaterialsPartNo + "' WHERE LineName = '" + lineNo + "' and ProductPartNo='" + productPartNo + "'");

            int c = DbHelperSql.ExecuteSql(strSql.ToString());
        }
Exemplo n.º 22
0
        public virtual bool Delete(int id)
        {
            var type = typeof(T);
            var sql  = type.GenerateDeleteSqlString(id);
            var rows = DbHelperSql.ExecuteSql(sql);

            return(rows > 0);
        }
Exemplo n.º 23
0
        public bool Update(T entity)
        {
            var type = typeof(T);
            var sql  = type.GenerateUpdateSqlString();
            var rows = DbHelperSql.ExecuteSql(sql, AdoUtil.GetParameters(entity));

            return(rows > 0);
        }
Exemplo n.º 24
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.Gtoilet model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Gtoilet set ");
            strSql.Append("IsDeleted=@IsDeleted,");
            strSql.Append("GtoiletName=@GtoiletName,");
            strSql.Append("GtoiletAddress=@GtoiletAddress,");
            strSql.Append("Lon=@Lon,");
            strSql.Append("Lat=@Lat,");
            strSql.Append("GtoiletStaues=@GtoiletStaues,");
            strSql.Append("KongqiZhil=@KongqiZhil,");
            strSql.Append("WaterYujin=@WaterYujin,");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("AddPeople=@AddPeople,");
            strSql.Append("Picture=@Picture");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@IsDeleted",      SqlDbType.Int,                4),
                new SqlParameter("@GtoiletName",    SqlDbType.NVarChar,         255),
                new SqlParameter("@GtoiletAddress", SqlDbType.NVarChar,         255),
                new SqlParameter("@Lon",            SqlDbType.NVarChar,         255),
                new SqlParameter("@Lat",            SqlDbType.NVarChar,         255),
                new SqlParameter("@GtoiletStaues",  SqlDbType.NVarChar,         255),
                new SqlParameter("@KongqiZhil",     SqlDbType.NVarChar,         255),
                new SqlParameter("@WaterYujin",     SqlDbType.NVarChar,         255),
                new SqlParameter("@AddTime",        SqlDbType.NVarChar,         255),
                new SqlParameter("@AddPeople",      SqlDbType.NVarChar,         255),
                new SqlParameter("@Picture",        SqlDbType.NVarChar,          -1),
                new SqlParameter("@GtoiletUuid",    SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@ID",             SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.IsDeleted;
            parameters[1].Value  = model.GtoiletName;
            parameters[2].Value  = model.GtoiletAddress;
            parameters[3].Value  = model.Lon;
            parameters[4].Value  = model.Lat;
            parameters[5].Value  = model.GtoiletStaues;
            parameters[6].Value  = model.KongqiZhil;
            parameters[7].Value  = model.WaterYujin;
            parameters[8].Value  = model.AddTime;
            parameters[9].Value  = model.AddPeople;
            parameters[10].Value = model.Picture;
            parameters[11].Value = model.GtoiletUuid;
            parameters[12].Value = model.ID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.ArticlesManagement model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update ArticlesManagement set ");
            strSql.Append("ArticleTitle=@ArticleTitle,");
            strSql.Append("ArticleTypeUUID=@ArticleTypeUUID,");
            strSql.Append("ReleaseTime=@ReleaseTime,");
            strSql.Append("IsDelete=@IsDelete,");
            strSql.Append("IsRelease=@IsRelease,");
            strSql.Append("CoverPhoto=@CoverPhoto,");
            strSql.Append("ArticleName=@ArticleName,");
            strSql.Append("AddPeople=@AddPeople,");
            strSql.Append("AddTime=@AddTime,");
            strSql.Append("Count=@Count,");
            strSql.Append("IsRecommend=@IsRecommend");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ArticleTitle",    SqlDbType.VarChar,          255),
                new SqlParameter("@ArticleTypeUUID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@ReleaseTime",     SqlDbType.VarChar,          255),
                new SqlParameter("@IsDelete",        SqlDbType.Int,                4),
                new SqlParameter("@IsRelease",       SqlDbType.Int,                4),
                new SqlParameter("@CoverPhoto",      SqlDbType.VarChar,           -1),
                new SqlParameter("@ArticleName",     SqlDbType.VarChar,           -1),
                new SqlParameter("@AddPeople",       SqlDbType.VarChar,          255),
                new SqlParameter("@AddTime",         SqlDbType.DateTime),
                new SqlParameter("@Count",           SqlDbType.Int,                4),
                new SqlParameter("@IsRecommend",     SqlDbType.Bit,                1),
                new SqlParameter("@ID",              SqlDbType.Int,                4),
                new SqlParameter("@ArticleUUID",     SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value  = model.ArticleTitle;
            parameters[1].Value  = model.ArticleTypeUUID;
            parameters[2].Value  = model.ReleaseTime;
            parameters[3].Value  = model.IsDelete;
            parameters[4].Value  = model.IsRelease;
            parameters[5].Value  = model.CoverPhoto;
            parameters[6].Value  = model.ArticleName;
            parameters[7].Value  = model.AddPeople;
            parameters[8].Value  = model.AddTime;
            parameters[9].Value  = model.Count;
            parameters[10].Value = model.IsRecommend;
            parameters[11].Value = model.ID;
            parameters[12].Value = model.ArticleUUID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 26
0
        //SELECT     TOP (200) Id, NovelId, ChapterUrl, NextUrl, Chapter, ChapterIdx, ChapterName, HeadWord, Content, WordCount, UpdateTime
        //FROM         Chapters

        #region 编辑章节数据

        /// <summary>
        /// 编辑章节数据
        /// </summary>
        /// <param name="model">章节实体</param>
        /// <returns></returns>
        public static int Edit(Chapters model)
        {
            string strSql = string.Format
                                (@"UPDATE Chapters SET Chapter='{1}', Content='{2}', WordCount='{3}', ValidChapter = '{4}'
                     WHERE (Id = '{0}');"
                                , model.Id, model.Chapter, model.Content, model.Content.Length, model.ValidChapter);

            return(DbHelperSql.ExecuteSql(strSql));
        }
Exemplo n.º 27
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Haikan.LabSystemCore.Model.EntranceGuard model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update EntranceGuard set ");
            strSql.Append("GNameListID=@GNameListID,");
            strSql.Append("Entcardnumber=@Entcardnumber,");
            strSql.Append("ip=@ip,");
            strSql.Append("USB=@USB,");
            strSql.Append("stime=@stime,");
            strSql.Append("etime=@etime,");
            strSql.Append("GNameListName=@GNameListName,");
            strSql.Append("StudenListID=@StudenListID,");
            strSql.Append("StudentListName=@StudentListName,");
            strSql.Append("EntcardType=@EntcardType,");
            strSql.Append("Port=@Port");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@GNameListID",     SqlDbType.NVarChar,   -1),
                new SqlParameter("@Entcardnumber",   SqlDbType.NVarChar,   -1),
                new SqlParameter("@ip",              SqlDbType.NVarChar,   50),
                new SqlParameter("@USB",             SqlDbType.Int,         4),
                new SqlParameter("@stime",           SqlDbType.DateTime),
                new SqlParameter("@etime",           SqlDbType.DateTime),
                new SqlParameter("@GNameListName",   SqlDbType.NVarChar,   -1),
                new SqlParameter("@StudenListID",    SqlDbType.NVarChar,   -1),
                new SqlParameter("@StudentListName", SqlDbType.NVarChar,   -1),
                new SqlParameter("@EntcardType",     SqlDbType.VarChar,   255),
                new SqlParameter("@Port",            SqlDbType.VarChar,   255),
                new SqlParameter("@id",              SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.GNameListID;
            parameters[1].Value  = model.Entcardnumber;
            parameters[2].Value  = model.ip;
            parameters[3].Value  = model.USB;
            parameters[4].Value  = model.stime;
            parameters[5].Value  = model.etime;
            parameters[6].Value  = model.GNameListName;
            parameters[7].Value  = model.StudenListID;
            parameters[8].Value  = model.StudentListName;
            parameters[9].Value  = model.EntcardType;
            parameters[10].Value = model.Port;
            parameters[11].Value = model.id;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// 编辑站点数据
        /// </summary>
        /// <param name="model">站点实体</param>
        /// <returns></returns>
        public static int Edit(WebSites model)
        {
            string strSql = string.Format
                                (@"UPDATE WebSites SET Name='{1}', WebUrl='{2}', ContentName='{3}', HeaderName='{4}', NextName='{5}'
                , NextTitle='{6}', Valid='{7}', UrlCombine='{8}', Encoding='{9}' WHERE (Id = '{0}');"
                                , model.Id, model.Name, model.WebUrl, model.ContentName, model.HeaderName, model.NextName
                                , model.NextTitle, model.Valid, model.UrlCombine, model.Encoding);

            return(DbHelperSql.ExecuteSql(strSql));
        }
Exemplo n.º 29
0
        //SELECT     TOP (200) Id, WebId, Title, NovelUrl, StartUrl, LatestChapter, Author
        //    , TypeId, Status, RecentUpdate, ChapterCount, CreateTime, ChapterChar, StartChapterIdx, ChapterType
        //FROM         Novels

        #region 编辑小说数据

        /// <summary>
        /// 编辑小说数据
        /// </summary>
        /// <param name="model">小说实体</param>
        /// <returns></returns>
        public static int Edit(Model.Novels model)
        {
            string strSql = string.Format
                                (@"UPDATE Novels SET WebId='{1}', Title='{2}', NovelUrl='{3}', StartUrl='{4}', LatestChapter='{5}', Author='{6}'
                , TypeId='{7}', Status='{8}', StartChapterIdx='{9}', ChapterChar='{10}', ChapterType='{11}' WHERE (Id = '{0}');"
                                , model.Id, model.WebId, model.Title, model.NovelUrl, model.StartUrl, model.LatestChapter, model.Author
                                , model.TypeId, model.Status, model.StartChapterIdx, model.ChapterChar, model.ChapterType);

            return(DbHelperSql.ExecuteSql(strSql));
        }
Exemplo n.º 30
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(HeqiaoDaoshiCore.Model.Information model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Information set ");
            strSql.Append("CreateTime=@CreateTime,");
            strSql.Append("Title=@Title,");
            strSql.Append("InformationTypeUUID=@InformationTypeUUID,");
            strSql.Append("Introduce=@Introduce,");
            strSql.Append("Address=@Address,");
            strSql.Append("StartTime=@StartTime,");
            strSql.Append("Picture=@Picture,");
            strSql.Append("State=@State,");
            strSql.Append("IsDeleted=@IsDeleted,");
            strSql.Append("Photo=@Photo");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@CreateTime",          SqlDbType.DateTime2,          8),
                new SqlParameter("@Title",               SqlDbType.VarChar,          255),
                new SqlParameter("@InformationTypeUUID", SqlDbType.UniqueIdentifier,  16),
                new SqlParameter("@Introduce",           SqlDbType.VarChar,           -1),
                new SqlParameter("@Address",             SqlDbType.VarChar,          255),
                new SqlParameter("@StartTime",           SqlDbType.DateTime),
                new SqlParameter("@Picture",             SqlDbType.VarChar,           -1),
                new SqlParameter("@State",               SqlDbType.Bit,                1),
                new SqlParameter("@IsDeleted",           SqlDbType.Int,                4),
                new SqlParameter("@Photo",               SqlDbType.VarChar,           -1),
                new SqlParameter("@ID",                  SqlDbType.Int,                4),
                new SqlParameter("@InformationUUID",     SqlDbType.UniqueIdentifier, 16)
            };
            parameters[0].Value  = model.CreateTime;
            parameters[1].Value  = model.Title;
            parameters[2].Value  = model.InformationTypeUUID;
            parameters[3].Value  = model.Introduce;
            parameters[4].Value  = model.Address;
            parameters[5].Value  = model.StartTime;
            parameters[6].Value  = model.Picture;
            parameters[7].Value  = model.State;
            parameters[8].Value  = model.IsDeleted;
            parameters[9].Value  = model.Photo;
            parameters[10].Value = model.ID;
            parameters[11].Value = model.InformationUUID;

            int rows = DbHelperSql.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }