Пример #1
0
        public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection)
        {
            Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection();
            foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection)
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                switch (caseNotesKey.CaseNotesKeyName)
                {
                    case Domain.CaseNotesKeyNameEnum.MasterAccessionNo:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate";
                        break;
                    case Domain.CaseNotesKeyNameEnum.ClientOrderId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate";
                        break;
                    case Domain.CaseNotesKeyNameEnum.ContainerId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate";
                        break;
                    case Domain.CaseNotesKeyNameEnum.SpecimenLogId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate";
                        break;
                }

                Domain.OrderCommentLogCollection midCollection1 = BuildOrderCommentLogCollection(cmd);
                foreach (Domain.OrderCommentLog orderCommentLog in midCollection1)
                {
                    result.AddUnique(orderCommentLog);
                }
            }
            return result;
        }
Пример #2
0
        public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection)
        {
            Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection();
            foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection)
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                switch (caseNotesKey.CaseNotesKeyName)
                {
                    case Domain.CaseNotesKeyNameEnum.MasterAccessionNo:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                        break;
                    case Domain.CaseNotesKeyNameEnum.ClientOrderId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                        break;
                    case Domain.CaseNotesKeyNameEnum.ContainerId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                        break;
                    case Domain.CaseNotesKeyNameEnum.SpecimenLogId:
                        cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                        break;
                }

                XElement xelement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData);
                Domain.OrderCommentLogCollection midCollection = BuildOrderCommentLogCollection(xelement);

                foreach (Domain.OrderCommentLog orderCommentLog in midCollection)
                {
                    result.AddUnique(orderCommentLog);
                }
            }
            return result;
        }
Пример #3
0
        public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection)
        {
            Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection();
            foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection)
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                switch (caseNotesKey.CaseNotesKeyName)
                {
                case Domain.CaseNotesKeyNameEnum.MasterAccessionNo:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate;";
                    break;

                case Domain.CaseNotesKeyNameEnum.ClientOrderId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate;";
                    break;

                case Domain.CaseNotesKeyNameEnum.ContainerId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate;";
                    break;

                case Domain.CaseNotesKeyNameEnum.SpecimenLogId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate;";
                    break;
                }

                Domain.OrderCommentLogCollection midCollection1 = BuildOrderCommentLogCollection(cmd);
                foreach (Domain.OrderCommentLog orderCommentLog in midCollection1)
                {
                    result.AddUnique(orderCommentLog);
                }
            }
            return(result);
        }
Пример #4
0
        public static Domain.OrderCommentLogCollection OrderCommentLogCollectionFromCaseNotesKeys(Domain.CaseNotesKeyCollection caseNotesKeyCollection)
        {
            Domain.OrderCommentLogCollection result = new Domain.OrderCommentLogCollection();
            foreach (Domain.CaseNotesKey caseNotesKey in caseNotesKeyCollection)
            {
                SqlCommand cmd = new SqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                switch (caseNotesKey.CaseNotesKeyName)
                {
                case Domain.CaseNotesKeyNameEnum.MasterAccessionNo:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where MasterAccessionNo = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                    break;

                case Domain.CaseNotesKeyNameEnum.ClientOrderId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where ClientOrderId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                    break;

                case Domain.CaseNotesKeyNameEnum.ContainerId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where ContainerId = '" + caseNotesKey.Key + "' order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                    break;

                case Domain.CaseNotesKeyNameEnum.SpecimenLogId:
                    cmd.CommandText = "SELECT * from tblOrderCommentLog where SpecimenLogId = " + caseNotesKey.Key + " order by LogDate for xml Path('OrderCommentLog'), root('OrderCommentLogCollection')";
                    break;
                }

                XElement xelement = Domain.Persistence.SqlXmlPersistence.CrudOperations.ExecuteXmlReaderCommand(cmd, Domain.Persistence.DataLocationEnum.ProductionData);
                Domain.OrderCommentLogCollection midCollection = BuildOrderCommentLogCollection(xelement);

                foreach (Domain.OrderCommentLog orderCommentLog in midCollection)
                {
                    result.AddUnique(orderCommentLog);
                }
            }
            return(result);
        }