public static DataTable GetNewMessageGroup(string idChat, string idGrp)
        {
            DataTable dt = MessageGroupDAO.SelectNewMessageGroupDA(idChat, idGrp);

            //dt= Functions.AddIMageSesionSt.FnDtAddIMageSesionSt(dt, idUser);
            return(dt);
        }
Exemplo n.º 2
0
        public static Configuration GetAllConfigurations()
        {
            // make a new configuration
            Configuration configuration
                = new Configuration();

            // get all configurations
            configuration.applications           = ApplicationDAO.Get();
            configuration.applicationSettings    = ApplicationSettingDAO.Get();
            configuration.columnSets             = ColumnSetDAO.Get();
            configuration.communications         = CommunicationDAO.Get();
            configuration.communicationTypes     = CommunicationTypeDAO.Get();
            configuration.credentials            = CredentialDAO.Get();
            configuration.credentialTypes        = CredentialTypeDAO.Get();
            configuration.databaseTableRelations = DatabaseTableRelationDAO.Get();
            configuration.databaseInstances      = DatabaseInstanceDAO.Get();
            configuration.databaseTables         = DatabaseTableDAO.Get();
            configuration.directionTypes         = DirectionTypeDAO.Get();
            configuration.interfaceThreads       = InterfaceDAO.Get();
            configuration.messageGroups          = MessageGroupDAO.Get();
            configuration.messageGroupInstances  = MessageGroupInstanceDAO.Get();
            configuration.messageParts           = MessagePartDAO.Get();
            configuration.messageTypes           = MessageTypeDAO.Get();
            configuration.segmentTypes           = SegmentTypeDAO.Get();
            configuration.webserviceInstances    = WebserviceInstanceDAO.Get();
            configuration.webserviceObjects      = WebserviceObjectDAO.Get();
            configuration.webservicePropertySets = WebservicePropertySetDAO.Get();

            return(configuration);
        }
        public static DataTable EnterMessageGroup(string idSender, string message, string idGrp, bool flagReplayed, int idReplayed, int flagTypeFile = 1, string format = "")

        {
            string   persianDateChat = DatePersian.GetDateNow();
            DateTime dateChat        = DateTime.Now;
            string   TimeChat        = DatePersian.GetTimeNow12();

            return(MessageGroupDAO.InsertMessageGroupDAO(idSender, message,
                                                         dateChat, persianDateChat, TimeChat, idGrp,
                                                         (flagReplayed == false ? 0 : 1), idReplayed, flagTypeFile, format));
        }
Exemplo n.º 4
0
        public static void Begin(MessageGroup messageGroup)
        {
            int beforeCount = 0;
            int afterCount  = 0;

            // MessageGroup API
            List <MessageGroup> messageGroups;

            // Get existing
            beforeCount = MessageGroupDAO.Get().Count;

            // Insert and Updating: if ID is included, it will update
            messageGroup = MessageGroupDAO.PostUpdate(messageGroup);

            // Reading: Use GetMessageGroups() to retrieve a list of obj
            messageGroups = MessageGroupDAO.Get();

            // get master item count
            afterCount = messageGroups.Count;

            // write
            MessageGroupTest.Write(messageGroups, "INSERT", beforeCount, afterCount, true);
            Console.Read();

            // make a soft update to some property (Optional)
            // messageGroup.<property> = 1;

            // re-assign the before count
            beforeCount = afterCount;

            // Insert and Updating: if ID is included, it will update
            messageGroup = MessageGroupDAO.PostUpdate(messageGroup);

            // Reading: Use GetMessageGroups() to retrieve a list of obj
            messageGroups = MessageGroupDAO.Get();

            // Get existing
            afterCount = MessageGroupDAO.Get().Count;

            // write
            MessageGroupTest.Write(messageGroups, "UPDATE", beforeCount, afterCount);
            Console.Read();

            // Reading: Use GetMessageGroups() to retrieve a list of obj w/ 1 item
            messageGroups = MessageGroupDAO.Get(messageGroup);

            // get count
            afterCount = messageGroups.Count;

            // reassign count
            beforeCount = afterCount;

            // write
            MessageGroupTest.Write(messageGroups, "Single", afterCount, 1);
            Console.Read();

            // Deleting - Send in the obj w/ at minimal the ID populated
            MessageGroupDAO.Delete(messageGroup);

            // Reading: Use GetMessageGroups() to retrieve a list of obj
            messageGroups = MessageGroupDAO.Get();

            // get count
            afterCount = messageGroups.Count;

            // write
            MessageGroupTest.Write(messageGroups, "Removed", beforeCount, afterCount, true);
            Console.Read();
        }
Exemplo n.º 5
0
        public static void makeNewMessageGroups()
        {
            List <String> lines = new List <string>();

            lines = File.ReadAllLines(@"C:\Users\chrisb\Source\Repos\HL7Broker\HL7BrokerConsoleTest\NewMessageGroupForWebService.txt").ToList();

            lines.ForEach(delegate(String line) {
                // skip comments
                if (line.Contains("##"))
                {
                    return;
                }

                string[] elementSplit = line.Split('|');

                // gives the first part
                string[] tempMessageGroupInstance = elementSplit[0].Split(',');

                Console.WriteLine("Inserting Message Group Instance");
                MessageGroupInstance messageGroupInstance
                    = MessageGroupInstanceDAO.PostUpdate(new MessageGroupInstance()
                {
                    messageTypeId = Convert.ToInt32(tempMessageGroupInstance[0]),
                    segmentTypeId = Convert.ToInt32(tempMessageGroupInstance[1]),
                    description   = tempMessageGroupInstance[2]
                });

                if (messageGroupInstance.id != -1 || messageGroupInstance.id != 0)
                {
                    List <String> tempMessageGroup = elementSplit[1].Split(',').ToList();

                    tempMessageGroup.ForEach(delegate(String tempElement) {
                        Console.WriteLine("Inserting Message Group");

                        string[] tempInnerElement = tempElement.Split('^');

                        MessageGroupDAO.PostUpdate(new MessageGroup()
                        {
                            messageGroupInstanceId = messageGroupInstance.id,
                            messagePartId          = Convert.ToInt32(tempInnerElement[0]),
                            position = Convert.ToInt32(tempInnerElement[1])
                        });
                    });

                    Console.WriteLine("Inserting Message Group Property or Column Set");

                    // gives the first part
                    string[] tempColumnSet = elementSplit[2].Split(',');

                    /*
                     * ColumnSet columnSet = new ColumnSet()
                     * {
                     *  databaseTableId = Convert.ToInt32(tempColumnSet[0]),
                     *  name = tempColumnSet[1],
                     *  messageGroupInstanceId = messageGroupInstance.id,
                     *  isPrimaryKey = Convert.ToBoolean(tempColumnSet[2]),
                     *  columnDataType = tempColumnSet[3]
                     * };
                     *
                     * ColumnSetDAO.PostUpdate(columnSet);
                     */

                    WebservicePropertySet webservicePropertySet = new WebservicePropertySet()
                    {
                        webserviceObjectId = Convert.ToInt32(tempColumnSet[0]),
                        name = tempColumnSet[1],
                        messageGroupInstanceId = messageGroupInstance.id,
                        columnDataType         = tempColumnSet[2]
                    };

                    WebservicePropertySetDAO.PostUpdate(webservicePropertySet);
                }
            });
            Console.Read();
        }