Esempio n. 1
0
        /// <summary>
        /// Deletes a row from the doc_FileSystem table. Returns true if row deleted.
        /// </summary>
        /// <param name="fileSystemGuid"> fileSystemGuid </param>
        /// <returns>bool</returns>
        public static bool Delete(
			Guid fileSystemGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "doc_FileSystem_Delete", 1);
            sph.DefineSqlParameter("@FileSystemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fileSystemGuid);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
Esempio n. 2
0
 /// <summary>
 /// Deletes a row from the UserProfile table. Returns true if row deleted.
 /// </summary>
 /// <param name="userGuid"> userGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(
     int userID)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "UserProfile_hoadm01082015_Delete", 1);
     sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userID);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 3
0
 /// <summary>
 /// Deletes a row from the cont_Catologies table. Returns true if row deleted.
 /// </summary>
 /// <param name="catologyGuid"> catologyGuid </param>
 /// <returns>bool</returns>
 public static bool Delete(
     Guid catologyGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "cont_Catologies_ngocnv10052014_Delete", 1);
     sph.DefineSqlParameter("@CatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, catologyGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 4
0
 /// <summary>
 /// Deletes a row from the gv_MonHoc table. Returns true if row deleted.
 /// </summary>
 /// <param name="monHocGuid"> monHocGuid </param>
 /// <returns>bool</returns>
 public bool Delete(
     Guid monHocGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_MonHoc_Chuongtv01082015_Delete", 1);
     sph.DefineSqlParameter("@MonHocGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, monHocGuid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 5
0
        /// <summary>
        /// Deletes a row from the gv_BuoiGiangDay table. Returns true if row deleted.
        /// </summary>
        /// <param name="buoiGiangGuid"> buoiGiangGuid </param>
        /// <returns>bool</returns>
        public bool Delete(
			Guid buoiGiangGuid)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_BuoiGiangDay_Delete", 1);
            sph.DefineSqlParameter("@BuoiGiangGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, buoiGiangGuid);
            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
Esempio n. 6
0
        /// <summary>
        /// Inserts a row in the gv_GiangVien table. Returns rows affected count.
        /// </summary>
        /// <returns>int</returns>
        public int Create(GiangVien item)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_GiangVien_Insert", 3);
            sph.DefineSqlParameter("@GiangVienGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.GiangVienGuid);
            sph.DefineSqlParameter("@GiangvienName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.GiangvienName);
            sph.DefineSqlParameter("@GiangVienID", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.GiangVienID);

            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
Esempio n. 7
0
 /// <summary>
 /// Inserts a row in the gv_MonHoc table. Returns rows affected count.
 /// </summary>
 /// <returns>int</returns>
 public int Create(MonHoc item)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_MonHoc_Chuongtv31072015_Insert", 5);
     sph.DefineSqlParameter("@MonHocGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.MonHocGuid);
     sph.DefineSqlParameter("@MonHocName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.MonHocName);
     sph.DefineSqlParameter("@MonHocID", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.MonHocID);
     sph.DefineSqlParameter("@Userid", SqlDbType.Int, ParameterDirection.Input, item.Userid);
     sph.DefineSqlParameter("@SoBuoiGiangDay", SqlDbType.Int, ParameterDirection.Input, item.SoBuoiGiangDay);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
Esempio n. 8
0
        /// <summary>
        /// Inserts a row in the gv_BuoiGiangDay table. Returns rows affected count.
        /// </summary>
        /// <returns>int</returns>
        public int Create(BuoiGiangDay item)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_BuoiGiangDay_Insert", 4);
            sph.DefineSqlParameter("@BuoiGiangGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.BuoiGiangGuid);
            sph.DefineSqlParameter("@BuoiGiangID", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.BuoiGiangID);
            sph.DefineSqlParameter("@BuoiGiangName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.BuoiGiangName);
            sph.DefineSqlParameter("@MonHocGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.MonHocGuid);

            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
Esempio n. 9
0
 /// <summary>
 /// Inserts a row in the cont_Catologies table. Returns rows affected count.
 /// </summary>
 /// <returns>int</returns>
 public static int Create(Catologie item)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "cont_Catologies_ngocnv10052014_Insert", 10);
     sph.DefineSqlParameter("@CatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.CatologyGuid);
     sph.DefineSqlParameter("@CatologyName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.CatologyName);
     sph.DefineSqlParameter("@Description", SqlDbType.NVarChar, 500, ParameterDirection.Input, item.Description);
     sph.DefineSqlParameter("@KindCatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.KindCatologyGuid);
     sph.DefineSqlParameter("@KindCatologyName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.KindCatologyName);
     sph.DefineSqlParameter("@IsActive", SqlDbType.Bit, ParameterDirection.Input, item.IsActive);
     sph.DefineSqlParameter("@Position", SqlDbType.Int, ParameterDirection.Input, item.Position);
     sph.DefineSqlParameter("@ListStringToSort", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.ListStringToSort);
     sph.DefineSqlParameter("@UserName", SqlDbType.NVarChar,256, ParameterDirection.Input, item.Massv);
     sph.DefineSqlParameter("@IsNotDelete", SqlDbType.Bit, ParameterDirection.Input, item.IsNotDelete);
     int rowsAffected = sph.ExecuteNonQuery();
     return rowsAffected;
 }
Esempio n. 10
0
        /// <summary>
        /// Inserts a row in the doc_FileSystem table. Returns rows affected count.
        /// </summary>
        /// <returns>int</returns>
        public static int Create(FileSystem item)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "doc_FileSystem_Insert", 10);
            sph.DefineSqlParameter("@FileSystemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.FileSystemGuid);
            sph.DefineSqlParameter("@FileSystemID", SqlDbType.NVarChar, 25, ParameterDirection.Input, item.FileSystemID);
            sph.DefineSqlParameter("@FileType", SqlDbType.NVarChar, 25, ParameterDirection.Input, item.FileType);
            sph.DefineSqlParameter("@FileSize", SqlDbType.Decimal, ParameterDirection.Input, item.FileSize);
            sph.DefineSqlParameter("@ClientFileName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.ClientFileName);
            sph.DefineSqlParameter("@ServerFileName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.ServerFileName);
            sph.DefineSqlParameter("@TableName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.TableName);
            sph.DefineSqlParameter("@UpdatedDate", SqlDbType.DateTime, ParameterDirection.Input, item.UpdatedDate);
            sph.DefineSqlParameter("@UpdatedUser", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.UpdatedUser);
            sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.ItemGuid);

            int rowsAffected = sph.ExecuteNonQuery();
            return rowsAffected;
        }
Esempio n. 11
0
 internal static bool DeleteByItemGuid(Guid itemGuid, string tablename)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_Nam_DeleteByItemGuidAndTableName", 2);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@TableName", SqlDbType.NVarChar,256, ParameterDirection.Input, tablename);
     int row = sph.ExecuteNonQuery();
     return (row > 0);
 }
Esempio n. 12
0
 internal bool ThemTaiLieuVaoCapDienTu(Guid fileguid, int userlogin)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "gv_MonHoc_Chuongtv01082015_ThemTaiLieuVaoCapDienTu", 2);
     sph.DefineSqlParameter("@UseridLogin", SqlDbType.Int, ParameterDirection.Input, userlogin);
     sph.DefineSqlParameter("@FileSystemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fileguid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 13
0
        internal static bool ResetPass(int userID, string p)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "UserProfile_hoadm01082015_ResetPass", 1);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userID);
            sph.DefineSqlParameter("@Text", SqlDbType.NVarChar, 50, ParameterDirection.Input, p);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
Esempio n. 14
0
 //tsandtm add save file thumbnail
 internal static bool SaveFile(Guid GuidCatology, string FileNameThumbnail)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_UpdateImage", 2);
     sph.DefineSqlParameter("@CatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, GuidCatology);
     sph.DefineSqlParameter("@URLHinhAnh", SqlDbType.NVarChar, 256, ParameterDirection.Input, FileNameThumbnail);
     return Convert.ToInt32(sph.ExecuteNonQuery()) > 0;
 }
Esempio n. 15
0
 internal static bool RemoveBookInBag(Guid FileGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_RemoveBookInBag", 1);
     sph.DefineSqlParameter("@FileGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, FileGuid);
     int row = sph.ExecuteNonQuery();
     return (row > 0);
 }
Esempio n. 16
0
        internal static bool CapNhapDanhSachFollower(int userlogin, int id)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "UserProfile_hoadm01082015_CapNhapDanhSachFollower", 2);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, userlogin);
            sph.DefineSqlParameter("@Follower", SqlDbType.Int, ParameterDirection.Input, id);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }
Esempio n. 17
0
 /// <summary>
 /// Chuong
 /// </summary>
 /// <param name="itemGuid"></param>
 /// <returns></returns>
 internal static bool DeleteByItemGuid(Guid itemGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_DeleteByItemGuid", 1);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     int row = sph.ExecuteNonQuery();
     return (row > 0);
 }
Esempio n. 18
0
 internal bool ShareDocForStudent(Guid buoiguid, Guid monguid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_BuoiGiangDay_tsandtm_ShareDocForStudent", 2);
     sph.DefineSqlParameter("@buoiguid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, buoiguid);
     sph.DefineSqlParameter("@monguid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, monguid);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 19
0
 internal static bool UpdateItemGuid(Guid itemGuid, string ControlID, Guid UserGuid, Guid itemGuidTam)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "doc_FileSystem_UpdateItemGuid", 4);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     sph.DefineSqlParameter("@ControlID", SqlDbType.NVarChar, 256, ParameterDirection.Input, ControlID);
     sph.DefineSqlParameter("@UpdatedUser", SqlDbType.UniqueIdentifier, ParameterDirection.Input, UserGuid);
     sph.DefineSqlParameter("@ItemGuidTam", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuidTam);
     int rowsAffected = sph.ExecuteNonQuery();
     return (rowsAffected > 0);
 }
Esempio n. 20
0
 internal static bool UpdateLogLoi(Guid userGuid, string tableName, Guid itemGuid)
 {
     SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_UpdateItemGuidFileLogLoi", 3);
     sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid);
     sph.DefineSqlParameter("@TableName", SqlDbType.NVarChar, 256, ParameterDirection.Input, tableName);
     sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid);
     int row = sph.ExecuteNonQuery();
     return (row > 0);
 }
Esempio n. 21
0
        /// <summary>
        /// Updates a row in the UserProfile table. Returns true if row updated.
        /// </summary>
        /// <returns>bool</returns>
        public static bool Update(Users item)
        {
            SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "UserProfile_hoadm01082015_Update", 9);
            sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, item.UserId);
            sph.DefineSqlParameter("@UserName", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.UserName);
            sph.DefineSqlParameter("@AvatarExt", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.AvatarExt);
            sph.DefineSqlParameter("@NgaySinh", SqlDbType.DateTime, ParameterDirection.Input, item.NgaySinh);
            sph.DefineSqlParameter("@DienThoai", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.DienThoai);
            sph.DefineSqlParameter("@DiaChi", SqlDbType.NVarChar, 256, ParameterDirection.Input, item.DiaChi);
            //sph.DefineSqlParameter("@Password", SqlDbType.NVarChar, 50, ParameterDirection.Input, item.Password);
            sph.DefineSqlParameter("@UpdateUser", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.UpdatedUser);
            sph.DefineSqlParameter("@UpdatedDate", SqlDbType.DateTime, ParameterDirection.Input, item.UpdatedDate);
            sph.DefineSqlParameter("@FullName", SqlDbType.NVarChar, 25, ParameterDirection.Input, item.FullName);

            int rowsAffected = sph.ExecuteNonQuery();
            return (rowsAffected > 0);
        }