예제 #1
0
        public static void GetDashboardsCount(Guid applicationId, ref List <DashboardCount> counts, Guid userId,
                                              Guid?nodeTypeId, Guid?nodeId, string nodeAdditionalId, DashboardType type)
        {
            string spName = GetFullyQualifiedName("GetDashboardsCount");

            try
            {
                if (nodeId == Guid.Empty)
                {
                    nodeId = null;
                }
                if (nodeTypeId == Guid.Empty)
                {
                    nodeTypeId = null;
                }

                string strType = type == DashboardType.NotSet ? null : type.ToString();

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 userId, nodeTypeId, nodeId, nodeAdditionalId, strType);
                ProviderUtil.parse_dashboards_count(ref reader, ref counts);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
            }
        }
예제 #2
0
        public static void GetMessages(Guid applicationId, ref List <Message> retMessages, Guid userId, Guid?threadId,
                                       bool?sent, long?minId, int?count)
        {
            string spName = GetFullyQualifiedName("GetMessages");

            try
            {
                if (threadId == Guid.Empty)
                {
                    threadId = null;
                }
                if (minId <= 0)
                {
                    minId = null;
                }

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 userId, threadId, sent, count, minId);
                _parse_messages(ref reader, ref retMessages);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.MSG);
            }
        }
예제 #3
0
        public static void GetUserNotifications(Guid applicationId, ref List <Notification> retNotifications,
                                                Guid userId, bool?seen, long?lastNotSeenId, long?lastSeenId,
                                                DateTime?lastViewDate, DateTime?lowerDateLimit, DateTime?upperDateLimit, int?count)
        {
            string spName = GetFullyQualifiedName("GetUserNotifications");

            try
            {
                if (lastSeenId == 0)
                {
                    lastSeenId = null;
                }
                if (lastNotSeenId == 0)
                {
                    lastNotSeenId = null;
                }

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 userId, seen, lastNotSeenId, lastSeenId, lastViewDate, lowerDateLimit, upperDateLimit, count);
                _parse_notifications(ref reader, ref retNotifications);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
            }
        }
예제 #4
0
        public static bool RemoveMessages(Guid applicationId, Guid?userId, Guid?threadId, long?id)
        {
            string spName = GetFullyQualifiedName("RemoveMessages");

            try
            {
                if (userId == Guid.Empty)
                {
                    userId = null;
                }
                if (threadId == Guid.Empty)
                {
                    threadId = null;
                }
                if (id <= 0)
                {
                    id = null;
                }

                if (!id.HasValue && (!userId.HasValue || !threadId.HasValue))
                {
                    return(false);
                }

                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId, userId, threadId, id)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.MSG);
                return(false);
            }
        }
예제 #5
0
        public static bool ArithmeticDeleteNotifications(Guid applicationId, Notification info, List <string> actions)
        {
            string spName = GetFullyQualifiedName("ArithmeticDeleteNotifications");

            try
            {
                if (!string.IsNullOrEmpty(info.Action.ToString()))
                {
                    actions.Add(info.Action.ToString());
                }
                actions = actions.Distinct().ToList();

                if (info.SubjectID.HasValue)
                {
                    info.SubjectIDs.Add(info.SubjectID.Value);
                }
                if (info.RefItemID.HasValue)
                {
                    info.RefItemIDs.Add(info.RefItemID.Value);
                }

                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId,
                                                                        ProviderUtil.list_to_string <Guid>(info.SubjectIDs), ProviderUtil.list_to_string <Guid>(info.RefItemIDs),
                                                                        info.Sender.UserID, ProviderUtil.list_to_string <string>(ref actions), ',')));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
                return(false);
            }
        }
