///// <summary>
        ///// 获取文件最新的版本
        ///// </summary>
        ///// <param name="fileName"></param>
        ///// <param name="forderId"></param>
        ///// <returns></returns>
        //public int GetFileLastVer(string fileName, int forderId)
        //{
        //    return dal.GetFileLastVer(fileName, forderId);
        //}


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.FileVersion model)
        {
            return(dal.Add(model));
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Model.FileVersion model)
        {
            string contentId = Guid.NewGuid().ToString();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into [" + databaseprefix + "FileVersion](");
            strSql.Append("Ver,UserID,UserName,File_Id,File_Type,File_Size,File_Md5,File_Ext,File_SmallImage,File_LargeImage,Content,File_Modify_Time,IsDeleted,ActionNum,ComputerName,Ip,ClientPath,Remark,Add_Time,FileContentId)");
            strSql.Append(" values (");
            strSql.Append("@Ver,@UserID,@UserName,@File_Id,@File_Type,@File_Size,@File_Md5,@File_Ext,@File_SmallImage,@File_LargeImage,@Content,@File_Modify_Time,@IsDeleted,@ActionNum,@ComputerName,@Ip,@ClientPath,@Remark,@Add_Time,@FileContentId)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@Ver",              SqlDbType.Int,           4),
                new SqlParameter("@UserID",           SqlDbType.Int),
                new SqlParameter("@UserName",         SqlDbType.NVarChar,    100),
                new SqlParameter("@File_Id",          SqlDbType.Int),
                new SqlParameter("@File_Type",        SqlDbType.NVarChar,    100),
                new SqlParameter("@File_Size",        SqlDbType.Int),
                new SqlParameter("@File_Md5",         SqlDbType.NVarChar,    100),
                new SqlParameter("@File_Ext",         SqlDbType.NVarChar,    200),
                new SqlParameter("@File_SmallImage",  SqlDbType.VarBinary),
                new SqlParameter("@File_LargeImage",  SqlDbType.VarBinary),
                new SqlParameter("@Content",          SqlDbType.VarBinary),
                new SqlParameter("@File_Modify_Time", SqlDbType.BigInt),
                new SqlParameter("@IsDeleted",        SqlDbType.TinyInt),
                new SqlParameter("@ActionNum",        SqlDbType.TinyInt),
                new SqlParameter("@ComputerName",     SqlDbType.NVarChar,    200),
                new SqlParameter("@Ip",               SqlDbType.NVarChar,    200),
                new SqlParameter("@ClientPath",       SqlDbType.NVarChar,   2000),
                new SqlParameter("@Remark",           SqlDbType.NVarChar,   2000),
                new SqlParameter("@Add_Time",         SqlDbType.DateTime),
                new SqlParameter("@FileContentId",    SqlDbType.NVarChar),
            };

            parameters[0].Value  = model.Ver;
            parameters[1].Value  = model.UserID;
            parameters[2].Value  = model.UserName;
            parameters[3].Value  = model.File_Id;
            parameters[4].Value  = model.File_Type;
            parameters[5].Value  = model.File_Size;
            parameters[6].Value  = model.File_Md5;
            parameters[7].Value  = model.File_Ext;
            parameters[8].Value  = model.File_SmallImage;
            parameters[9].Value  = model.File_LargeImage;
            parameters[10].Value = new byte[1];
            parameters[11].Value = model.File_Modify_Time;
            parameters[12].Value = model.IsDeleted;
            parameters[13].Value = model.ActionNum;
            parameters[14].Value = model.ComputerName;
            parameters[15].Value = model.Ip;
            parameters[16].Value = model.ClientPath;
            parameters[17].Value = model.Remark;
            parameters[18].Value = model.Add_Time;
            parameters[19].Value = contentId;
            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            int retId = Convert.ToInt32(obj);

            //文件内容的上传
            Model.FileContentModel contentModel = new FileContentModel()
            {
                ID           = contentId,
                Add_Time     = DateTime.Now,
                File_Content = model.Content,
                File_ID      = model.File_Id,
                File_Ver     = model.Ver.ToString(),
                File_VerID   = retId
            };
            string fileContentId = new DAL.FileContentDal(databaseprefix).Add(contentModel);

            if (obj == null || string.IsNullOrEmpty(fileContentId))
            {
                return(0);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }