コード例 #1
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();
        }
コード例 #2
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());
        }
コード例 #3
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());
        }
コード例 #4
0
        protected void btnSubmit_onClick(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            if (ValidateCollectionName(this.newCollectionName.Value))
            {
                this.colNameError.Text = "";
                SpecimenCollection collection = new SpecimenCollection();
                collection[SpecimenCollection.CollectionName]       = this.newCollectionName.Value;
                collection[SpecimenCollection.CollectionStatus]     = "Available";             //bug fix
                collection[SpecimenCollection.CollectionAssignDate] = DateTime.Now.ToString(); //enhancement
                collection.Save();
                AddSpecimensToCollection(int.Parse(collection[SpecimenCollection.CollectionId].ToString()), Request.QueryString["specimenIds"], true);

                this.collectionNamePage.Visible    = false;
                this.collectionDetailsPage.Visible = true;

                this.pageTitle.Text = "Added  <span style=\"color:#00668d;\">" + this.numOfSpecimensAdded.ToString() + " Specimen(s)</span> to New Collection";
            }
            else
            {
                this.colNameError.Text = "Name is already in use. &nbsp;Please try again.";
            }
        }
コード例 #5
0
        protected void btnSave_onClick(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            if (ValidateCollectionName(this.CollectionName.Value))
            {
                SpecimenCollection collection = new SpecimenCollection();
                CICHelper.SetBOValues(Page.Controls, collection, 1);

                //DataTable dt = new DataTable();
                //dt = collection.GetTable();

                collection[SpecimenCollection.EnteredBy]   = this.EnteredBy.Text;
                collection[SpecimenCollection.EnteredTime] = this.EnteredTime.Text;

                SecurityController sc   = new SecurityController();
                string             user = sc.GetUserName();
                collection[SpecimenCollection.UpdatedBy]   = user;
                collection[SpecimenCollection.UpdatedTime] = DateTime.Now.ToString();

                collection[SpecimenCollection.LockedBy]   = this.LockedBy.Text;
                collection[SpecimenCollection.LockedTime] = this.LockedTime.Text;

                collection.Save();

                //dt = new DataTable();
                //dt = collection.GetTable();
                //this.CollectionId.Text = dt.Rows[0][SpecimenCollection.CollectionId].ToString();
                this.CollectionId.Text = collection[SpecimenCollection.CollectionId].ToString();

                LoadAuditData(collection);
                this.errorMessage.Text = "";
            }
            else
            {
                //collection name in use already; don't save
                this.errorMessage.Text = "Name is already in use. &nbsp;Please try again.";
            }

            ShowHideSpecimenGrid();
        }
コード例 #6
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);
        }