예제 #6
0
        public static void GetMessageReceivers(Guid applicationId,
                                               ref List <Message> refMsg, List <Guid> MessagesIds, int?count, int?lastId)
        {
            string spName = GetFullyQualifiedName("GetMessageReceivers");

            try
            {
                if (lastId <= 0)
                {
                    lastId = null;
                }
                if (count <= 0)
                {
                    count = null;
                }

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 ProviderUtil.list_to_string <Guid>(ref MessagesIds), ',', count, lastId);
                _parse_message_receivers(ref reader, ref refMsg);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.MSG);
            }
        }
예제 #7
0
        public static void GetOwnerFiles(Guid applicationId,
                                         ref List <DocFileInfo> retFiles, ref List <Guid> ownerIds, FileOwnerTypes ownerType)
        {
            string spName = GetFullyQualifiedName("GetOwnerFiles");

            try
            {
                if (ownerIds.Count == 0)
                {
                    return;
                }
                string strOwnerType = null;
                if (ownerType != FileOwnerTypes.None)
                {
                    strOwnerType = ownerType.ToString();
                }

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 ProviderUtil.list_to_string <Guid>(ref ownerIds), ',', strOwnerType);
                _parse_files(applicationId, ref reader, ref retFiles);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.DCT);
            }
        }
예제 #8
0
        public static void SearchUsers(Guid applicationId, ref List <User> retUsers, string searchText,
                                       ref List <Guid> departmentIds, ref List <Guid> expertiseKDIds, ref List <Guid> projectIds,
                                       ref List <Guid> processIds, ref List <Guid> communityIds, ref List <Guid> knowledgeKds,
                                       int?count, Guid?minId)
        {
            string spName = GetFullyQualifiedName("SearchUsers");

            try
            {
                List <Guid> _userIds = new List <Guid>();

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, count, minId,
                                                                 ProviderUtil.get_search_text(searchText), ProviderUtil.list_to_string <Guid>(ref departmentIds),
                                                                 ProviderUtil.list_to_string <Guid>(ref expertiseKDIds), ProviderUtil.list_to_string <Guid>(ref projectIds),
                                                                 ProviderUtil.list_to_string <Guid>(ref processIds), ProviderUtil.list_to_string <Guid>(ref communityIds),
                                                                 ProviderUtil.list_to_string <Guid>(ref knowledgeKds), ',');

                ProviderUtil.parse_guids(ref reader, ref _userIds);
                retUsers = UsersController.get_users(applicationId, _userIds);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SRCH);
            }
        }
예제 #9
0
        public static bool SetMessageTemplate(Guid applicationId, MessageTemplate info)
        {
            string spName = GetFullyQualifiedName("SetMessageTemplate");

            try
            {
                if (info.AudienceType == AudienceType.NotSet)
                {
                    return(false);
                }
                if (info.AudienceRefOwnerID == Guid.Empty)
                {
                    info.AudienceRefOwnerID = null;
                }
                if (info.AudienceNodeID == Guid.Empty)
                {
                    info.AudienceNodeID = null;
                }
                if (!info.CreationDate.HasValue)
                {
                    info.CreationDate = DateTime.Now;
                }

                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId,
                                                                        info.TemplateID, info.OwnerID, info.BodyText, info.AudienceType.ToString(), info.AudienceRefOwnerID,
                                                                        info.AudienceNodeID, info.AudienceNodeAdmin, info.CreatorUserID, info.CreationDate)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
                return(false);
            }
        }
예제 #10
0
        public static void GetChildNodes(Guid applicationId, ref List <TreeNode> retTreeNodes,
                                         Guid?parentNodeId, Guid?treeId, string searchText)
        {
            string spName = GetFullyQualifiedName("GetChildNodes");

            try
            {
                if (parentNodeId == Guid.Empty)
                {
                    parentNodeId = null;
                }
                if (treeId == Guid.Empty)
                {
                    treeId = null;
                }

                if (!parentNodeId.HasValue && !treeId.HasValue)
                {
                    return;
                }

                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId,
                                                                 parentNodeId, treeId, ProviderUtil.get_search_text(searchText));
                _parse_tree_nodes(ref reader, ref retTreeNodes);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.DCT);
            }
        }
        protected static bool save_phrase_local(string phrase, string dictionary, string version, string data)
        {
            string spName = "[dbo]." + "[EP_AddPhrase]";

            try
            {
                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName,
                                                                        phrase, dictionary, version, data)));
            }
            catch (Exception ex) { return(false); }
        }
