Example #1
0
 public static IDataReader GetQuickSnapshotReport(DateTime StartDate, DateTime EndDate, int CreatorId)
 {
     return(DbHelper2.RunSpDataReader("ReportQuickSnapshot",
                                      DbHelper2.mp("@StartDate", SqlDbType.DateTime, StartDate),
                                      DbHelper2.mp("@EndDate", SqlDbType.DateTime, EndDate),
                                      DbHelper2.mp("@CreatorId", SqlDbType.Int, CreatorId)));
 }
Example #2
0
        public static IDataReader SearchHistory(
            DateTime fromDate,
            DateTime toDate,
            int userID,
            int contUserID,
            int msgType,
            string keyword,
            bool displayLastEventsFirst,
            int DefaultBias)
        {
            //if userId=contUserId=0 -> all with all
            int origUserId     = 0;
            int origContUserId = 0;

            if (userID != 0)
            {
                origUserId = DbHelper2.RunSpInteger("UserGetOriginalId",
                                                    DbHelper2.mp("@UserId", SqlDbType.Int, userID));
            }
            if (contUserID != 0)
            {
                origContUserId = DbHelper2.RunSpInteger("UserGetOriginalId",
                                                        DbHelper2.mp("@UserId", SqlDbType.Int, contUserID));
            }

            return(DbHelper2.RunSpDataReader("ASP_SEARCH_HISTORY",
                                             DbHelper2.mp("@User_id", SqlDbType.Int, origUserId),
                                             DbHelper2.mp("@Cont_user_id", SqlDbType.Int, origContUserId),
                                             DbHelper2.mp("@DT_Begin", SqlDbType.DateTime, fromDate),
                                             DbHelper2.mp("@DT_End", SqlDbType.DateTime, toDate),
                                             DbHelper2.mp("@Mess_Type", SqlDbType.Int, msgType),
                                             DbHelper2.mp("@Keyword", SqlDbType.NVarChar, 50, keyword),
                                             DbHelper2.mp("@Order", SqlDbType.Int, displayLastEventsFirst ? 1 : 0),
                                             DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
        }
Example #3
0
 /// <summary>
 /// Reader returns fields:
 ///		PartnerId, GroupId, GroupName, Level (=1)
 /// </summary>
 public static IDataReader GetListGroupsByPartner(int PartnerId, bool IncludeCurrent, bool IncludeEveryone)
 {
     return(DbHelper2.RunSpDataReader("PartnerGroupGetListByPartner",
                                      DbHelper2.mp("@PartnerId", SqlDbType.Int, PartnerId),
                                      DbHelper2.mp("@IncludeCurrent", SqlDbType.Bit, IncludeCurrent),
                                      DbHelper2.mp("@IncludeEveryone", SqlDbType.Bit, IncludeEveryone)));
 }
Example #4
0
 public static IDataReader GetTop10Users(DateTime StartDate, DateTime EndDate, int DefaultBias)
 {
     return(DbHelper2.RunSpDataReader("ASP_REP_GET_TOP10_WRITERS",
                                      DbHelper2.mp("@startdate", SqlDbType.DateTime, StartDate),
                                      DbHelper2.mp("@enddate", SqlDbType.DateTime, EndDate),
                                      DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
 }
Example #5
0
 public static IDataReader Message_GetByUserIdAndTimeFilter(int userId, DateTime startDate, DateTime endDate, int timeZoneId)
 {
     return(DbHelper2.RunSpDataReader(timeZoneId, new string[] { "Sent" }, "Message_GetByUserIdAndTimeFilter",
                                      DbHelper2.mp("@UserId", SqlDbType.Int, userId),
                                      DbHelper2.mp("@StartDate", SqlDbType.DateTime, startDate),
                                      DbHelper2.mp("@EndDate", SqlDbType.DateTime, endDate)));
 }
Example #6
0
 public static int GetAuthenticatedUsers(DateTime StartDate, DateTime EndDate, int DefaultBias)
 {
     return(DbHelper2.RunSpInteger("ASP_REP_GET_AUTH_USERS",
                                   DbHelper2.mp("@startdate", SqlDbType.DateTime, StartDate),
                                   DbHelper2.mp("@enddate", SqlDbType.DateTime, EndDate),
                                   DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
 }
Example #7
0
 /// <summary>
 /// Gets the clients.
 /// </summary>
 /// <param name="fromDate">From date.</param>
 /// <param name="toDate">To date.</param>
 /// <param name="managers">The managers.</param>
 /// <returns>ClientId, ClientName</returns>
 public static IDataReader GetClients(DateTime fromDate, DateTime toDate, string managers)
 {
     return(DbHelper2.RunSpDataReader("custom_ClioSoft_ClientsGet",
                                      DbHelper2.mp("@FromDate", SqlDbType.DateTime, fromDate),
                                      DbHelper2.mp("@ToDate", SqlDbType.DateTime, toDate),
                                      DbHelper2.mp("@Managers", SqlDbType.VarChar, 8000, managers)));
 }
Example #8
0
 /// <summary>
 /// Gets the sec group stats.
 /// </summary>
 /// <param name="GroupID">The group ID.</param>
 /// <param name="fromDate">From date.</param>
 /// <param name="toDate">To date.</param>
 /// <param name="ShowAll">if set to <c>true</c> [show all].</param>
 /// <returns>ActiveAccounts, InactiveAccounts, NewProjectsCount, NewEventsCount, NewIncidentsCount, NewToDosCount, NewTasksCount, PortalLogins, ReOpenIncidentsCount</returns>
 public static IDataReader GetSecGroupStats(int GroupID, DateTime fromDate, DateTime toDate, bool ShowAll)
 {
     return(DbHelper2.RunSpDataReader("ReportGroupStatistics",
                                      DbHelper2.mp("@StartDate", SqlDbType.DateTime, fromDate),
                                      DbHelper2.mp("@EndDate", SqlDbType.DateTime, toDate),
                                      DbHelper2.mp("@GroupId", SqlDbType.Int, GroupID),
                                      DbHelper2.mp("@ShowAll", SqlDbType.Bit, ShowAll)));
 }
Example #9
0
 public static IDataReader GetListIMSessionsByUserAndDate(int UserId, DateTime StartDate, DateTime EndDate, int Bias)
 {
     return(DbHelper2.RunSpDataReader("ASP_REP_GET_USER_IM_SESSIONS",
                                      DbHelper2.mp("@user_id", SqlDbType.Int, UserId),
                                      DbHelper2.mp("@fromdate", SqlDbType.DateTime, StartDate),
                                      DbHelper2.mp("@todate", SqlDbType.DateTime, EndDate),
                                      DbHelper2.mp("@TimeOffset", SqlDbType.Int, Bias * 60)));
 }
Example #10
0
 public static int GetFilesTransferred(DateTime StartDate, DateTime EndDate, int DefaultBias)
 {
     return(DbHelper2.RunSpInteger("ASP_REP_GET_FILES_TRANSFERRED",
                                   DbHelper2.mp("@startdate", SqlDbType.DateTime, StartDate),
                                   DbHelper2.mp("@enddate", SqlDbType.DateTime, EndDate),
                                   DbHelper2.mp("@total", SqlDbType.Int, 0),
                                   DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
 }
Example #11
0
 public static int GetCountChatMessages(DateTime StartDate, DateTime EndDate, int DefaultBias)
 {
     return(DbHelper2.RunSpInteger("ASP_REP_GET_CHAT_MESSAGES",
                                   DbHelper2.mp("@startdate", SqlDbType.DateTime, StartDate),
                                   DbHelper2.mp("@enddate", SqlDbType.DateTime, EndDate),
                                   DbHelper2.mp("@total", SqlDbType.Int, 0),
                                   DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
 }
Example #12
0
 /// <summary>
 /// Gets the tasks.
 /// </summary>
 /// <param name="projectId">The project id.</param>
 /// <param name="completion">The completion.</param>
 /// <param name="completionFromDate">The completion from date.</param>
 /// <param name="completionToDate">The completion to date.</param>
 /// <returns></returns>
 public static IDataReader GetTasks(int projectId, int completion, DateTime completionFromDate, DateTime completionToDate)
 {
     return(DbHelper2.RunSpDataReader("custom_ClioSoft_TasksGet",
                                      DbHelper2.mp("@ProjectId", SqlDbType.Int, projectId),
                                      DbHelper2.mp("@Completion", SqlDbType.Int, completion),
                                      DbHelper2.mp("@CompletionFromDate", SqlDbType.DateTime, completionFromDate),
                                      DbHelper2.mp("@CompletionToDate", SqlDbType.DateTime, completionToDate)));
 }
Example #13
0
 /// <summary>
 /// Gets the project groups by user.
 /// </summary>
 /// <param name="fromDate">From date.</param>
 /// <param name="toDate">To date.</param>
 /// <param name="users">The users.</param>
 /// <param name="clients">The clients.</param>
 /// <returns>ProjectGroupId, ProjectGroupName</returns>
 public static IDataReader GetProjectGroupsByUser(DateTime fromDate, DateTime toDate, string users, string clients)
 {
     return(DbHelper2.RunSpDataReader("custom_ClioSoft_ProjectGroupsGetByUser",
                                      DbHelper2.mp("@FromDate", SqlDbType.DateTime, fromDate),
                                      DbHelper2.mp("@ToDate", SqlDbType.DateTime, toDate),
                                      DbHelper2.mp("@Users", SqlDbType.VarChar, 8000, users),
                                      DbHelper2.mp("@Clients", SqlDbType.VarChar, 8000, clients)));
 }
Example #14
0
 /// <summary>
 /// Gets the user report info.
 /// </summary>
 /// <param name="fromDate">From date.</param>
 /// <param name="toDate">To date.</param>
 /// <param name="ownerId">The owner id.</param>
 /// <param name="projectId">The project id.</param>
 /// <param name="completion">The completion.</param>
 /// <param name="completionFromDate">The completion from date.</param>
 /// <param name="completionToDate">The completion to date.</param>
 /// <returns></returns>
 public static IDataReader GetUserReportInfo(DateTime fromDate, DateTime toDate, int ownerId, int projectId, int completion, DateTime completionFromDate, DateTime completionToDate)
 {
     return(DbHelper2.RunSpDataReader("custom_ClioSoft_UserReportGetInfo",
                                      DbHelper2.mp("@FromDate", SqlDbType.DateTime, fromDate),
                                      DbHelper2.mp("@ToDate", SqlDbType.DateTime, toDate),
                                      DbHelper2.mp("@ProjectId", SqlDbType.Int, projectId),
                                      DbHelper2.mp("@UserId", SqlDbType.Int, ownerId),
                                      DbHelper2.mp("@Completion", SqlDbType.Int, completion),
                                      DbHelper2.mp("@CompletionFromDate", SqlDbType.DateTime, completionFromDate),
                                      DbHelper2.mp("@CompletionToDate", SqlDbType.DateTime, completionToDate)));
 }
Example #15
0
 /// <summary>
 /// Gets the projects.
 /// </summary>
 /// <param name="fromDate">From date.</param>
 /// <param name="toDate">To date.</param>
 /// <param name="managers">The managers.</param>
 /// <param name="clients">The clients.</param>
 /// <param name="projectGroups">The project groups.</param>
 /// <param name="completion">The completion.</param>
 /// <param name="completionFromDate">The completion from date.</param>
 /// <param name="completionToDate">The completion to date.</param>
 /// <returns></returns>
 public static IDataReader GetProjects(DateTime fromDate, DateTime toDate, string managers, string clients, string projectGroups, int completion, DateTime completionFromDate, DateTime completionToDate)
 {
     return(DbHelper2.RunSpDataReader("custom_ClioSoft_ProjectsGet",
                                      DbHelper2.mp("@FromDate", SqlDbType.DateTime, fromDate),
                                      DbHelper2.mp("@ToDate", SqlDbType.DateTime, toDate),
                                      DbHelper2.mp("@Managers", SqlDbType.VarChar, 8000, managers),
                                      DbHelper2.mp("@Clients", SqlDbType.VarChar, 8000, clients),
                                      DbHelper2.mp("@ProjectGroups", SqlDbType.VarChar, 8000, projectGroups),
                                      DbHelper2.mp("@Completion", SqlDbType.Int, completion),
                                      DbHelper2.mp("@CompletionFromDate", SqlDbType.DateTime, completionFromDate),
                                      DbHelper2.mp("@CompletionToDate", SqlDbType.DateTime, completionToDate)));
 }
Example #16
0
        public static IDataReader GetChats(int iUserId)
        {
            int origUserId = 0;

            if (iUserId != 0)
            {
                origUserId = DbHelper2.RunSpInteger("UserGetOriginalId",
                                                    DbHelper2.mp("@UserId", SqlDbType.Int, iUserId));
                if (origUserId == -1)
                {
                    origUserId = 0;
                }
            }

            return(DbHelper2.RunSpDataReader("ASP_GET_CHATS",
                                             DbHelper2.mp("@USER_ID", SqlDbType.Int, origUserId)));
        }
Example #17
0
        public static int GetCountIMMessages(DateTime StartDate, DateTime EndDate, bool getInternal, int DefaultBias)
        {
            int ret = 0;

            using (IDataReader reader = DbHelper2.RunSpDataReader("ASP_REP_GET_IM_MESSAGES",
                                                                  DbHelper2.mp("@startdate", SqlDbType.DateTime, StartDate),
                                                                  DbHelper2.mp("@enddate", SqlDbType.DateTime, EndDate),
                                                                  DbHelper2.mp("@use_dates", SqlDbType.Bit, 1),
                                                                  DbHelper2.mp("@internal", SqlDbType.Bit, getInternal ? 1 : 0),
                                                                  DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)))
            {
                if (reader.Read())
                {
                    ret = (int)reader["MessagesSent"];
                }
            }
            return(ret);
        }
Example #18
0
        /// <summary>
        /// LoginsClient, MsgSent, MsgReceived, ConfCreated,
        /// ConfMsgSent, FilesSent, FSBytes, FilesReceived, FRBytes,
        /// FilesPublished, FPBytes, CalEntries, Projects, CreateDate.
        /// </summary>
        public static IDataReader GetUserStats(int UserID, DateTime fromDate, DateTime toDate, int DefaultBias)
        {
            int origUserId = 0;

            if (UserID != 0)
            {
                origUserId = DbHelper2.RunSpInteger("UserGetOriginalId",
                                                    DbHelper2.mp("@UserId", SqlDbType.Int, UserID));
                if (origUserId == -1)
                {
                    origUserId = 0;
                }
            }
            return(DbHelper2.RunSpDataReader("ASP_REP_GET_USER_STATS",
                                             DbHelper2.mp("@user_id", SqlDbType.Int, origUserId),
                                             DbHelper2.mp("@fromdate", SqlDbType.DateTime, fromDate),
                                             DbHelper2.mp("@todate", SqlDbType.DateTime, toDate),
                                             DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
        }
Example #19
0
        public static IDataReader SearchChat(int iUserId, int iChatId, DateTime dtFrom, DateTime dtTo,
                                             string sKeyWord, int iOrder, int DefaultBias)
        {
            int origUserId = 0;

            if (iUserId != 0)
            {
                origUserId = DbHelper2.RunSpInteger("UserGetOriginalId",
                                                    DbHelper2.mp("@UserId", SqlDbType.Int, iUserId));
                if (origUserId == -1)
                {
                    origUserId = 0;
                }
            }
            return(DbHelper2.RunSpDataReader("ASP_SEARCH_CHAT",
                                             DbHelper2.mp("@User_id", SqlDbType.Int, origUserId),
                                             DbHelper2.mp("@Chat_id", SqlDbType.Int, iChatId),
                                             DbHelper2.mp("@DT_Begin", SqlDbType.DateTime, dtFrom),
                                             DbHelper2.mp("@DT_End", SqlDbType.DateTime, dtTo),
                                             DbHelper2.mp("@Keyword", SqlDbType.NVarChar, 50, sKeyWord),
                                             DbHelper2.mp("@Order", SqlDbType.Int, iOrder),
                                             DbHelper2.mp("@TimeOffset", SqlDbType.Int, DefaultBias * 60)));
        }
Example #20
0
 /// <summary>
 /// DisplayName, Count
 /// </summary>
 /// <returns></returns>
 public static IDataReader GetMostActiveGroupsByIncidentReport(DateTime FromDate, DateTime ToDate)
 {
     return(DbHelper2.RunSpDataReader("ReportMostActiveGroupsByIncident",
                                      DbHelper2.mp("@FromDate", SqlDbType.DateTime, FromDate),
                                      DbHelper2.mp("@ToDate", SqlDbType.DateTime, ToDate)));
 }
Example #21
0
 public static bool GetMenuInAlerts(int UserId)
 {
     return((bool)DbHelper2.RunSpScalar("UserPreferenceMenuInAlertsGet",
                                        DbHelper2.mp("@UserId", SqlDbType.Int, UserId)));
 }
Example #22
0
 /// <summary>
 /// Reader returns fields:
 ///		UserId, Login, FirstName, LastName, Email, Activity, IMGroupId
 /// </summary>
 public static IDataReader GetUserInfoByOriginalId(int OriginalId)
 {
     return(DbHelper2.RunSpDataReader("UserGetByOriginalId",
                                      DbHelper2.mp("@OriginalId", SqlDbType.Int, OriginalId)));
 }
Example #23
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName
 /// </summary>
 public static IDataReader GetListAvailableGroupsForPartner(int UserId)
 {
     return(DbHelper2.RunSpDataReader("GroupsGetAvailableForPartner",
                                      DbHelper2.mp("@PrincipalId", SqlDbType.Int, UserId)));
 }
Example #24
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName
 /// </summary>
 public static IDataReader GetListAvailableGroups()
 {
     return(DbHelper2.RunSpDataReader("GroupsGetAvailable"));
 }
Example #25
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName
 /// </summary>
 public static IDataReader GetListGroups()
 {
     return(DbHelper2.RunSpDataReader("GroupGet",
                                      DbHelper2.mp("@PrincipalId", SqlDbType.Int, 0)));
 }
Example #26
0
 public static IDataReader GetUsersByCompany()
 {
     return(DbHelper2.RunSpDataReader("ASP_GET_USERS_BY_COMPANY"));
 }
Example #27
0
 public static int GetGroupForPartnerUser(int UserId)
 {
     return(DbHelper2.RunSpInteger("GroupGetForPartnerUser",
                                   DbHelper2.mp("@PrincipalId", SqlDbType.Int, UserId)));
 }
Example #28
0
 /// <summary>
 /// Reader returns fields:
 ///		GroupId, GroupName, Level
 /// </summary>
 public static IDataReader GetListGroupsAsTree()
 {
     return(DbHelper2.RunSpDataReader("GroupsGetAsTree2"));
 }
Example #29
0
 /// <summary>
 /// Reader returns fields:
 ///		UserId, Login, FirstName, LastName, Email, IsActive, IMGroupId, CreatedBy, Comments, IsExternal, IsPending, OriginalId
 /// </summary>
 public static IDataReader GetUserInfo(int UserId)
 {
     return(DbHelper2.RunSpDataReader("UserGet",
                                      DbHelper2.mp("@PrincipalId", SqlDbType.Int, UserId)));
 }
Example #30
0
 /// <summary>
 /// Reader returns fields:
 ///		UserId, Login, FirstName, LastName, Email, IMGroupId, CreatedBy, Activity, IsExternal
 /// </summary>
 public static IDataReader GetListAllUsersInGroup(int GroupId)
 {
     return(DbHelper2.RunSpDataReader("UsersGetByGroupAll",
                                      DbHelper2.mp("@GroupId", SqlDbType.Int, GroupId)));
 }