Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        /// <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;
        }
Exemplo n.º 4
0
        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;
            }
        }
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 /// <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;
 }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
 /// <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;
 }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
0
        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;
            }
        }
Exemplo n.º 13
0
        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;
            }
        }
Exemplo n.º 14
0
        /// <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;
        }
Exemplo n.º 15
0
 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;
     }
 }
Exemplo n.º 16
0
 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;
     }
 }
Exemplo n.º 17
0
        //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;
            }
        }
Exemplo n.º 18
0
        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;
            }
        }
Exemplo n.º 19
0
 /// <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);
 }
Exemplo n.º 20
0
        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;
            }
        }
Exemplo n.º 21
0
        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;
            }
        }
Exemplo n.º 22
0
 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;
 }
Exemplo n.º 23
0
 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;
     }
 }
Exemplo n.º 24
0
 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;
     }
 }
Exemplo n.º 25
0
        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;
        }
Exemplo n.º 26
0
        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;
            }
        }
Exemplo n.º 27
0
        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;
            }
        }
Exemplo n.º 28
0
 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;
     }
 }
Exemplo n.º 29
0
        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;
        }
Exemplo n.º 30
0
 /// <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);
 }