public static IDataReader GetByItemGuid(Guid itemGuid,Guid userGuid,string controlID) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_SelectByItemGuid",3); sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, itemGuid); sph.DefineSqlParameter("@UserGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, userGuid); sph.DefineSqlParameter("@ControlID", SqlDbType.NVarChar, 256, ParameterDirection.Input, controlID); return sph.ExecuteReader(); }
public static int GetCountByItemGuid(Guid catGuid, string q) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_DN_GetCountByItemGuid", 2); sph.DefineSqlParameter("@ItemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, catGuid); sph.DefineSqlParameter("@KeySearch", SqlDbType.NVarChar, 256, ParameterDirection.Input, q); return Convert.ToInt32(sph.ExecuteScalar()); }
/// <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; }
/// <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; }
/// <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; }
/// <summary> /// Gets an IDataReader with one row from the gv_BuoiGiangDay table. /// </summary> /// <param name="buoiGiangGuid"> buoiGiangGuid </param> public IDataReader GetOne( Guid buoiGiangGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_BuoiGiangDay_SelectOne", 1); sph.DefineSqlParameter("@BuoiGiangGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, buoiGiangGuid); return sph.ExecuteReader(); }
/// <summary> /// Gets an IDataReader with one row from the gv_MonHoc table. /// </summary> /// <param name="monHocGuid"> monHocGuid </param> public IDataReader GetOne( Guid monHocGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_MonHoc_Chuongtv31072015_GetOne", 1); sph.DefineSqlParameter("@MonHocGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, monHocGuid); return sph.ExecuteReader(); }
/// <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; }
/// <summary> /// Gets an IDataReader with one row from the doc_FileSystem table. /// </summary> /// <param name="fileSystemGuid"> fileSystemGuid </param> //doanh nghiep public static IDataReader GetOne( Guid fileSystemGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "doc_FileSystem_DN_SelectOne", 1); sph.DefineSqlParameter("@FileSystemGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, fileSystemGuid); return sph.ExecuteReader(); }
/// <summary> /// Gets a count of rows in the UserProfile table. /// </summary> public static int GetCount(string q) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "UserProfile_hoadm01082015_GetCount", 1); sph.DefineSqlParameter("@KeySearch", SqlDbType.NVarChar, 256, ParameterDirection.Input, q); return Convert.ToInt32(sph.ExecuteScalar()); }
/// <summary> /// Gets an IDataReader with all rows in the UserProfile table. /// </summary> public static IDataReader GetAll(string q) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "UserProfile_hoadm01082015_SelectAll", 1); sph.DefineSqlParameter("@KeySearch", SqlDbType.NVarChar, 256, ParameterDirection.Input, q); return sph.ExecuteReader(); }
/// <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); }
/// <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); }
/// <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; }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// Inserts a row in the UserProfile table. Returns rows affected count. /// </summary> /// <returns>int</returns> public static int Create(Users item) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetWriteConnectionString(), "UserProfile_hoadm01082015_Insert", 8); //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("@CreatedUser", SqlDbType.UniqueIdentifier, ParameterDirection.Input, item.CreatedUser); sph.DefineSqlParameter("@CreatedDate", SqlDbType.DateTime, ParameterDirection.Input, item.CreatedDate); //sph.DefineSqlParameter("@UpdatedUser", 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 = Convert.ToInt32(sph.ExecuteScalar()); return rowsAffected; }
internal static IDataReader GetDanhMucGuid_ByLoaiDanhMucGuid(Guid ValueGuid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_GetDanhMucGuid_ByLoaiDanhMucGuid", 1); sph.DefineSqlParameter("@KindCatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, ValueGuid); return sph.ExecuteReader(); }
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); }
internal static bool CheckExistUser(Catologie itemSP) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_UserProfile_CheckExistUser", 1); sph.DefineSqlParameter("@UserName", SqlDbType.NVarChar,256, ParameterDirection.Input, itemSP.Massv); return Convert.ToInt32(sph.ExecuteScalar())>0; }
internal static IDataReader GetAllCatologies(Guid valueGuid, int active) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_GetAllCatologies", 2); sph.DefineSqlParameter("@ValueGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, valueGuid); sph.DefineSqlParameter("@Active", SqlDbType.Int, ParameterDirection.Input, active); return sph.ExecuteReader(); }
internal IDataReader GetAllByMonGuidAndUser(Guid MonGuida, int UserID) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_BuoiGiangDay_tsandtm_GetAllByMonGuidAndUser", 2); sph.DefineSqlParameter("@MonHocGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, MonGuida); sph.DefineSqlParameter("@UserID", SqlDbType.Int, ParameterDirection.Input, UserID); return sph.ExecuteReader(); }
internal static IDataReader GetAllDanhMuc_TheoDanhMucCha(Guid ValueGuid, int IsActive) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_GetAllDanhMuc_TheoDanhMucCha", 2); sph.DefineSqlParameter("@GuidDanhMucCha", SqlDbType.UniqueIdentifier, ParameterDirection.Input, ValueGuid); sph.DefineSqlParameter("@IsActive", SqlDbType.Int, ParameterDirection.Input, IsActive); return sph.ExecuteReader(); }
//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; }
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); }
internal IDataReader GetAllMonHocTheoGiangVien(int Userid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_MonHoc_Chuongtv31072015_GetAllMonHocTheoGiangVien", 1); sph.DefineSqlParameter("@Userid", SqlDbType.Int, ParameterDirection.Input, Userid); return sph.ExecuteReader(); }
public static int GetCount(Guid rootGuid, int isActive) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_GetCount_2para", 2); sph.DefineSqlParameter("@RootGuid", SqlDbType.NVarChar, 256, ParameterDirection.Input, rootGuid.ToString()); sph.DefineSqlParameter("@IsActive", SqlDbType.Int, ParameterDirection.Input, isActive); return Convert.ToInt32(sph.ExecuteScalar()); }
/// <summary> /// Gets a page of data from the gv_BuoiGiangDay table. /// </summary> /// <param name="pageNumber">The page number.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="totalPages">total pages</param> public IDataReader GetPage( int pageNumber, int pageSize, out int totalrow ) { totalrow = GetCount(); SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "gv_BuoiGiangDay_SelectPage", 2); sph.DefineSqlParameter("@PageNumber", SqlDbType.Int, ParameterDirection.Input, pageNumber); sph.DefineSqlParameter("@PageSize", SqlDbType.Int, ParameterDirection.Input, pageSize); return sph.ExecuteReader(); }
internal static int GetMaxPositionByKindGuid(Guid Kindguid) { SqlParameterHelper sph = new SqlParameterHelper(ConnectionStringStatic.GetReadConnectionString(), "cont_Catologies_ngocnv10052014_SelectMaxPosition", 1); sph.DefineSqlParameter("@KindCatologyGuid", SqlDbType.UniqueIdentifier, ParameterDirection.Input, Kindguid); return Convert.ToInt32(sph.ExecuteScalar()); }