private string GetSchemaName(string protocolSchemaId)
        {
            if (!string.IsNullOrEmpty(protocolSchemaId))
            {
                int            schemaId = int.Parse(protocolSchemaId);
                ProtocolSchema biz      = new ProtocolSchema();
                biz.Get(schemaId);

                return(biz[ProtocolSchema.ProtocolArmDescription].ToString());
            }
            return("");
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private int SaveSchema()
        {
            ProtocolSchema biz = new ProtocolSchema();

            if (!String.IsNullOrEmpty(BaseSchemaId) &&
                BaseSchemaId != "-1")
            {
                biz.Get(Int32.Parse(BaseSchemaId));
            }
            else
            {
                biz[ProtocolSchema.ProtocolVersionId] = ProtocolVersionId.ToString();
            }

            biz[ProtocolSchema.ProtocolArmDescription] = ArmName.Text;
            biz[ProtocolSchema.ProtocolArmMaxAccrual]  = ArmMaxAccrual.Text;
            biz[ProtocolSchema.ProtocolArmActive]      = ArmActive.Checked ? 1 : 0;
            biz.Save();

            return(int.Parse(biz[ProtocolSchema.ProtocolSchemaId].ToString()));
        }
        protected void CopyArm(object sender, CommandEventArgs e)
        {
            int schemaId;
            int versionId;

            if (int.TryParse(e.CommandArgument.ToString(), out schemaId) && int.TryParse(QueryVersionId, out versionId))
            {
                int?copiedSchema = ProtocolMgmtController.CopyProtocolSchema(schemaId);
                if (copiedSchema.HasValue)
                {
                    // after creating copied schema, update verion id
                    ProtocolSchema biz = new ProtocolSchema();
                    biz.Get(copiedSchema.Value);
                    biz[ProtocolSchema.ProtocolVersionId] = versionId;
                    biz.Save();

                    // adter copying schema, go to edit schema page
                    string nextURL = GetQueryStringBySchema(copiedSchema);
                    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "GoToSchemaPage", "parent.reloadTreatmentArms(); parent.editSchema('" + nextURL + "');", true);
                }
            }
        }
Exemple #4
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!IsNew)
                {
                    ProtocolSchema biz = new ProtocolSchema();
                    biz.Get(Int32.Parse(BaseSchemaId));

                    ArmName.Text       = biz[ProtocolSchema.ProtocolArmDescription].ToString();
                    ArmMaxAccrual.Text = biz[ProtocolSchema.ProtocolArmMaxAccrual].ToString();

                    // check active state
                    string active      = biz[ProtocolSchema.ProtocolArmActive].ToString();
                    bool   isArmActive = !string.IsNullOrEmpty(active) && Caisis.UI.Core.Classes.PageUtil.IsTrueString(active);
                    ArmActive.Checked = isArmActive;
                }
                else
                {
                    NextBtn.Visible = false;
                }
            }
        }
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(BaseSchemaId))
                {
                    ProtocolSchema biz = new ProtocolSchema();
                    biz.Get(int.Parse(BaseSchemaId));
                    TreatmentArmTitle.Text = biz[ProtocolSchema.ProtocolArmDescription].ToString().ToUpper();
                }
                BuildSchemaPatients();

                // delete via QS
                string queryAction          = Request.QueryString["action"];
                string queryPatientSchemaId = Request.QueryString["patientSchemaId"];
                if (queryAction == "delete" && !string.IsNullOrEmpty(queryPatientSchemaId))
                {
                    int           patientSchemaId = int.Parse(queryPatientSchemaId);
                    PatientSchema ps = new PatientSchema();
                    ps.Get(patientSchemaId);
                    if (!ps.IsEmpty)
                    {
                        string            dataset = CacheManager.GetDatasetSQL(Session[SessionKey.DatasetId]);
                        DataSetController dsc     = new DataSetController();
                        int patientId             = (int)ps[PatientSchema.PatientId];
                        if (dsc.IsPatientInDataset(patientId, dataset))
                        {
                            DeletePatient(patientSchemaId);
                            Response.Redirect("AdminSchemaPatients.aspx?scid=" + BaseSchemaId);
                        }
                    }
                }
            }

            Message.Visible = false;
        }