Example #1
0
        protected void addSubSpecimenbtn_Click(object sender, EventArgs e)
        {
            string refNum = CurrentSpecimen[Specimen.SpecimenReferenceNumber].ToString();

            CICHelper.ClearCaisisInputControlValues(this);

            if (!string.IsNullOrEmpty(refNum))
            {
                this.SpecimenReferenceNumber.Value = refNum + "-"; //pattern yet to decide
            }
            else
            {
                this.SpecimenReferenceNumber.Value = "";
            }
            this.SpecimenUnits.Value = CurrentSpecimen[Specimen.SpecimenUnits].ToString();

            this.UpdateBtn.Visible         = false;
            this.SaveBtn.Visible           = true;
            this.addSubSpecimenbtn.Visible = false;
            this.hdrlbl.Visible            = false;
            this.subspeclbl.Visible        = true;

            //get SpecimenReferencNumber
            string    datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataTable dt         = da.GetIdentifier(this.specimenId, _identifierType, datasetSql);
            string    refnum     = dt.Rows[0].ItemArray[3].ToString();

            this.subspeclbl.Text = "Add Sub-Specimen for Specimen : " + refnum.ToString();

            Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "HideProcessingEvents", "HideProcessingEvents();", true);
        }
Example #2
0
        private void LoadSpecimenInfo()
        {
            //getting patient identifier
            PtId.Text = _identifierType + " :";
            string    datasetSql    = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataTable identifiersdt = da.GetIdentifier(specimenId, _identifierType, datasetSql);
            string    identifier    = identifiersdt.Rows[0].ItemArray[2].ToString();

            this.pagetitle.Text = identifier.ToString();

            //loading frames
            this.SpecimensRptFrame.Attributes["src"]    = "SpecimensHierarchy.aspx?specimenId=" + specimenId + "&parentspecimenId=" + parentspecimenId;
            this.SpecimenDataFrame.Attributes["src"]    = "EditSpecimenDetails.aspx?specimenId=" + specimenId;
            this.processingevntsframe.Attributes["src"] = "AddSpecimenEvents.aspx?specimenId=" + specimenId;
        }
Example #3
0
        private void BindSpecimenEventsGrid()
        {
            //SpecimenEvents se = new SpecimenEvents();
            //se.GetByParent(specimenId);

            DataView view = BusinessObject.GetByParentAsDataView <SpecimenEvents>(specimenId);

            //this.SpecimenEventsGridView.DataSource = se.DataSourceView;
            this.SpecimenEventsGridView.DataSource = view;
            this.SpecimenEventsGridView.DataBind();

            //this.totalSpecimenEvents.Text = se.RecordCount.ToString() + " Specimen Event(s)";
            this.totalSpecimenEvents.Text = view.Count.ToString() + " Specimen Event(s)";

            //getting SpecimenReferencNumber
            string    datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataTable dt         = da.GetIdentifier(this.specimenId, _identifierType, datasetSql);
            string    refnum     = dt.Rows[0].ItemArray[3].ToString();

            this.refNumber.Text = "Processing Events for Specimen : " + refnum.ToString();
        }
Example #4
0
        //to check the Type is not null, before Add/Update events in different RowTypes of gridview control
        protected void AddClickEventToButtons(object sender, GridViewRowEventArgs e)
        {
            //adding new event
            if (e.Row.RowType == DataControlRowType.EmptyDataRow)
            {
                ImageButton    emptyrowAddBtn  = e.Row.FindControl("EvtAdd") as ImageButton;
                CaisisComboBox emptyrowevtTest = e.Row.FindControl("EvtTest") as CaisisComboBox;
                if (emptyrowAddBtn != null && emptyrowevtTest != null)
                {
                    emptyrowAddBtn.Attributes["onclick"] = "return validateTest('" + emptyrowevtTest.ClientID + "');";
                }
            }
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //delete existing event
                ImageButton deleteBtn = e.Row.FindControl("DeleteBtn") as ImageButton;
                if (deleteBtn != null)
                {
                    deleteBtn.Attributes["onclick"] = "return confirm('Are you sure you want to delete this event?');";
                }

                //updating existing event data in edit mode
                ImageButton    saveBtn = e.Row.FindControl("SaveRowBtn") as ImageButton;
                CaisisComboBox evtTest = e.Row.FindControl("EvtTest1") as CaisisComboBox;
                if (saveBtn != null && evtTest != null)
                {
                    saveBtn.Attributes["onclick"] = "return validateTest('" + evtTest.ClientID + "');";
                }

                //getting Specimen Reference # to view report
                DataRowView       drv        = (DataRowView)e.Row.DataItem;
                int               id         = int.Parse(drv["SpecimenId"].ToString());
                SpecimenManagerDa da         = new SpecimenManagerDa();
                string            datasetSQL = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
                DataTable         dt         = da.GetIdentifier(id, _identifierType, datasetSQL);
                string            str        = dt.Rows[0].ItemArray[3].ToString();
                string            refnum;

                //to get the substring of ReferenceNumber removing from first hyphen(-)
                if (str.Contains("-"))
                {
                    int index = str.IndexOf(@"-");
                    refnum = str.Substring(0, index);
                }
                else
                {
                    refnum = str;
                }

                //show URL button for only processed aCGH tests
                //commented this section temporarily

                /*
                 * string testValue = drv["EventType"].ToString();
                 * string testProcessedBy = drv["ProcessedBy"].ToString();
                 *
                 * Button urlBtn1 = e.Row.FindControl("EvtURL1") as Button;
                 * if (testValue == "aCGH" && testProcessedBy == "")
                 * {
                 *  SpecimenEventsGridViewTable.FindControl("hdrRpt").Visible = true;
                 *  SpecimenEventsGridView.Columns[11].Visible = true;
                 * }
                 * if (urlBtn1 != null)
                 * {
                 *  if (testValue == "aCGH" && testProcessedBy == "")
                 *  {
                 *      urlBtn1.Attributes["onclick"] = "window.open('http://aji.cbio.mskcc.org/btc/" + refnum + "/index.html','_new'); return false;";
                 *      urlBtn1.Style["visibility"] = "visible";
                 *      urlBtn1.NamingContainer.Visible = true;
                 *  }
                 * }
                 */

                // enable edit click
                ImageButton editBtn = e.Row.FindControl("EditImage") as ImageButton;
                editBtn.OnClientClick = "enableGridFields(" + e.Row.RowIndex + ");return false;";
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                //Adding new event, with some events already existing
                ImageButton    AddBtn        = e.Row.FindControl("EvntAdd1") as ImageButton;
                CaisisComboBox footerevtTest = e.Row.FindControl("EvtTest2") as CaisisComboBox;
                if (AddBtn != null && footerevtTest != null)
                {
                    AddBtn.Attributes["onclick"] = "return validateTest('" + footerevtTest.ClientID + "');";
                }
            }
        }
