示例#1
0
        private void LoadStorageInfo()
        {
            Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
            storage.Get(this._storageId);
            CICHelper.SetFieldValues(this.inputControlsRow.Controls, storage);

            SpecimenSite site = new SpecimenSite();

            //site.Get(Int32.Parse(storage[Caisis.BOL.SpecimenStorage.SiteId].ToString()));
            site.Get(_siteId);

            this.PageTitle.Text = site[SpecimenSite.SiteName].ToString() + " > " + storage[Caisis.BOL.SpecimenStorage.StorageName].ToString();
        }
        private void LoadContainerInfo()
        {
            SpecimenContainer container = new SpecimenContainer();

            container.Get(this._containerId);
            CICHelper.SetFieldValues(this.inputControlsRow.Controls, container);

            Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
            storage.Get(Int32.Parse(container[SpecimenContainer.StorageId].ToString()));

            SpecimenSite site = new SpecimenSite();

            site.Get(Int32.Parse(storage[Caisis.BOL.SpecimenStorage.SiteId].ToString()));

            this.PageTitle.Text = site[SpecimenSite.SiteName].ToString() + " > " + storage[Caisis.BOL.SpecimenStorage.StorageName].ToString() + " > " + container[SpecimenContainer.ContainerName].ToString();
        }
示例#3
0
        protected void Save_Click(object sender, CommandEventArgs e)
        {
            Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
            storage.Get(this._storageId);
            bool isNewRecord = this._siteId == 0 ? false : true;

            CICHelper.SetBOValues(Page.FindControl("inputControlsRow").Controls, storage, 0);

            // set parent id for new record
            if (isNewRecord)
            {
                storage[Caisis.BOL.SpecimenStorage.SiteId] = _siteId;
            }
            storage.Save();

            // Closes the modal window, and signal main page to either update the text when updating a record
            // to or resubmit the form to reflect the new record
            //ClientScript.RegisterClientScriptBlock(Page.GetType(), "x1", "<script language=\"javascript\">if(top.updatePage) { top.updatePage('" + Name.Value + "'," + (this._storageId == 0 ? "true" : "false") + "); }hideModal();</script>");

            CloseThisPage(false);
        }
示例#4
0
        protected void Delete_Click(object sender, CommandEventArgs e)
        {
            var c = new Dictionary <string, object>()
            {
                { BOL.SpecimenContainer.StorageId, _storageId }
            };

            //Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
            //SpecimenContainer container = new SpecimenContainer();
            //container.GetByParent(_storageId);
            //if (container.RecordCount == 0)
            if (!BusinessObject.Exists <BOL.SpecimenContainer>(c))
            {
                Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
                storage.Delete(this._storageId);
            }
            else
            {
                Response.Write("<script>alert('This Storage has Container(s) and therefore can not be deleted!');</script>");
            }

            CloseThisPage(true);
        }
示例#5
0
        private void LoadBoxInfo()
        {
            SpecimenBox box = new SpecimenBox();

            box.Get(this._boxId);
            CICHelper.SetFieldValues(this.inputControlsRow.Controls, box);

            SpecimenContainer container = new SpecimenContainer();

            container.Get(this._containerId);

            Caisis.BOL.SpecimenStorage storage = new Caisis.BOL.SpecimenStorage();
            storage.Get(Int32.Parse(container[SpecimenContainer.StorageId].ToString()));

            SpecimenSite site = new SpecimenSite();

            site.Get(Int32.Parse(storage[Caisis.BOL.SpecimenStorage.SiteId].ToString()));

            this.PageTitle.Text = site[SpecimenSite.SiteName].ToString() + " > " + storage[Caisis.BOL.SpecimenStorage.StorageName].ToString() + " > " + container[SpecimenContainer.ContainerName].ToString() + " > " + box[SpecimenBox.BoxName].ToString();
            BoxName.Value       = box[SpecimenBox.BoxName].ToString();

            DataTable dt = da.GetSpecimensByBoxId(_boxId);

            //Disables editing of columns & rows if box contains specimens
            if (dt.Rows.Count == 0)
            {
                NoOfColumns.ReadOnly = false;
                NoOfRows.ReadOnly    = false;
            }
            else
            {
                NoOfColumns.ReadOnly = true;
                NoOfRows.ReadOnly    = true;
                NoOfColumns.ToolTip  = "# of columns can not be changed with specimens in Box";
                NoOfRows.ToolTip     = "# of rows can not be changed with specimens in Box";
            }
        }