public int InsertPhoto(Photo objPhoto) { int retVal = 0; try { DbParam[] param = new DbParam[11]; param[0] = new DbParam("@PhotoId", objPhoto.PhotoId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@PhotoUrl", objPhoto.PhotoUrl, SqlDbType.VarChar); param[2] = new DbParam("@PhotoStatus", objPhoto.PhotoStatus, SqlDbType.VarChar); param[3] = new DbParam("@PhotoType", objPhoto.PhotoType, SqlDbType.VarChar); param[4] = new DbParam("@IsShared", objPhoto.IsShared, SqlDbType.Bit); param[5] = new DbParam("@IsLiked", objPhoto.IsLiked, SqlDbType.Bit); param[6] = new DbParam("@UserId", objPhoto.UserId, SqlDbType.UniqueIdentifier); param[7] = new DbParam("@PermissionId", objPhoto.PermissionId, SqlDbType.Int); param[8] = new DbParam("@IsHidden", objPhoto.IsHidden, SqlDbType.Bit); param[9] = new DbParam("@IsArchived", objPhoto.IsArchived, SqlDbType.Bit); param[10] = new DbParam("@IsShared1", objPhoto.IsShared1, SqlDbType.Bit); retVal = Db.Insert("SP_tblPhoto_Ins", param, true); return retVal; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public Guid InsertLike(Like objLike) { Guid retGuid = new Guid("00000000-0000-0000-0000-000000000000"); DataRow dr = null; try { DbParam[] param = new DbParam[4]; param[0] = new DbParam("@LikeId", objLike.LikeId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@StatusId", objLike.StatusId, SqlDbType.UniqueIdentifier); param[2] = new DbParam("@IsLiked", objLike.IsLiked, SqlDbType.Bit); param[3] = new DbParam("@UserId", objLike.UserId, SqlDbType.UniqueIdentifier); dr = Db.GetDataRow("proc_tblLike_Ins", param); if (dr != null && dr[0] != null) retGuid = Db.ToGuid(dr[0]); return retGuid; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
/// <summary> /// Function : GetAllFriendRequests /// Description : Get All friendRequests /// Inputs : UserId /// <return> /// output : IList<User> /// </return> /// </summary> public IList<User> GetAllFriendRequests(Guid UserId) { IList<User> objUsers = null; ObjUser = null; DataSet ds = new DataSet(); DbParam[] param = new DbParam[1]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); ds = Db.GetDataSet("sp_tblUser_GetFriendsRequests", param); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { objUsers = new List<User>(); foreach (DataRow row in ds.Tables[0].Rows) { ObjUser = new User(); ObjUser.UserId = Db.ToGuid(row["UserId"]); ObjUser.FirstName = Db.ToString(row["FirstName"]); ObjUser.LastName = Db.ToString(row["LastName"]); ObjUser.EmailId = Db.ToString(row["EmailId"]); ObjUser.Password = Db.ToString(row["Password"]); ObjUser.LoginId = Db.ToString(row["LoginId"]); ObjUser.UserImage = Db.ToString(row["UserImage"]); ObjUser.Designation = Db.ToString(row["Designation"]); objUsers.Add(ObjUser); } } return objUsers; }
public Guid InsertComment(Comment objComment) { Guid retGuid = new Guid("00000000-0000-0000-0000-000000000000"); DataRow dr = null; try { DbParam[] param = new DbParam[4]; param[0] = new DbParam("@CommentId", objComment.CommentId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@CommentName", objComment.CommentName, SqlDbType.VarChar); param[2] = new DbParam("@StatusId", objComment.StatusId, SqlDbType.UniqueIdentifier); param[3] = new DbParam("@UserId", objComment.UserId, SqlDbType.UniqueIdentifier); //retVal = Db.Insert("proc_tblComment_Ins", param, true); dr = Db.GetDataRow("proc_tblComment_Ins", param); if (dr != null && dr[0] != null) retGuid = Db.ToGuid(dr[0]); return retGuid; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public int InsertStatus(Status objStatus) { int retVal = 0; try { DbParam[] param = new DbParam[8]; param[0] = new DbParam("@StatusId", objStatus.StatusId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@StatusName", objStatus.StatusName, SqlDbType.NVarChar); param[2] = new DbParam("@StatusType", objStatus.StatusType, SqlDbType.VarChar); param[3] = new DbParam("@StatusUrl", objStatus.StatusUrl, SqlDbType.NVarChar); param[4] = new DbParam("@UserId", objStatus.UserId, SqlDbType.UniqueIdentifier); param[5] = new DbParam("@PermissionId", objStatus.PermissionId, SqlDbType.Int); param[6] = new DbParam("@IsHidden", objStatus.IsHidden, SqlDbType.Bit); param[7] = new DbParam("@IsArchived", objStatus.ISArchived, SqlDbType.Bit); retVal = Db.Insert("SP_tblStatus_Ins", param, true); return retVal; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public int SaveWidgets(string widgetIds, Guid userId) { DbParam[] param = new DbParam[2]; param[0] = new DbParam("@WidgetIds", widgetIds, SqlDbType.VarChar); param[1] = new DbParam("@UserId", userId, SqlDbType.UniqueIdentifier); return Db.Update("SP_tblUserDashboardWidget_InsUpd", param); }
/// <summary> /// Function : AcceptFriend /// Description : Accept Friend For a User /// Inputs : Friend(obj) /// <return> /// output : int /// </return> /// </summary> public int AcceptFriend(Guid UserId, Guid FriendUserId) { intReturn = 0; DbParam[] param = new DbParam[2]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@FriendUserId", FriendUserId, SqlDbType.UniqueIdentifier); intReturn = Db.Update("sp_tblFriendList_AcceptFriend", param, true); return intReturn; }
public NotificationDetails GetNotifications(int StartIndex, int MaxSize) { NotificationDetails objNotificationDetails = null; IList<Notification> objNotifications = null; Notification ObjNotification = null; DataSet ds = new DataSet(); DbParam[] param = new DbParam[2]; param[0] = new DbParam("@StartIndex", StartIndex, SqlDbType.Int); param[1] = new DbParam("@MaxSize", MaxSize, SqlDbType.Int); ds = Db.GetDataSet("proc_tblStatus_SelNotifications", param); if (ds != null) { objNotificationDetails = new NotificationDetails(); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { objNotifications = new List<Notification>(); foreach (DataRow row in ds.Tables[0].Rows) { ObjNotification = new Notification(); ObjNotification.IsPost = Convert.ToBoolean(row["IsPost"]); ObjNotification.IsShared = Convert.ToBoolean(row["IsShared"]); ObjNotification.IsCommented = Convert.ToBoolean(row["IsCommented"]); ObjNotification.IsLiked = Convert.ToBoolean(row["IsLiked"]); ObjNotification.IsCommentLiked = Convert.ToBoolean(row["IsCommentLiked"]); ObjNotification.StatusId = Db.ToGuid(row["StatusId"]); ObjNotification.StatusName = Db.ToString(row["StatusName"]); ObjNotification.StatusType = Db.ToString(row["StatusType"]); ObjNotification.StatusUrl = Db.ToString(row["StatusUrl"]); ObjNotification.CreatedDate = Db.ToString(row["CreatedDate"]); ObjNotification.CommentId = Db.ToGuid(row["CommentId"]); ObjNotification.CommentName = Db.ToString(row["CommentName"]); ObjNotification.UserId = Db.ToGuid(row["UserId"]); ObjNotification.FirstName = Db.ToString(row["FirstName"]); ObjNotification.LastName = Db.ToString(row["LastName"]); ObjNotification.UserImage = Db.ToString(row["UserImage"]); ObjNotification.NUserId = Db.ToGuid(row["NUserId"]); ObjNotification.NFirstName = Db.ToString(row["NFirstName"]); ObjNotification.NLastName = Db.ToString(row["NLastName"]); ObjNotification.NUserImage = Db.ToString(row["NUserImage"]); objNotifications.Add(ObjNotification); } objNotificationDetails.NotificationList = objNotifications; } if (ds.Tables.Count > 1 && ds.Tables[1].Rows.Count > 0) { int totalCount = Db.ToInteger(ds.Tables[1].Rows[0]["TotalCount"]); objNotificationDetails.PageCount = (int)(totalCount / MaxSize); if (totalCount > 0 && totalCount % MaxSize > 0) objNotificationDetails.PageCount += 1; } } return objNotificationDetails; }
public User ForceLogin(string UserName) { User objUser = null; DbParam[] param = new DbParam[] { new DbParam("@Username", UserName, SqlDbType.VarChar) }; dr = Db.GetDataRow("sp_tblUser_ForceLogin", param); if (dr != null) { GetObject(dr); } return objUser; }
/// <summary> /// Function : Insert /// Description : Add Friend For a User /// Inputs : Friend(obj) /// <return> /// output : int /// </return> /// </summary> public int Insert(Friend objFriend) { intReturn = 0; DbParam[] param = new DbParam[6]; param[0] = new DbParam("@UserId", objFriend.UserId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@FriendUserId", objFriend.FriendUserId, SqlDbType.UniqueIdentifier); param[2] = new DbParam("@IsAccepted", objFriend.IsAccepted, SqlDbType.Bit); param[3] = new DbParam("@IsBlocked", objFriend.IsBlocked, SqlDbType.Bit); param[4] = new DbParam("@IsMailSent", objFriend.IsMailSent, SqlDbType.Bit); param[5] = new DbParam("@IsRead", objFriend.IsRead, SqlDbType.Bit); intReturn = Db.Insert("sp_tblFriendList_Ins", param, true); return intReturn; }
public List<DashboardWidget> GetSelected(Guid UserId) { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); ds = Db.GetDataSet("SP_tblDashboardWidget_Sel_Selected", param); if (Db.IsDataExists(ds)) { widgets = new List<DashboardWidget>(); foreach (DataRow dr in ds.Tables[0].Rows) widgets.Add(GetObject(dr)); } return widgets; }
public int DeleteMessage(string MessageIds) { int intReturn = 0; try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@MessageIds", MessageIds, SqlDbType.VarChar); intReturn = Db.Update("proc_tblMessage_Del", param); return intReturn; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public int DeleteStatus(Guid StatusId) { int intReturn = 0; try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@StatusId", StatusId, SqlDbType.UniqueIdentifier); intReturn = Db.Update("proc_tblStatus_Del", param); return intReturn; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
/// <summary> /// Function : CheckLogin /// Description :Check valid user /// Inputs : username, password /// <return> /// output : User class object /// </return> /// </summary> public User CheckLogin(string username, string password) { User objUser = null; DbParam[] param = new DbParam[2]; param[0] = new DbParam("@LoginId", username, SqlDbType.VarChar); param[1] = new DbParam("@Password", password, SqlDbType.VarChar); dr = Db.GetDataRow("sp_tblUser_CheckLogin", param); if (dr != null) { GetObject(dr); } //if (Membership.ValidateUser(username, password)) //{ // objUser = ForceLogin(username); //} return ObjUser; }
public IList<CommentLike> LikeSelByUserId(Guid UserId) { try { DbParam[] param = new DbParam[1]; param[1] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); dt = Db.GetDataTable("proc_tblCommentLike_SelByUserId", null); if (dt != null) { objCommentLikes = new List<CommentLike>(); foreach (DataRow row in dt.Rows) objCommentLikes.Add(GetObject(row)); } return objCommentLikes; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public IList<Comment> SelAll(Guid StatusId) { try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@StatusId", StatusId, SqlDbType.UniqueIdentifier); dt = Db.GetDataTable("proc_tblComment_Sel", param); if (dt != null) { objComments = new List<Comment>(); foreach (DataRow row in dt.Rows) objComments.Add(GetObject(row)); } return objComments; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
//Inbox Messages public MessageDetails GetAllMessagesForInbox(int startRowIndex, int maximumRows, string SearchString, string SortBy, Guid ToUserId) { MessageDetails objMessageDetails = null; try { DbParam[] param = new DbParam[]{ new DbParam("@startRowIndex", startRowIndex, SqlDbType.Int), new DbParam("@maximumRows", maximumRows, SqlDbType.Int), new DbParam("@SearchString", SearchString, SqlDbType.VarChar), new DbParam("@SortBy", SortBy, SqlDbType.VarChar), new DbParam("@ToUserId", ToUserId, SqlDbType.UniqueIdentifier) }; ds = Db.GetDataSet("proc_tblMessage_GetAllMessagesByToUserId", param); if (ds != null) { objMessageDetails = new MessageDetails(); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { objMessages = new List<Message>(); foreach (DataRow dr in ds.Tables[0].Rows) objMessages.Add(GetObject(dr)); objMessageDetails.MessageList = objMessages; } if (ds.Tables.Count > 1 && ds.Tables[1].Rows.Count > 0) { int totalCount = Db.ToInteger(ds.Tables[1].Rows[0]["TotalCount"]); objMessageDetails.PageCount = (int)(totalCount / maximumRows); if (totalCount > 0 && totalCount % maximumRows > 0) objMessageDetails.PageCount += 1; } } return objMessageDetails; } catch { return null; } }
public int GetStatusCount(string SearchString) { try { DbParam[] param = new DbParam[1]; int UserProfileCount = 0; object obj; param[0] = new DbParam("@SearchString", SearchString, SqlDbType.VarChar); obj = Db.GetScalar("SP_tblStatus_SelCount", param); if (obj != null) { UserProfileCount = Db.ToInteger(obj); } return UserProfileCount; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
/// <summary> /// Function : InsertUser /// Description : Insert User /// Inputs : objUser /// </summary> /// <param name="objUser"></param> /// <returns></returns> public int InsertUser(User objUser) { DbParam[] param = new DbParam[] { new DbParam("@FirstName", objUser.FirstName, SqlDbType.NVarChar), new DbParam("@LastName", objUser.LastName, SqlDbType.NVarChar), new DbParam("@EmailId", objUser.EmailId, SqlDbType.NVarChar), new DbParam("@Password", objUser.Password, SqlDbType.VarChar), new DbParam("@LoginId", objUser.LoginId, SqlDbType.DateTime), new DbParam("@DOB", objUser.DOB, SqlDbType.DateTime), new DbParam("@Description", objUser.Description, SqlDbType.NVarChar), new DbParam("@UserImage", objUser.UserImage, SqlDbType.NVarChar), new DbParam("@Address", objUser.Address, SqlDbType.NVarChar), new DbParam("@City", objUser.City, SqlDbType.NVarChar), new DbParam("@State", objUser.State, SqlDbType.NVarChar), new DbParam("@Country", objUser.Country, SqlDbType.NVarChar), new DbParam("@Gender", objUser.Gender, SqlDbType.VarChar), new DbParam("@Designation", objUser.Designation, SqlDbType.NVarChar), new DbParam("@WorkAt", objUser.WorkAt, SqlDbType.NVarChar), new DbParam("@CollegeAt", objUser.CollegeAt, SqlDbType.NVarChar), new DbParam("@SchoolAt", objUser.SchoolAt, SqlDbType.NVarChar), new DbParam("@About", objUser.About, SqlDbType.NVarChar), new DbParam("@Phone", objUser.Phone, SqlDbType.VarChar) }; return Db.Update("sp_tblUser_INS", param, true); }
public IList<Status> SelPostsForWallByPaging(Guid LoggedInUserId, Guid SelectedUserId, string searchStriing, string sortBy, int startIndex, int pageSize, out int count) { try { count = 0; DbParam[] param = new DbParam[6]; param[0] = new DbParam("@LoggedInUserId", LoggedInUserId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@SelectedUserId", SelectedUserId, SqlDbType.UniqueIdentifier); param[2] = new DbParam("@StartIndex", startIndex, SqlDbType.Int); param[3] = new DbParam("@PageSize", pageSize, SqlDbType.Int); param[4] = new DbParam("@SortExpression", sortBy, SqlDbType.VarChar); param[5] = new DbParam("@SearchString", searchStriing, SqlDbType.VarChar); ds = Db.GetDataSet("proc_tblStatus_SelForWall_ByPaging", param); if (ds != null && ds.Tables.Count > 1) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { objStatuss = new List<Status>(); foreach (DataRow row in ds.Tables[0].Rows) { Status objStatus = GetStatusObject(row); objStatus.UserImage = Db.ToString(row["UserImage"]); objStatus.UserName = Db.ToString(row["UserName"]); objStatus.LikesCount = Db.ToInteger(row["LikesCount"]); DataRow[] rows; if (ds.Tables.Count > 2 && ds.Tables[2] != null && ds.Tables[2].Rows.Count > 0) { rows = ds.Tables[2].Select("StatusId = '" + Db.ToGuid(row["StatusId"]) + "'"); objComments = new List<Comment>(); foreach (DataRow row1 in rows) { objComments.Add(GetCommentObject(row1)); } objStatus.comments = objComments; } objStatuss.Add(objStatus); } } if (ds.Tables.Count > 1 && ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) { count = Db.ToInteger(ds.Tables[1].Rows[0].ItemArray[0]); } } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public IList<Status> SelPostsForWall(Guid LoggedInUserId, Guid SelectedUserId) { try { DbParam[] param = new DbParam[2]; param[0] = new DbParam("@LoggedInUserId", LoggedInUserId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@SelectedUserId", SelectedUserId, SqlDbType.UniqueIdentifier); ds = Db.GetDataSet("proc_tblStatus_SelforWall", param); if (ds != null && ds.Tables.Count > 1) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { objStatuss = new List<Status>(); foreach (DataRow row in ds.Tables[0].Rows) { Status objStatus = GetStatusObject(row); objStatus.UserImage = Db.ToString(row["UserImage"]); objStatus.UserName = Db.ToString(row["UserName"]); objStatus.LikesCount = Db.ToInteger(row["LikesCount"]); DataRow[] rows; if (ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) { rows = ds.Tables[1].Select("StatusId = '" + Db.ToGuid(row["StatusId"]) + "'"); objComments = new List<Comment>(); foreach (DataRow row1 in rows) { objComments.Add(GetCommentObject(row1)); } objStatus.comments = objComments; } objStatuss.Add(objStatus); } } } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public int InsertMessage(Guid FromUserId, string ToUserNames, string MessageDesc) { int retVal = 0; try { DbParam[] param = new DbParam[]{ new DbParam("@FromUserId",FromUserId,SqlDbType.UniqueIdentifier), new DbParam("@ToUserNames",ToUserNames,SqlDbType.VarChar), new DbParam("@MessageDesc",MessageDesc,SqlDbType.VarChar) }; retVal = Db.Insert("proc_tblMessage_Ins", param, true); } catch (Exception ex) { } return retVal; }
public IList<Status> SelPostsForTimeLine(Guid UserId) { try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); ds = Db.GetDataSet("proc_tblStatus_SelAllforNewsFeed", param); if (ds != null && ds.Tables.Count > 1) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { objStatuss = new List<Status>(); foreach (DataRow row in ds.Tables[0].Rows) { Status objStatus = GetStatusObject(row); DataRow[] rows; if (ds.Tables[1] != null && ds.Tables[1].Rows.Count > 0) { rows = ds.Tables[1].Select("StatusId = '" + Db.ToGuid(row["StatusId"]) + "'"); objComments = new List<Comment>(); foreach (DataRow row1 in rows) { objComments.Add(GetCommentObject(row1)); } objStatus.comments = objComments; } objStatuss.Add(objStatus); } } } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public IList<Status> SelPhotosOnly(Guid UserId) { try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); ds = Db.GetDataSet("proc_tblPhoto_SelAllforNewsFeed", param); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { objStatuss = new List<Status>(); foreach (DataRow row in ds.Tables[0].Rows) { Status objStatus = GetStatusObject(row); objStatuss.Add(objStatus); } } } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public int SelNewsFeedCount(Guid UserId) { int retVal = 0; try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); dt = Db.GetDataTable("proc_tblStatus_SelAllforNewsFeedCount", param); if (dt != null && dt.Rows.Count > 0) { retVal = Db.ToInteger(dt.Rows[0]["TotalCount"].ToString()); } } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } return retVal; }
public IList<Status> SelNewsFeedByPaging(Guid UserId, int maximumRows, int startRowIndex) { try { DbParam[] param = new DbParam[3]; param[0] = new DbParam("@UserId", UserId, SqlDbType.UniqueIdentifier); param[1] = new DbParam("@maximumRows", maximumRows, SqlDbType.Int); param[2] = new DbParam("@startRowIndex", startRowIndex, SqlDbType.Int); dt = Db.GetDataTable("[proc_tblStatus_SelAllforNewsFeedBypaging]", param); if (dt != null) { objStatuss = new List<Status>(); foreach (DataRow row in dt.Rows) objStatuss.Add(GetStatusObject(row)); } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public IList<Status> SelAllByPaging(string SortBy, string SearchString, int maximumRows, int startRowIndex) { try { DbParam[] param = new DbParam[4]; param[0] = new DbParam("@SortBy", SortBy, SqlDbType.VarChar); param[1] = new DbParam("@SearchString", SearchString, SqlDbType.VarChar); param[2] = new DbParam("@maximumRows", maximumRows, SqlDbType.Int); param[3] = new DbParam("@startRowIndex", startRowIndex, SqlDbType.Int); dt = Db.GetDataTable("SP_tblStatus_SelByPaging", param); if (dt != null) { objStatuss = new List<Status>(); foreach (DataRow row in dt.Rows) objStatuss.Add(GetStatusObject(row)); } return objStatuss; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); throw ex; } }
public IList<Message> SelMessagesForDefaultUser(Guid FromUserId) { try { DbParam[] param = new DbParam[1]; param[0] = new DbParam("@FromUserId", FromUserId, SqlDbType.UniqueIdentifier); dt = Db.GetDataTable("proc_tblMessage_SelMessagesForDefaultUser", param); if (dt != null) { objMessages = new List<Message>(); foreach (DataRow dr in dt.Rows) objMessages.Add(GetObject(dr)); } return objMessages; } catch (Exception ex) { // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error); return null; } }
public CommentDetails SelLatestCommentsByStatusId(Guid StatusId) { CommentDetails objCommentDetails = null; try { DbParam[] param = new DbParam[] { new DbParam("@StatusId",StatusId,SqlDbType.UniqueIdentifier) }; ds = Db.GetDataSet("proc_tblComment_SelLatestComments", param); if (ds != null) { objCommentDetails = new CommentDetails(); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { objComments = new List<Comment>(); foreach (DataRow row in ds.Tables[0].Rows) objComments.Add(GetObject(row)); objCommentDetails.CommentList = objComments; } if (ds.Tables.Count > 1 && ds.Tables[1].Rows.Count > 0) { objCommentDetails.PageCount = Db.ToInteger(ds.Tables[1].Rows[0]["TotalCount"]); } } } catch { } return objCommentDetails; }
/// <summary> /// Function : UpdateUser /// Description : Uodate User /// Inputs : objUser /// </summary> /// <param name="objUser"></param> /// <returns></returns> public int UpdateUser(User objUser) { DbParam[] param = new DbParam[] { new DbParam("@UserId", objUser.UserId, SqlDbType.UniqueIdentifier), new DbParam("@FirstName", objUser.FirstName, SqlDbType.NVarChar), new DbParam("@LastName", objUser.LastName, SqlDbType.NVarChar), new DbParam("@EmailId", objUser.EmailId, SqlDbType.NVarChar), new DbParam("@DOB", objUser.DOB, SqlDbType.DateTime), new DbParam("@Designation", objUser.Designation, SqlDbType.NVarChar), new DbParam("@WorkAt", objUser.WorkAt, SqlDbType.NVarChar), new DbParam("@CollegeAt", objUser.CollegeAt, SqlDbType.NVarChar), new DbParam("@SchoolAt", objUser.SchoolAt, SqlDbType.NVarChar), new DbParam("@Gender", objUser.Gender, SqlDbType.VarChar), new DbParam("@UserImage", objUser.UserImage, SqlDbType.NVarChar), new DbParam("@About", objUser.About, SqlDbType.NVarChar), new DbParam("@Description", objUser.Description, SqlDbType.NVarChar), new DbParam("@Address", objUser.Address, SqlDbType.NVarChar), new DbParam("@City", objUser.City, SqlDbType.NVarChar), new DbParam("@State", objUser.State, SqlDbType.NVarChar), new DbParam("@Country", objUser.Country, SqlDbType.NVarChar), new DbParam("@UserCode", objUser.UserCode, SqlDbType.VarChar) }; return Db.Update("proc_tblUser_Update", param, true); }