예제 #12
0
        public static bool ArithmeticDeleteComment(Guid applicationId, Guid?CommentID)
        {
            string spName = GetFullyQualifiedName("ArithmeticDeleteComment");

            try { return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId, CommentID))); }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SH);
                return(false);
            }
        }
        protected static void gkm_questionaire_abstract(Guid applicationId, ref Dictionary <string, object> response)
        {
            string spName = "[dbo]." + "[EXT_RPT_GKMQuestionaireAbstract]";

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId);
                response = _parse_iso_questionaire_abstract(ref reader);
            }
            catch (Exception ex) { }
        }
예제 #14
0
        public static DateTime?LastModificationDate(Guid applicationId, Guid ownerId)
        {
            string spName = GetFullyQualifiedName("LastModificationDate");

            try { return(ProviderUtil.succeed_datetime(ProviderUtil.execute_reader(spName, applicationId, ownerId))); }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.WK);
                return(null);
            }
        }
        protected static Dictionary <string, object> get_phrase_local(string phrase)
        {
            string spName = "[dbo]." + "[EP_GetPhrase]";

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, phrase);
                return(_parse_phrases(ref reader));
            }
            catch (Exception ex) { return(new Dictionary <string, object>()); }
        }
예제 #16
0
        public static string GetWikiContent(Guid applicationId, Guid ownerId)
        {
            string spName = GetFullyQualifiedName("GetWikiContent");

            try { return(ProviderUtil.succeed_string(ProviderUtil.execute_reader(spName, applicationId, ownerId))); }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.WK);
                return(null);
            }
        }
        protected static void iso_questionaire_email_records(Guid applicationId, string email,
                                                             ref Dictionary <string, object> response)
        {
            string spName = "[dbo]." + "[EXT_RPT_ISOQuestionaireEmailRecords]";

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, email);
                response = _parse_iso_questionaire_abstract(ref reader);
            }
            catch (Exception ex) { }
        }
예제 #18
0
 public static void GetLogs(Guid?applicationId, ref List <Log> retLogs, List <Guid> userIds, List <Action> actions,
                            DateTime?beginDate, DateTime?finishDate, long?lastId, int?count)
 {
     try
     {
         IDataReader reader = ProviderUtil.execute_reader(GetFullyQualifiedName("GetLogs"), applicationId,
                                                          ProviderUtil.list_to_string <Guid>(ref userIds), ProviderUtil.list_to_string <Action>(ref actions),
                                                          ',', beginDate, finishDate, lastId, count);
         _parse_logs(ref reader, ref retLogs);
     }
     catch (Exception ex) { string strEx = ex.ToString(); }
 }
예제 #19
0
        public static Guid?GetCommentSenderID(Guid applicationId, Guid commentId)
        {
            string spName = GetFullyQualifiedName("GetCommentSenderID");

            try
            {
                return(ProviderUtil.succeed_guid(ProviderUtil.execute_reader(spName, applicationId, commentId)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SH);
                return(Guid.Empty);
            }
        }
        protected static void raaivan_questionaire_email_records(Guid applicationId, string email, bool?demoRequest,
                                                                 bool?demoDone, bool?proformaRequest, bool?proformaDone, bool?reportRequest, bool?reportDone,
                                                                 bool?hasRequest, ref Dictionary <string, object> response)
        {
            string spName = "[dbo]." + "[EXT_RPT_RaaiVanQuestionaireEmailRecords]";

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, email,
                                                                 demoRequest, proformaRequest, reportRequest, hasRequest, demoDone, proformaDone, reportDone);
                response = _parse_raaivan_questionaire_abstract(ref reader);
            }
            catch (Exception ex) { }
        }
