/// <summary> /// method /// loads the values from the data row into the grid view row controls /// </summary> /// <param name="gvr"></param> protected void LoadGridViewRowValues(GridViewRow gvr) { DataRowView drv = (DataRowView)gvr.DataItem; if (drv == null) { return; } DataRow dr = drv.Row; if (dr == null) { return; } Button btnStates = (Button)gvr.FindControl("btnStates"); CheckBox chkItemActive = (CheckBox)gvr.FindControl("chkItemActive"); TextBox txtTSTimePeriod = (TextBox)gvr.FindControl("txtTSTimePeriod"); DropDownList ddlUnit = (DropDownList)gvr.FindControl("ddlUnit"); TextBox txtSortOrder = (TextBox)gvr.FindControl("txtSortOrder"); Label lblItemLabel = (Label)gvr.FindControl("lblItemLabel"); CheckBoxList cblDSChangeable = (CheckBoxList)gvr.FindControl("cblDSChangeable"); if (btnStates == null || chkItemActive == null || txtTSTimePeriod == null || ddlUnit == null || txtSortOrder == null || lblItemLabel == null || cblDSChangeable == null) { return; } btnStates.Attributes.Add("ITEM_ID", dr["ITEM_ID"].ToString()); btnStates.Enabled = (Convert.ToInt32(dr["CHECKLIST_ID"]) < 1) ? false : true; chkItemActive.Checked = (Convert.ToInt64(dr["ACTIVE_ID"]) == (long)k_ACTIVE_ID.Active) ? true : false; txtTSTimePeriod.Text = dr["CLI_TS_TIME_PERIOD"].ToString(); ddlUnit.SelectedValue = dr["TIME_UNIT_ID"].ToString(); txtSortOrder.Text = dr["SORT_ORDER"].ToString(); lblItemLabel.Text = dr["ITEM_LABEL"].ToString(); DataRow[] draDSSelect = DSChangeable.Select("ITEM_ID = " + dr["ITEM_ID"].ToString()); CCheckBoxList cbl = new CCheckBoxList(); cbl.CheckSelected(cblDSChangeable, draDSSelect); }
/// <summary> /// US:1951 US:1945 method /// loads checklist data from the database into the checklist's controls /// </summary> /// <param name="lStatusCode"></param> /// <param name="strStatusComment"></param> /// <returns></returns> protected CStatus LoadChecklist() { CChecklistData cld = new CChecklistData(BaseMstr.BaseData); CChecklistDataItem clData = null; CStatus status = cld.GetCheckListDI(ChecklistID, out clData); if (!status.Status) { return(status); } ChecklistID = clData.ChecklistID; txtCLLabel.Text = clData.ChecklistLabel; txtCLNoteTitle.Text = clData.NoteTitleTag; if (txtCLNoteTitle.Text == "-1") { txtCLNoteTitle.Text = ""; } chkActive.Checked = (clData.ActiveID == k_ACTIVE_ID.Active) ? true : false; txtCLDesc.Text = clData.ChecklistDescription; try { ddlClinics.SelectedValue = Convert.ToString(clData.NoteTitleClinicID); } catch (Exception) { ddlClinics.SelectedIndex = -1; } try { ddlCLService.SelectedValue = Convert.ToString(clData.ServiceID); } catch (Exception) { ddlCLService.SelectedIndex = -1; } DataSet dsViewable = null; status = cld.GetCLViewableRolesDS(ChecklistID, out dsViewable); if (!status.Status) { return(status); } CCheckBoxList cbl = new CCheckBoxList(); cbl.CheckSelected(cblViewable, dsViewable); DataSet dsReadOnly = null; status = cld.GetCLReadOnlyRolesDS(ChecklistID, out dsReadOnly); if (!status.Status) { return(status); } cbl.CheckSelected(cblReadOnly, dsReadOnly); DataSet dsCloseable = null; status = cld.GetCLCloseableRolesDS(ChecklistID, out dsCloseable); if (!status.Status) { return(status); } cbl.CheckSelected(cblCloseable, dsCloseable); DataSet dsTIU = null; status = cld.GetCLTIURolesDS(ChecklistID, out dsTIU); if (!status.Status) { return(status); } cbl.CheckSelected(cblTIUNote, dsTIU); return(new CStatus()); }