Example #5
0
        private void LoadSpecimenInfo()
        {
            Specimen specimen = new Specimen();

            specimen.Get(this.specimenId);

            string parentspecId = specimen[Specimen.ParentSpecimenId].ToString();

            pspecId.Value = parentspecId.ToString();

            //if (!string.IsNullOrEmpty(parentspecId))
            //{
            //    Specimen ParentSpecimen = new Specimen();
            //    ParentSpecimen.Get(Int32.Parse(parentspecId.ToString()));

            //    pRemQty.Value = ParentSpecimen[Specimen.SpecimenRemainingQty].ToString();
            //}

            CICHelper.SetFieldValues(this.inputControlsRow.Controls, specimen);

            //getting patient identifier
            PtId.Text = _identifierType + " :";
            SpecimenManagerDa da         = new SpecimenManagerDa();
            string            datasetSql = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
            DataTable         dt         = da.GetIdentifier(this.specimenId, _identifierType, datasetSql);
            string            identifier = dt.Rows[0].ItemArray[2].ToString();

            TumorBankNumber.Text = identifier.ToString();

            //load box and position from SpecimenBoxes and SpecimenPositions tables
            string sBoxId = specimen[Specimen.BoxId].ToString();

            if (!String.IsNullOrEmpty(sBoxId))
            {
                int         boxId = int.Parse(sBoxId);
                SpecimenBox box   = new SpecimenBox();
                box.Get(boxId);
                this.BoxId.Value   = box[SpecimenBox.BoxId].ToString();
                this.BoxName.Value = box[SpecimenBox.BoxName].ToString();

                DataSet hierarchySet = da.GetBoxAndAncestors(boxId);

                DataTable boxesDT      = hierarchySet.Tables[0];
                DataTable containersDT = hierarchySet.Tables[1];
                DataTable storagesDT   = hierarchySet.Tables[2];
                DataTable siteDT       = hierarchySet.Tables[3];

                if (boxesDT.Rows.Count >= 1)
                {
                    string  containerIdStr = boxesDT.Rows[0][SpecimenBox.ContainerId].ToString();
                    DataRow containerRow   = containersDT.Select(SpecimenContainer.ContainerId + " = " + containerIdStr)[0];
                    this.ContainerName.Value = PageUtil.EscapeSingleQuotes(containerRow[SpecimenContainer.ContainerName].ToString());
                }
                if (containersDT.Rows.Count >= 1)
                {
                    string  storagesIdStr = containersDT.Rows[0][Caisis.BOL.SpecimenContainer.StorageId].ToString();
                    DataRow specimenRow   = storagesDT.Select(Caisis.BOL.SpecimenStorage.StorageId + " = " + storagesIdStr)[0];
                    this.StorageName.Value = PageUtil.EscapeSingleQuotes(specimenRow[Caisis.BOL.SpecimenStorage.StorageName].ToString());
                }
                if (siteDT.Rows.Count >= 1)
                {
                    string  siteId  = siteDT.Rows[0][SpecimenSite.SiteId].ToString();
                    DataRow siteRow = siteDT.Select(SpecimenSite.SiteId + " = " + siteId)[0];
                    this.SiteName.Value = PageUtil.EscapeSingleQuotes(siteRow[SpecimenSite.SiteName].ToString());
                }
            }

            string sPositionId = specimen[Specimen.PositionId].ToString();

            if (!String.IsNullOrEmpty(sPositionId))
            {
                int positionId       = int.Parse(sPositionId);
                SpecimenPosition pos = new SpecimenPosition();
                pos.Get(positionId);
                this.PositionName.Value = pos[SpecimenPosition.Position].ToString();
                this.PositionId.Value   = pos[SpecimenPosition.PositionId].ToString();
            }
        }