예제 #21
0
        public static long GetCommentLikesDislikesCount(Guid applicationId, Guid?CommentID, bool Like)
        {
            string spName = GetFullyQualifiedName("GetCommentLikesDislikesCount");

            try
            {
                return(ProviderUtil.succeed_long(ProviderUtil.execute_reader(spName, applicationId, CommentID, Like)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SH);
                return(-1);
            }
        }
예제 #22
0
        public static long GetUserPostsCount(Guid applicationId, Guid?UserID, int PostTypeID)
        {
            string spName = GetFullyQualifiedName("GetUserPostsCount");

            try
            {
                return(ProviderUtil.succeed_long(ProviderUtil.execute_reader(spName, applicationId, UserID, PostTypeID)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SH);
                return(-1);
            }
        }
예제 #23
0
        public static void GetCommentSenderIDs(Guid applicationId, ref List <Guid> retIds, Guid postId)
        {
            string spName = GetFullyQualifiedName("GetCommentSenderIDs");

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, postId);
                ProviderUtil.parse_guids(ref reader, ref retIds);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.SH);
            }
        }
예제 #24
0
        public static bool ArithmeticDeleteNotification(Guid applicationId, long notificationId, Guid userId)
        {
            string spName = GetFullyQualifiedName("ArithmeticDeleteNotification");

            try
            {
                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId, notificationId, userId)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
                return(false);
            }
        }
예제 #25
0
        public static void GetWikiOwner(Guid applicationId, ref Guid ownerId, ref WikiOwnerType ownerType, Guid id)
        {
            string spName = GetFullyQualifiedName("GetWikiOwner");

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, id);
                _parse_wiki_owner(ref reader, ref ownerId, ref ownerType);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.WK);
            }
        }
예제 #26
0
        public static void GetConfidentialityLevels(Guid applicationId, ref List <ConfidentialityLevel> retLevels)
        {
            string spName = GetFullyQualifiedName("GetConfidentialityLevels");

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId);
                _parse_confidentiality_levels(ref reader, ref retLevels);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.PRVC);
            }
        }
예제 #27
0
        public static bool SetUserNotificationsAsSeen(Guid applicationId, Guid userId)
        {
            string spName = GetFullyQualifiedName("SetUserNotificationsAsSeen");

            try
            {
                return(ProviderUtil.succeed(ProviderUtil.execute_reader(spName, applicationId, userId, DateTime.Now)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
                return(false);
            }
        }
예제 #28
0
        public static int GetNotSeenMessagesCount(Guid applicationId, Guid userId)
        {
            string spName = GetFullyQualifiedName("GetNotSeenMessagesCount");

            try
            {
                return(ProviderUtil.succeed_int(ProviderUtil.execute_reader(spName, applicationId, userId)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.MSG);
                return(0);
            }
        }
예제 #29
0
        public static void GetDashboardParagraphs(Guid applicationId, ref List <Paragraph> retSubjects, Guid userId)
        {
            string spName = GetFullyQualifiedName("GetDashboardParagraphs");

            try
            {
                IDataReader reader = ProviderUtil.execute_reader(spName, applicationId, userId);
                _parse_paragraphs(ref reader, ref retSubjects);
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.WK);
            }
        }
예제 #30
0
        public static int GetUserNotificationsCount(Guid applicationId, Guid userId, bool?seen)
        {
            string spName = GetFullyQualifiedName("GetUserNotificationsCount");

            try
            {
                return((int)ProviderUtil.succeed_long(ProviderUtil.execute_reader(spName, applicationId, userId, seen)));
            }
            catch (Exception ex)
            {
                LogController.save_error_log(applicationId, null, spName, ex, ModuleIdentifier.NTFN);
                return(0);
            }
        }