예제 #1
0
        private void LoadCollection()
        {
            SpecimenCollection collection = new SpecimenCollection();

            collection.Get(colId);
            CICHelper.SetFieldValues(Page.Controls, collection);

            this.CollectionName.Text       = collection[SpecimenCollection.CollectionName].ToString();
            this.CollectionAssignDate.Text = collection[SpecimenCollection.CollectionAssignDate].ToString();
            this.CollectionAssignDate.Text = GetValidDisplayDate(this.CollectionAssignDate.Text);

            this.CollectionType.Text   = collection[SpecimenCollection.CollectionType].ToString();
            this.CollectionStatus.Text = collection[SpecimenCollection.CollectionStatus].ToString();

            this.CollectionProjectCode.Text = collection[SpecimenCollection.CollectionProjectCode].ToString();
            this.CollectionAssignNotes.Text = collection[SpecimenCollection.CollectionAssignNotes].ToString();

            this.pageTitle.Text = collection[SpecimenCollection.CollectionName].ToString();

            SecurityController sc   = new SecurityController();
            string             user = sc.GetUserName();

            this.printedBy.Text   = user;
            this.printedDate.Text = DateTime.Now.ToString();

            BindSpecimensGrid();
        }
예제 #2
0
        /// <summary>
        /// Updates the CollectionStatus for a collection.
        /// </summary>
        /// <param name="colId"></param>
        /// <param name="status"></param>
        private void UpdateCollectionStatus(int colId, string status)
        {
            SpecimenCollection bizCol = new SpecimenCollection();

            bizCol.Get(colId);

            bizCol[SpecimenCollection.CollectionStatus] = status;
            bizCol.Save();
        }
예제 #3
0
        private void RemoveCollectionFromRequest(int colId)
        {
            SpecimenCollection bizCol = new SpecimenCollection();

            bizCol.Get(colId);

            bizCol[SpecimenCollection.SpecimenRequestId] = DBNull.Value;
            bizCol[SpecimenCollection.CollectionStatus]  = "Available";
            bizCol.Save();

            this.collectionIdList.Remove(colId.ToString());
        }
예제 #4
0
        private void AddCollectionToRequest(int colId)
        {
            SpecimenCollection bizCol = new SpecimenCollection();

            bizCol.Get(colId);

            bizCol[SpecimenCollection.SpecimenRequestId] = this.RequestId;
            bizCol[SpecimenCollection.CollectionStatus]  = "Pending Transfer";
            bizCol.Save();

            this.collectionIdList.Add(colId.ToString());
        }
예제 #5
0
        private void LoadExistingCollection(int id)
        {
            SpecimenCollection collection = new SpecimenCollection();

            collection.Get(id);
            CICHelper.SetFieldValues(Page.Controls, collection);

            this.CollectionName.Text       = collection[SpecimenCollection.CollectionName].ToString();
            this.CollectionAssignDate.Text = collection[SpecimenCollection.CollectionAssignDate].ToString();
            this.CollectionType.Text       = collection[SpecimenCollection.CollectionType].ToString();
            this.CollectionStatus.Text     = collection[SpecimenCollection.CollectionStatus].ToString();

            this.CollectionProjectCode.Text = collection[SpecimenCollection.CollectionProjectCode].ToString();
            this.CollectionAssignNotes.Text = collection[SpecimenCollection.CollectionAssignNotes].ToString();

            //this.CollectionAssignDate.Value = GetValidDisplayDate(this.CollectionAssignDate.Value);
            //LoadAuditData(collection);

            this.pageTitle.Text = collection[SpecimenCollection.CollectionName].ToString();
            // BindSpecimensGrid();
        }
예제 #6
0
        protected void LoadExistingCollection(int colId, bool isNewCollection)
        {
            // set title of column header from web config value
            IdentifierColumnTitle.Text = CaisisConfiguration.GetWebConfigValue("SpecimenModuleDefaultId");

            SpecimenCollection collection = new SpecimenCollection();

            collection.Get(colId);
            CICHelper.SetFieldValues(Page.Controls, collection);
            this.CollectionAssignDate.Value = GetValidDisplayDate(this.CollectionAssignDate.Value);
            LoadAuditData(collection);

            //write the colId to javascript variable so we can pass it into querystring for printing
            ClientScript.RegisterClientScriptBlock(Page.GetType(), "x1", "<script language=\"javascript\">colId=\"" + colId.ToString() + "\";</script>");

            // default the status if the collection was newly created
            if (isNewCollection)
            {
                this.CollectionStatus.Value = "Available";
            }

            BindSpecimensGrid();
        }
예제 #7
0
        private void SaveRequestFields()
        {
            int?requestId = null;
            // save request
            SpecimenRequest request = new SpecimenRequest();

            if (!string.IsNullOrEmpty(SpecimenRequestId.Value))
            {
                requestId = int.Parse(SpecimenRequestId.Value);
                request.Get(requestId.Value);
            }
            CICHelper.SetBOValues(this.Controls, request, -1);
            request.Save();
            requestId = (int)request[SpecimenRequest.SpecimenRequestId];
            // save distribution
            int?distributionId = null;
            SpecimenDistribution distribution = new SpecimenDistribution();

            if (!string.IsNullOrEmpty(DistributionId.Value))
            {
                distributionId = int.Parse(DistributionId.Value);
                distribution.Get(distributionId.Value);
            }
            CICHelper.SetBOValues(this.Controls, distribution, -1);
            distribution[SpecimenDistribution.SpecimenRequestId] = requestId.Value;
            distribution.Save();
            // save collecion
            int?collectionId = null;
            SpecimenCollection collection = new SpecimenCollection();

            if (!string.IsNullOrEmpty(CollectionId.Value))
            {
                collectionId = int.Parse(CollectionId.Value);
                collection.Get(collectionId.Value);
            }
            CICHelper.SetBOValues(this.Controls, collection, -1);
            collection[SpecimenCollection.SpecimenRequestId] = requestId.Value;
            // !important
            // handle transfer status: stamp with original request
            if (QueryMode == "request" && !string.IsNullOrEmpty(QueryTransferStatus))
            {
                collection[SpecimenCollection.CollectionStatus] = QueryTransferStatus;
            }
            collection.Save();
            collectionId = (int)collection[SpecimenCollection.CollectionId];
            // save specimens
            IEnumerable <int> specimensInCollection = SaveSpecimens(collectionId.Value);

            // update specimen statuses
            if (!string.IsNullOrEmpty(QueryTransferStatus))
            {
                UpdateSpecimenStatus(specimensInCollection, QueryTransferStatus);
            }

            // update fields
            SpecimenRequestId.Value = requestId + "";
            DistributionId.Value    = distributionId + "";
            CollectionId.Value      = collectionId + "";

            // register update script
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "registerUpdateScript", "if(parent.doTransferUpdated) parent.doTransferUpdated();", true);
        }