To download this file, please login or click here to register
Description:
DBLogic, Database interface class for Microsoft SQL SqlServer much more sophesticated and optimized compared to Microsoft Application Datablocks. Usage public static long InsertContent(long priority, long parent_id, long content_type_id, string aspnet_User_UserId, string name, string comments, string callout_name, string layout, bool system_use, bool searchable, bool active) { SqlParameter[] Param = new SqlParameter[12]; Param[0] = new SqlParameter("@id", SqlDbType.BigInt); Param[1] = new SqlParameter("@priority", SqlDbType.BigInt); Param[2] = new SqlParameter("@parent_id", SqlDbType.BigInt); Param[3] = new SqlParameter("@content_type_id", SqlDbType.BigInt); Param[4] = new SqlParameter("@aspnet_User_UserId", SqlDbType.UniqueIdentifier); Param[5] = new SqlParameter("@name", SqlDbType.VarChar); Param[6] = new SqlParameter("@comments", SqlDbType.VarChar); Param[7] = new SqlParameter("@callout_name", SqlDbType.VarChar); Param[8] = new SqlParameter("@layout", SqlDbType.VarChar); Param[9] = new SqlParameter("@system_use", SqlDbType.Bit); Param[10] = new SqlParameter("@searchable", SqlDbType.Bit); Param[11] = new SqlParameter("@active", SqlDbType.Bit); Param[0].Direction = ParameterDirection.Output; Param[1].Value = (priority == -1 ? (object)DBNull.Value : (object)priority); Param[2].Value = (parent_id == -1 ? (object)DBNull.Value : (object)parent_id); Param[3].Value = content_type_id; Param[4].Value = (aspnet_User_UserId == null || aspnet_User_UserId.Trim() == "" ? (object)DBNull.Value : (object)new Guid(aspnet_User_UserId)); Param[5].Value = name; Param[6].Value = comments; Param[7].Value = callout_name; Param[8].Value = layout; Param[9].Value = system_use; Param[10].Value = searchable; Param[11].Value = active; DBLogic.InsertInDB("spInsertContent", Param); return Convert.ToInt64(Param[0].Value); } public static void UpdateContent(long id, long priority, long parent_id, long content_type_id, string aspnet_User_UserId, string name, string comments, string callout_name, string layout, bool system_use, bool searchable, bool active) { SqlParameter[] Param = new SqlParameter[12]; Param[0] = new SqlParameter("@id", SqlDbType.BigInt); Param[1] = new SqlParameter("@priority", SqlDbType.BigInt); Param[2] = new SqlParameter("@parent_id", SqlDbType.BigInt); Param[3] = new SqlParameter("@content_type_id", SqlDbType.BigInt); Param[4] = new SqlParameter("@aspnet_User_UserId", SqlDbType.UniqueIdentifier); Param[5] = new SqlParameter("@name", SqlDbType.VarChar); Param[6] = new SqlParameter("@comments", SqlDbType.VarChar); Param[7] = new SqlParameter("@callout_name", SqlDbType.VarChar); Param[8] = new SqlParameter("@layout", SqlDbType.VarChar); Param[9] = new SqlParameter("@system_use", SqlDbType.VarChar); Param[10] = new SqlParameter("@searchable", SqlDbType.VarChar); Param[11] = new SqlParameter("@active", SqlDbType.VarChar); Param[0].Value = id; Param[1].Value = (priority == -1 ? (object)DBNull.Value : (object)priority); Param[2].Value = (parent_id == -1 ? (object)DBNull.Value : (object)parent_id); Param[3].Value = content_type_id; Param[4].Value = (aspnet_User_UserId == null || aspnet_User_UserId.Trim() == "" ? (object)DBNull.Value : (object)new Guid(aspnet_User_UserId)); Param[5].Value = name; Param[6].Value = comments; Param[7].Value = callout_name; Param[8].Value = layout; Param[9].Value = system_use; Param[10].Value = searchable; Param[11].Value = active; DBLogic.UpdateInDb("spUpdateContent", Param); } public static long InsertContent(SqlCommand Cmd, long priority, long parent_id, long content_type_id, string aspnet_User_UserId, string name, string comments, string callout_name, string layout, bool system_use, bool searchable, bool active) { SqlParameter[] Param = new SqlParameter[12]; Param[0] = new SqlParameter("@id", SqlDbType.BigInt); Param[1] = new SqlParameter("@priority", SqlDbType.BigInt); Param[2] = new SqlParameter("@parent_id", SqlDbType.BigInt); Param[3] = new SqlParameter("@content_type_id", SqlDbType.BigInt); Param[4] = new SqlParameter("@aspnet_User_UserId", SqlDbType.UniqueIdentifier); Param[5] = new SqlParameter("@name", SqlDbType.VarChar); Param[6] = new SqlParameter("@comments", SqlDbType.VarChar); Param[7] = new SqlParameter("@callout_name", SqlDbType.VarChar); Param[8] = new SqlParameter("@layout", SqlDbType.VarChar); Param[9] = new SqlParameter("@system_use", SqlDbType.Bit); Param[10] = new SqlParameter("@searchable", SqlDbType.Bit); Param[11] = new SqlParameter("@active", SqlDbType.Bit); Param[0].Direction = ParameterDirection.Output; Param[1].Value = (priority == -1 ? (object)DBNull.Value : (object)priority); Param[2].Value = (parent_id == -1 ? (object)DBNull.Value : (object)parent_id); Param[3].Value = content_type_id; Param[4].Value = (aspnet_User_UserId == null || aspnet_User_UserId.Trim() == "" ? (object)DBNull.Value : (object)new Guid(aspnet_User_UserId)); Param[5].Value = name; Param[6].Value = comments; Param[7].Value = callout_name; Param[8].Value = layout; Param[9].Value = system_use; Param[10].Value = searchable; Param[11].Value = active; DBLogic.InsertInDB(Cmd, "spInsertContent", Param); return Convert.ToInt64(Param[0].Value); } public static void UpdateContent(SqlCommand Cmd, long id, long priority, long parent_id, long content_type_id, string aspnet_User_UserId, string name, string comments, string callout_name, string layout, bool system_use, bool searchable, bool active) { SqlParameter[] Param = new SqlParameter[12]; Param[0] = new SqlParameter("@id", SqlDbType.BigInt); Param[1] = new SqlParameter("@priority", SqlDbType.BigInt); Param[2] = new SqlParameter("@parent_id", SqlDbType.BigInt); Param[3] = new SqlParameter("@content_type_id", SqlDbType.BigInt); Param[4] = new SqlParameter("@aspnet_User_UserId", SqlDbType.UniqueIdentifier); Param[5] = new SqlParameter("@name", SqlDbType.VarChar); Param[6] = new SqlParameter("@comments", SqlDbType.VarChar); Param[7] = new SqlParameter("@callout_name", SqlDbType.VarChar); Param[8] = new SqlParameter("@layout", SqlDbType.VarChar); Param[9] = new SqlParameter("@system_use", SqlDbType.VarChar); Param[10] = new SqlParameter("@searchable", SqlDbType.VarChar); Param[11] = new SqlParameter("@active", SqlDbType.VarChar); Param[0].Value = id; Param[1].Value = (priority == -1 ? (object)DBNull.Value : (object)priority); Param[2].Value = (parent_id == -1 ? (object)DBNull.Value : (object)parent_id); Param[3].Value = content_type_id; Param[4].Value = (aspnet_User_UserId == null || aspnet_User_UserId.Trim() == "" ? (object)DBNull.Value : (object)new Guid(aspnet_User_UserId)); Param[5].Value = name; Param[6].Value = comments; Param[7].Value = callout_name; Param[8].Value = layout; Param[9].Value = system_use; Param[10].Value = searchable; Param[11].Value = active; DBLogic.UpdateInDb(Cmd, "spUpdateContent", Param); }
Submitted On:
06 Apr 2010
Submitted By:
Umair Shahid (Umair)
File Version:
1.0
File Size:
2.77 Kb
Downloads:
0
Support:
Click Here
Credits
1
Rating:
stars/0.gifTotal Votes:0

NRZEE BLOG

Blog

NRZEE Managing Director Neil Rabin rss

  • REGISTER HERE FOR FREE
  • REGISTER HERE FOR FREE