コード例 #1
0
ファイル: FormUpload.cs プロジェクト: wjn99wjn/CTDB
        private void FormUpload_Load(object sender, EventArgs e)
        {
            lbDataset.Text = ParaDatasetID.ToString();
            UserID         = CTHelper.GetConfig("userid");

            CTDBEntities ct = new CTDBEntities();

            if (ParaTable == "ctdb-slice")
            {
                this.Text        = "CTDB - Slice File";
                lbTableName.Text = "SliceID";
                tbSlice s = ct.tbSlice.Where(c => c.slice_id == ParaDatasetID).Single();
                lbDSName.Text               = s.Abstract;
                lbSpecimenID.Text           = s.tbScan.tbSpecimen.sp_id.ToString();
                mitCreatedFromSlice.Visible = true;
                cdFileRef.Visible           = false;
            }
            else if (ParaTable == "ctdb-scan")
            {
                this.Text        = "CTDB - Scan Source File";
                lbTableName.Text = "ScanID";
                tbScan s = ct.tbScan.Where(c => c.scan_id == ParaDatasetID).Single();
                lbDSName.Text     = s.Abstract;
                lbSpecimenID.Text = s.tbSpecimen.sp_id.ToString();
                cdFileRef.Visible = false;
            }
            else if (ParaTable == "ctdb-label")
            {
                this.Text        = "CTDB - Tissue Label File";
                lbTableName.Text = "LabelID";
                tbLabel s = ct.tbLabel.Where(c => c.label_id == ParaDatasetID).Single();
                lbDSName.Text               = s.label_id.ToString();
                lbSpecimenID.Text           = s.tbSlice.tbScan.tbSpecimen.sp_id.ToString();
                mitCreatedFromLabel.Visible = true;
                cdFileRef.Visible           = false;
            }
            else if (ParaTable == "ctdb-specimen")
            {
                this.Text        = "CTDB - Specimen's Demo File";
                lbTableName.Text = "SpecimenID";
                tbSpecimen s = ct.tbSpecimen.Where(c => c.sp_id == ParaDatasetID).Single();
                lbSpecimenID.Text = s.sp_id.ToString();
                lbDSName.Text     = s.Abstract;
                // cdFileRef.Enabled = true;
            }
            else if (ParaTable == "ctdb-scanpara")
            {
                this.Text        = "CTDB - scan parameter's picture file";
                lbTableName.Text = "";
                tbScan s = ct.tbScan.Where(c => c.scan_id == ParaDatasetID).Single();
                lbDSName.Text     = s.Abstract;
                lbSpecimenID.Text = s.tbSpecimen.sp_id.ToString();
                cdFileRef.Visible = false;
            }
            else
            {
                this.Close();
            }


            CTHelper.setControlTag(cdFileType, 14, ParaFileType); // 14 filetype, 指定的Image
            CTHelper.setControlTag(cdFileOpenStatus, 31, 30);     //31 share method, 30 share in group
            CTHelper.LoadControl(cdFileRef, "tbRef", 4);          // 14 filetype, 11 image
            cdFileAuthor.Text = CTHelper.GetConfig("username");

            refreshdb();
        }