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(); }
protected void Delete_Click(object sender, CommandEventArgs e) { //SpecimenContainer container = new SpecimenContainer(); //SpecimenBox box = new SpecimenBox(); //box.GetByParent(this._containerId); //if (box.RecordCount == 0) var c = new Dictionary <string, object>() { { SpecimenBox.ContainerId, this._containerId } }; if (!BusinessObject.Exists <SpecimenBox>(c)) { SpecimenContainer container = new SpecimenContainer(); container.Delete(this._containerId); } else { Response.Write("<script>alert('This Container has Box(s) and therefore can not be deleted!');</script>"); } CloseThisPage(true); }
protected void Save_Click(object sender, CommandEventArgs e) { SpecimenContainer container = new SpecimenContainer(); container.Get(this._containerId); bool isNewRecord = this._storageId == 0 ? false : true; CICHelper.SetBOValues(Page.FindControl("inputControlsRow").Controls, container, 0); // set parent id for new record if (isNewRecord) { container[SpecimenContainer.StorageId] = _storageId; } container.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._containerId == 0 ? "true" : "false") + "); }hideModal();</script>"); CloseThisPage(false); }
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"; } }