protected void MoveRecord(object sender, EventArgs e) { SQL_utils sql = new SQL_utils("data"); List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("old_studymeasID", ddl_studymeasID.SelectedValue, "int")); ps.Add(sql.CreateParam("new_studymeasID", ddl_Studymeas_New.SelectedValue, "int")); ps.Add(sql.CreateParam("pk", ddl_IDmove.SelectedValue, "int")); sql.NonQuery_from_ProcName("spDEF__Update_StudymeasID_for_entered_Measure", ps); sql.Close(); Populate_ID_DDLs(); btnReset.Visible = false; panelDelete.Visible = false; btnDelete.Visible = false; txtDelete.Text = ""; lbl_Studymeas_New.Visible = false; ddl_Studymeas_New.Visible = false; btnMove.Visible = false; UpdatePanel01.Update(); }
protected void ConfirmTextChanged(object sender, EventArgs e) { if (txtDelete.Text == "del") { btnDelete.Visible = true; } else { btnDelete.Visible = false; } UpdatePanel01.Update(); }
protected void Populate_delSubj_ID_DDL() { SQL_utils sql = new SQL_utils("backend"); string sqlcode = "select -1 subjID, '--select--' idgrp union select subjID, ID + ' (' + groupname + ')' as idgrp from vwMasterStatus_S where groupID in (select groupID from dbo.fnSEC_Allowed_ADMIN_Groups_by_User()) " + " and studyID = " + Master.Master_studyID.ToString(); DataTable dtSM = sql.DataTable_from_SQLstring(sqlcode); sql.Close(); if (dtSM.Rows.Count > 1) { ddl_delSubj1.DataSource = dtSM; ddl_delSubj1.DataTextField = "idgrp"; ddl_delSubj1.DataValueField = "subjID"; ddl_delSubj1.DataBind(); ddl_delSubj2.DataSource = dtSM; ddl_delSubj2.DataTextField = "idgrp"; ddl_delSubj2.DataValueField = "subjID"; ddl_delSubj2.DataBind(); ddl_newID.DataSource = dtSM; ddl_newID.DataTextField = "idgrp"; ddl_newID.DataValueField = "subjID"; ddl_newID.DataBind(); ddl_ChangeGroupID.DataSource = dtSM; ddl_ChangeGroupID.DataTextField = "idgrp"; ddl_ChangeGroupID.DataValueField = "subjID"; ddl_ChangeGroupID.DataBind(); lbl_DeleteSubjectDENIED.Visible = false; editSubjectPanel.Visible = true; } else { lbl_DeleteSubjectDENIED.Visible = true; editSubjectPanel.Visible = false; } UpdatePanel01.Update(); }
protected void DeleteRecord(object sender, EventArgs e) { SQL_utils sql = new SQL_utils("data"); List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("studymeasID", ddl_studymeasID.SelectedValue, "int")); ps.Add(sql.CreateParam("pk", ddl_IDdelete.SelectedValue, "int")); sql.NonQuery_from_ProcName("spDEF_DELETE_to_XML_RAW", ps); Populate_ID_DDLs(); btnReset.Visible = false; panelDelete.Visible = false; btnDelete.Visible = false; txtDelete.Text = ""; UpdatePanel01.Update(); }
protected void Populate_StudyMeas_New_DDL(int studymeasID) { SQL_utils sql = new SQL_utils("data"); List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("studymeasID", studymeasID.ToString(), "int")); DataTable dtSM = sql.DataTable_from_ProcName("spDEF__Potential_Movable_Studymeas", ps); sql.Close(); ddl_Studymeas_New.DataSource = dtSM; ddl_Studymeas_New.DataTextField = "studymeasname"; ddl_Studymeas_New.DataValueField = "studymeasID"; ddl_Studymeas_New.DataBind(); UpdatePanel01.Update(); }
protected void Populate_IDdelete_DDL(int studymeasID) { SQL_utils sql = new SQL_utils("data"); List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("studymeasID", ddl_studymeasID.SelectedValue, "int")); ps.Add(sql.CreateParam("clin", ddl_Clin.SelectedValue, "text")); ps.Add(sql.CreateParam("mode", "0,1,4", "text")); DataTable dtSM = sql.DataTable_from_ProcName("spID_and_Indexnum_by_smID", ps); sql.Close(); ddl_IDdelete.DataSource = dtSM; ddl_IDdelete.DataTextField = "IDindex"; ddl_IDdelete.DataValueField = "pk"; ddl_IDdelete.DataBind(); UpdatePanel01.Update(); }
protected void ResetForm(object sender, EventArgs e) { SQL_utils sql = new SQL_utils("data"); List <SqlParameter> ps = new List <SqlParameter>(); ps.Add(sql.CreateParam("studymeasID", ddl_studymeasID.SelectedValue, "int")); ps.Add(sql.CreateParam("pk", ddl_ID.SelectedValue, "int")); sql.NonQuery_from_ProcName("spDEF_RESET_Verified_to_0", ps); Populate_ID_DDLs(); btnReset.Visible = false; panelDelete.Visible = false; btnDelete.Visible = false; txtDelete.Text = ""; error_label.Text = ""; UpdatePanel01.Update(); }
protected void DeleteSubject(object sender, EventArgs e) { if (Convert.ToInt32(ddl_delSubj1.SelectedValue) == Convert.ToInt32(ddl_delSubj2.SelectedValue)) { int subjID = Convert.ToInt32(ddl_delSubj1.SelectedValue); SQL_utils sql = new SQL_utils("backend"); try{ var del1 = DxDbOps.BuildDeleteSqlCode("tblstudymeassubj", "backend", "subjID", subjID); sql.NonQuery_from_SQLstring("update uwautism_research_backend.dbo.tblstudymeassubj set actionid = null where subjid = " + subjID.ToString()); //tblSubject //tblaction //tblReliabilityTracking //tblSubjConsent //tblstudymeassubj var del2 = DxDbOps.BuildDeleteSqlCode("tblapptstaff", "backend", "actionID in (select actionID from tblaction where subjID = " + subjID.ToString() + ")"); var del3 = DxDbOps.BuildDeleteSqlCode("tblSubjConsentitem", "backend", "subjconsentid in (select subjconsentid from uwautism_research_backend.dbo.tblSubjConsent where subjid = " + subjID.ToString() + ")"); var del4 = DxDbOps.BuildDeleteSqlCode("tblSubjConsent", "backend", "subjID", subjID); var del5 = DxDbOps.BuildDeleteSqlCode("tblReliabilityTracking", "backend", "subjID", subjID); var del6 = DxDbOps.BuildDeleteSqlCode("tblaction", "backend", "subjID", subjID); var del7 = DxDbOps.BuildDeleteSqlCode("tblSubject", "backend", "subjID", subjID); error_label.Text = "Subject deleted."; btnDelete.Visible = false; } catch (SqlException exc) { error_label.Text = exc.Message; } //SQL_utils sql = new SQL_utils("backend"); //List<SqlParameter> ps = new List<SqlParameter>(); //ps.Add(sql.CreateParam("subjID", ddl_delSubj1.SelectedValue, "int")); //ps.Add(sql.CreateParam("code", "Confirm deletion of " + Convert.ToString(ddl_delSubj1.SelectedValue), "text")); //try //{ // sql.NonQuery_from_ProcName("spDeleteSubject_from_web", ps); //} //catch (SqlException exc) //{ // error_label.Text = exc.Message; //} sql.Close(); Populate_delSubj_ID_DDL(); btnReset.Visible = false; btnDelete.Visible = false; txtDelete.Text = ""; UpdatePanel01.Update(); } }