protected override void Dispose(bool disposing) { if (!_disposed) { try { _buttonAdd.Dispose(); _buttonEdit.Dispose(); _buttonDelete.Dispose(); _buttonOK.Dispose(); _buttonCancel.Dispose(); _labelComment.Dispose(); _textBoxComment.Dispose(); _labelTags.Dispose(); _listView.Dispose(); _groupMetaData.Dispose(); _buttonPanel.Dispose(); _radioButtonNone.Dispose(); _radioButtonMetadata.Dispose(); _buttonCancel.Click -= new EventHandler(DoButtonCancelClick); _buttonOK.Click -= new EventHandler(DoButtonOKClick); _buttonAdd.Click -= new EventHandler(DoButtonAddClick); _buttonEdit.Click -= new EventHandler(DoButtonEditClick); _buttonDelete.Click -= new EventHandler(DoButtonDeleteClick); _radioButtonMetadata.Click -= new EventHandler(DoRadioButtonMetadataClick); _radioButtonNone.Click -= new EventHandler(DoRadioButtonNoneClick); } finally { _disposed = true; } } }
private void tobBuscarPaciente_Click(object sender, EventArgs e) { FrmBlackBackground oFrmBlackBackground = new FrmBlackBackground(); oFrmBlackBackground.Show(); RadioButton tempTipoCedula = new RadioButton(); frmPacientesExistentesBusquedaConsultas oFrmPacientesExistentes = new frmPacientesExistentesBusquedaConsultas(TxtNumExpediente, TxtNombre, txtApellidos, TxtCedula, pictureBox3, tempTipoCedula); oFrmPacientesExistentes.ShowDialog(); if (tempTipoCedula.Checked == true) { RdNacional.Checked = true; } else { RdExtranjero.Checked = true; } tempTipoCedula.Dispose(); pictureBox3.BackgroundImageLayout = ImageLayout.Stretch; oFrmBlackBackground.Close(); }
protected override void Dispose(bool disposing) { if (!(_nativeControl is null)) { _nativeControl.CheckedChange -= NativeControl_ValueChanged; } if (!(_nativeRadioButtonControl is null)) { _nativeRadioButtonControl.Dispose(); _nativeRadioButtonControl = null; } RemoveElementHandlers(); try { base.Dispose(disposing); _nativeControl = null; } catch (Exception) { return; } }
void ReleaseDesignerOutlets() { if (RadioButton != null) { RadioButton.Dispose(); RadioButton = null; } if (RadioContainer != null) { RadioContainer.Dispose(); RadioContainer = null; } if (WolfButton != null) { WolfButton.Dispose(); WolfButton = null; } if (WolfView != null) { WolfView.Dispose(); WolfView = null; } }
public void RadioButtonGroupGetItem() { tlog.Debug(tag, $"RadioButtonGroupGetItem START"); var testingTarget = new RadioButtonGroup(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <RadioButtonGroup>(testingTarget, "Should return RadioButtonGroup instance."); RadioButton button = new RadioButton(); testingTarget.Add(button); var result = testingTarget.GetItem(0); tlog.Debug(tag, "GetItem : " + result); button.IsSelected = true; tlog.Debug(tag, "GetSelectedItem : " + testingTarget.GetSelectedItem()); try { testingTarget.Remove(button); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } button.Dispose(); tlog.Debug(tag, $"RadioButtonGroupGetItem END (OK)"); }
public void RadioButtonItemGroup() { tlog.Debug(tag, $"RadioButtonItemGroup START"); var testingTarget = new RadioButton(); Assert.IsNotNull(testingTarget, "null handle"); Assert.IsInstanceOf <RadioButton>(testingTarget, "Should return RadioButton instance."); var group = new RadioButtonGroup(); group.Add(testingTarget); tlog.Debug(tag, "ItemGroup : " + testingTarget.ItemGroup); testingTarget.Dispose(); tlog.Debug(tag, $"RadioButtonItemGroup END (OK)"); }
public void InitializeChatbots(IChatbotManager chatbots) { if (chatbots == null) { throw new TeaArgumentNullException(nameof(chatbots)); } // Initialize Radio Buttons int x = 153; foreach (IChatbot chatbot in chatbots) { // Validate the chatbot if (string.IsNullOrEmpty(chatbot.Greeting)) { throw new TeaArgumentNullException(nameof(chatbot.Greeting)); } // Do UI RadioButton rb = null; try { rb = new RadioButton(); pnlChatbotSelector.Controls.Add(rb); rb.Text = chatbot.Name.ToUpper(CultureInfo.CurrentCulture); rb.Name = chatbot.Name; rb.CheckedChanged += RadChatbot_CheckedChanged; // Placement pnlChatbotSelector.Controls.Add(rb); rb.Location = new Point(x, radDefault.Location.Y); rb.AutoSize = true; x += rb.Width + 3; rb = null; } catch { rb.Dispose(); throw; } } }
void ReleaseDesignerOutlets() { if (HiddenButton != null) { HiddenButton.Dispose(); HiddenButton = null; } if (RadioButton != null) { RadioButton.Dispose(); RadioButton = null; } if (Titlee != null) { Titlee.Dispose(); Titlee = null; } }
/// <summary> /// Cleans up either unmanaged resources or managed and unmanaged resources. /// </summary> /// <remarks> /// <para> /// If disposing equals true, the method has been called directly or indirectly by a user's /// code. Managed and unmanaged resources can be disposed. /// </para> /// <para> /// If disposing equals false, the method has been called by the runtime from inside the /// finalizer and you should not reference other objects. Only unmanaged resources can /// be disposed. /// </para> /// </remarks> /// <param name="disposing">Was Dispose called manually?</param> protected override void Dispose(bool disposing) { if (!isDisposed) // Check To See If Dispose Has Already Been Called { if (disposing) // If disposing Equals true, Dispose All Managed And Unmanaged Resources { pictureBox.Dispose(); rad640.Dispose(); rad800.Dispose(); rad1024.Dispose(); rad1600.Dispose(); rad16bpp.Dispose(); rad24bpp.Dispose(); rad32bpp.Dispose(); grpResolution.Dispose(); grpColorDepth.Dispose(); chkFullscreen.Dispose(); chkStatusBar.Dispose(); btnOk.Dispose(); GC.SuppressFinalize(this); // Suppress Finalization } // Release Any Unmanaged Resources Here, If disposing Was false, Only The Following Code Is Executed pictureBox = null; rad640 = null; rad800 = null; rad1024 = null; rad1600 = null; rad16bpp = null; rad24bpp = null; rad32bpp = null; grpResolution = null; grpColorDepth = null; chkFullscreen = null; chkStatusBar = null; btnOk = null; base.Dispose(disposing); } isDisposed = true; // Mark As disposed }
/// <summary> /// Clears all the form's radiobuttons /// </summary> /// <returns></returns> public Results ClearRadioButtons() { try { List <Control> lst = FormControls.Where((x) => x.GetType() == typeof(RadioButton)).ToList(); lst.Aggregate((e1, e2) => { RadioButton chk = (RadioButton)e1; chk.Checked = false; chk = (RadioButton)e2; chk.Checked = false; chk.Dispose(); return(e2); }); return(Results.SUCCES); } catch (Exception ex) { return(Results.FAILURE); throw ex; } }
private void SaveSE() { { bool exit = false; string description = string.Empty; int _block = 0; int _fieldMI = 0; object[] valuesMI = new object[10]; int _fieldPM = 0; object[] valuesPM = new object[6]; int _fieldO = 0; int radioObjs = 0; string assessment = string.Empty; string _letter = string.Empty; CultureInfo ci = new CultureInfo("es-AR"); string separator = ci.NumberFormat.NumberDecimalSeparator; for (int i = 0; !exit; i++) { Control answer = (Control)this.Master.FindControl("CPH").FindControl("SE").FindControl("ctl" + i.ToString("00")); exit = answer == null; if (!exit) { try { if (answer.GetType().ToString() == "System.Web.UI.WebControls.TextBox") { TextBox myControl = (TextBox)answer; //Tareas if (myControl.Attributes["class"] != "tM" && myControl.Attributes["class"] != "tMp" && myControl.Attributes["class"] != "tMo") { if (!myControl.ReadOnly) { valuesMI[_fieldMI] = myControl.Text; _fieldMI++; if (_fieldMI == 10) { new clsDAO().SqlExec("DELETE FROM ResultVariableSelfEvaluation WHERE NetworkAssessmentId = " + _params[3].ToString()); for (int mi = 0; mi < valuesMI.Length; mi++) { SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "SaveResultVariableSelfEvaluation", new object[] { _params[3].ToString(), valuesMI[mi] }); } Array.Clear(valuesMI, 0, valuesMI.Length); _fieldMI = 0; } } myControl.Dispose(); } //Comentario if (myControl.Attributes["class"] == "tM") { string[] values = myControl.SkinID.Split('_'); if (!myControl.ReadOnly) { SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultCommentSelfEvaluation]", new object[] { _params[3].ToString(), myControl.Text }); } myControl.Dispose(); } //Agenda de desarrollo if (myControl.Attributes["class"] == "tMp") { if (!myControl.ReadOnly) { valuesPM[_fieldPM] = myControl.Text; _fieldPM++; if (_fieldPM == 5) { SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultImprovementPlanSelfEvaluation]", new object[] { Convert.ToInt16(myControl.SkinID.ToString()), 3, valuesPM[0], valuesPM[1], valuesPM[2], valuesPM[3], valuesPM[4], valuesPM[5] }); Array.Clear(valuesPM, 0, valuesPM.Length); _fieldPM = 0; } } myControl.Dispose(); } //Objetivos if (myControl.Attributes["class"] == "tMo") { if (!myControl.ReadOnly) { _fieldO++; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultObjetives]", new object[] { _params[3].ToString(), _fieldO, myControl.Text }); } myControl.Dispose(); } } } catch (Exception ex) { } try { if (answer.GetType().ToString() == "System.Web.UI.WebControls.DropDownList") { DropDownList myControl = (DropDownList)answer; if (myControl.Attributes["class"] == "tMpc") { if (myControl.Enabled) { valuesPM[_fieldPM] = myControl.SelectedValue; _fieldPM++; } myControl.Dispose(); } else { _fieldO++; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultObjetives]", new object[] { _params[3].ToString(), _fieldO, myControl.SelectedValue }); } } } catch (Exception ex) { } try { //Competencias if (answer.GetType().ToString() == "System.Web.UI.WebControls.RadioButton") { RadioButton myControl = (RadioButton)answer; if (myControl.Attributes["class"] != "tMom") { string[] values = myControl.SkinID.ToUpper().Split('_'); if (myControl.Checked) { if (values.Length != 1) { _block = (Convert.ToInt16(values[1]) <= 5) ? 2 : 3; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "SaveResultCompetencySelfEvaluation", new object[] { values[0], _block, values[1], values[2], values[3], true }); } } } else { if (myControl.Checked) { _fieldO++; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultObjetives]", new object[] { _params[3].ToString(), _fieldO, myControl.Text }); } else { radioObjs++; } if (radioObjs == 3) { _fieldO++; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultObjetives]", new object[] { _params[3].ToString(), _fieldO, "" }); } } myControl.Dispose(); } } catch (Exception ex) { } answer.Dispose(); } } } }
/// <summary> /// Clears all runtime controls from the symbol properties tab page. /// </summary> private void RemoveRunTimeControls() { int numberOfControls; if (symbolPropertiesTabPage != null) { numberOfControls = symbolPropertiesTabPage.Controls.Count; if (numberOfControls > 0) { // Before removing the controls it is necessary to remove any event handlers created. for (int i = numberOfControls - 1; i >= 0; i--) { if (symbolPropertiesTabPage.Controls[i].Name == "dmSizesComboBox") { dmSizesComboBox.SelectedIndexChanged -= new System.EventHandler(dmSizesComboBox_SelectedIndexChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "squareOnlyCheckBox") { squareOnlyCheckBox.Click -= new System.EventHandler(squareOnlyCheckBox_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "dmreCheckBox") { dmreCheckBox.Click -= new System.EventHandler(dmreCheckBox_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "maxicodeModeComboBox") { maxicodeModeComboBox.SelectedIndexChanged -= new System.EventHandler(maxicodeModeComboBox_SelectedIndexChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "showCheckDigitCheckBox") { showCheckDigitCheckBox.Click -= new System.EventHandler(showCheckDigitCheckBox_CheckedChange); } if (symbolPropertiesTabPage.Controls[i].Name == "useCheckDigitCheckBox") { optionalCheckDigitCheckBox.Click -= new System.EventHandler(optionalCheckDigitCheckBox_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "modeGroupBox") { hibcRadioButton.CheckedChanged -= new System.EventHandler(hibcRadioButton_CheckedChanged); hibcRadioButton.Dispose(); gs1RadioButton.CheckedChanged -= new System.EventHandler(gs1RadioButton_CheckedChanged); gs1RadioButton.Dispose(); standardRadioButton.CheckedChanged -= new System.EventHandler(standardRadioButton_CheckedChanged); standardRadioButton.Dispose(); } if (symbolPropertiesTabPage.Controls[i].Name == "compositeGroupBox") { ccaRadioButton.CheckedChanged -= new System.EventHandler(ccaRadioButton_CheckedChanged); ccaRadioButton.Dispose(); ccbRadioButton.CheckedChanged -= new System.EventHandler(ccbRadioButton_CheckedChanged); ccbRadioButton.Dispose(); cccRadioButton.CheckedChanged -= new System.EventHandler(cccRadioButton_CheckedChanged); cccRadioButton.Dispose(); } if (symbolPropertiesTabPage.Controls[i].Name == "bearerStyleGroupBox") { noneRadioButton.CheckedChanged -= new System.EventHandler(noneRadioButton_CheckedChanged); noneRadioButton.Dispose(); horizonalRadioButton.CheckedChanged -= new System.EventHandler(horizonalRadioButton_CheckedChanged); horizonalRadioButton.Dispose(); rectangleRadioButton.CheckedChanged -= new System.EventHandler(rectangleRadioButton_CheckedChanged); rectangleRadioButton.Dispose(); } if (symbolPropertiesTabPage.Controls[i].Name == "columnsComboBox") { columnsComboBox.SelectedIndexChanged -= new System.EventHandler(this.columnsComboBox_SelectedIndexChanged); } /*if (symbolPropertiesTabPage.Controls[i].Name == "dataColumnsComboBox") * { * columnsComboBox.SelectedIndexChanged -= new System.EventHandler(this.columnsComboBox_SelectedIndexChanged); * columnsComboBox.Dispose(); * }*/ if (symbolPropertiesTabPage.Controls[i].Name == "errorCorrectionComboBox") { pdfErrorLevelComboBox.SelectedIndexChanged -= new System.EventHandler(this.pdfErrorLevelComboBox_SelectedIndexChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "pdfRowHeightComboBox") { pdfRowHeightComboBox.SelectedIndexChanged -= new System.EventHandler(this.pdfRowHeightComboBox_SelectedIndexChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "autoSize2DRadioButton") { autoSize2DRadioButton.CheckedChanged -= new System.EventHandler(this.Auto2DRadioButton_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "sizes2DRadioButton") { autoSize2DRadioButton.CheckedChanged -= new System.EventHandler(this.Sizes2DRadioButton_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "errorCorrection2DRadioButton") { autoSize2DRadioButton.CheckedChanged -= new System.EventHandler(this.Errorcorrection2DRadioButton_CheckedChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "sizes2DComboBox") { sizes2DComboBox.SelectedIndexChanged -= new System.EventHandler(this.Sizes2DComboBox_SelectedIndexChanged); } if (symbolPropertiesTabPage.Controls[i].Name == "errorCorrection2DComboBox") { errorCorrection2DComboBox.SelectedIndexChanged += new System.EventHandler(this.ErrorCorrection2DComboBox_SelectedIndexChanged); } symbolPropertiesTabPage.Controls[i].Dispose(); } symbolPropertiesTabPage.Controls.Clear(); } // Finally remove the tab page. this.tabControl1.Controls.Remove(symbolPropertiesTabPage); symbolPropertiesTabPage = null; } }
private void SaveCFF() { bool exit = false; string description = string.Empty; int _block = 0; string assessment = string.Empty; string _letter = string.Empty; CultureInfo ci = new CultureInfo("es-AR"); string separator = ci.NumberFormat.NumberDecimalSeparator; string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name); string[] _params = new string[] { }; _params = Encryption.Decrypt(Request.Params["."]).Split('.'); int groupId = Convert.ToInt16(_params[0]); int profile = Convert.ToInt16(_params[1]); if (profile > 1) { username = _params[2]; } for (int i = 0; !exit; i++) { Control answer = (Control)this.Master.FindControl("CPH").FindControl("CFF").FindControl("ctl" + i.ToString("00")); exit = answer == null; if (!exit) { if (answer.GetType().ToString() == "System.Web.UI.WebControls.TextBox") { TextBox myControl = (TextBox)answer; string[] values = myControl.SkinID.Split('_'); if (!myControl.ReadOnly) { // ********* 1 linea modificada del original //SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultComment]", new object[] { values[0], 5, myControl.Text, values[1] }); SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SaveResultComment]", new object[] { values[0], 5, myControl.Text, values[1], "0" }); } myControl.Dispose(); } if (answer.GetType().ToString() == "System.Web.UI.WebControls.RadioButton") { RadioButton myControl = (RadioButton)answer; string[] values = myControl.SkinID.ToUpper().Split('_'); if (myControl.Checked) { // ************ 9 linea agregada al original if (values.Length != 1) { _block = (Convert.ToInt16(values[1]) <= 5) ? 2 : 3; SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "SaveResultCompetency", new object[] { values[0], _block, values[1], values[2], values[3], true }); } } myControl.Dispose(); } answer.Dispose(); } } SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "SaveOverallResult", new object[] { username, groupId }); }
public void Build(object[][] d, Table tblL, Table tblR) { int color = 0; string _style = string.Empty; TableRow tblRow = new TableRow(); TableCell tblCell = new TableCell(); //---------------------------- //Competencia tblCell.Text = d[0][2].ToString().Trim(); if (d[0].Length - 4 > 10) { tblCell.Width = cellWidth; } else { tblCell.Width = Unit.Percentage(50); } tblCell.Attributes.Add("class", "td08"); //tblCell.Attributes.Add("nowrap", "true"); tblRow.Cells.Add(tblCell); TableRow tblRowR = new TableRow(); for (int c = 4; c < d[0].Length; c++) { TableCell tblCell0 = new TableCell(); tblCell0.Text = fields[c].ToString(); tblCell0.ToolTip = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(fieldsValues[c].ToString().Split('_')[3].ToLower()); tblCell0.Attributes.Add("class", "td04"); tblRowR.Cells.Add(tblCell0); tblCell0.Dispose(); } tblR.Rows.Add(tblRowR); tblRowR.Dispose(); for (int i = 0; i < d.Length; i++) { TableRow tblRow0 = new TableRow(); TableCell tblCell1 = new TableCell(); tblCell1.Text = d[i][3].ToString().Trim(); if (d[0].Length - 4 > 10) { tblCell1.Width = cellWidth; } else { tblCell1.Width = Unit.Percentage(50); } tblCell1.Attributes.Add("class", "td02_"); tblRow0.Cells.Add(tblCell1); tblCell1.Dispose(); tblL.Rows.Add(tblRow0); tblRow0.Dispose(); TableRow tblRowR0 = new TableRow(); for (int c = 4; c < d[i].Length; c++) { TableCell tblCell0 = new TableCell(); tblCell0.Attributes.Add("class", "td05"); RadioButton radio = new RadioButton(); radio.EnableViewState = false; radio.GroupName = c.ToString() + numBlock.ToString(); radio.SkinID = fieldsValues[c].ToString().Split('_')[1].ToString().ToLower() + "_" + d[i][0].ToString().Trim() + "_" + d[i][1].ToString() + "_" + (i + 1).ToString() + "_" + d[i][4].ToString(); radio.Checked = (d[i][c].ToString() != "0") ? true : false; if (radio.Checked) { color++; } radio.Enabled = radio.Checked || (fieldsValues[c].ToString().Split('_')[2].ToLower() == "t"); tblCell0.Controls.Add(radio); radio.Dispose(); tblRowR0.Cells.Add(tblCell0); tblCell0.Dispose(); } tblR.Rows.Add(tblRowR0); tblRowR0.Dispose(); } TableRow tblRowColor = new TableRow(); TableCell tblCellColorL = new TableCell(); tblCellColorL.ID = "C" + numBlock.ToString(); if (color == fields.Count - 4) { _style = "g"; } else if (color == 0) { _style = "r"; } else { _style = "y"; } if (color == fields.Count - 4) { tblR.Attributes["onclick"] = "c(this,false)"; } else { tblR.Attributes["onclick"] = "c(this,true)"; } tblL.Rows.AddAt(0, tblRow); tblRow.Dispose(); tblCellColorL.Attributes.Add("class", _style); tblRowColor.Cells.Add(tblCellColorL); tblL.Rows.Add(tblRowColor); tblCellColorL.Dispose(); tblRowColor.Dispose(); tblL.Dispose(); tblR.Dispose(); }
private void LoadCompetencies() { string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name); string oldGroup = string.Empty; string group = string.Empty; object[][] details = new object[5][]; int i = 0; _params = Encryption.Decrypt(Request.Params["."]).Split('.'); int groupId = Convert.ToInt16(_params[0]); int profile = Convert.ToInt16(_params[1]); if (profile != 0) { if (profile > 1) { username = _params[2]; } string filtro = "%"; if (_params.Length > 3) { filtro = SQLHelper.ExecuteDataset(Cache["ApplicationDatabase"].ToString(), "GetEvaluatedByEvaluated", new object[] { _params[3] }).Tables[0].Rows[0].ItemArray[0].ToString(); } SqlDataReader myReader = SQLHelper.ExecuteReader(Cache["ApplicationDatabase"].ToString(), "[GetCompetencies]", new object[] { groupId, username, profile, filtro }); bool existone = false; for (int f = 0; f < myReader.FieldCount; f++) { fields.Add(System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(myReader.GetName(f).Split('_')[0].ToString().Replace('[', ' ').Replace(']', ' ').Trim().ToLower())); fieldsValues.Add(myReader.GetName(f).ToString()); if (f >= 4 && !existone) { if (fieldsValues[f].ToString().Split('_')[2].ToLower() == "t") { setColor = true; existone = true; } } } // ********************** 7 linea modificada original int indicegrupo = 0; while (myReader.Read()) { group = myReader.GetValue(0).ToString(); if (group != string.Empty && oldGroup != string.Empty && group != oldGroup) { numBlock++; AddCompetency(details); Array.Clear(details, 0, details.Length); i = 0; } object[] values = new object[myReader.FieldCount]; int fieldcount = myReader.GetValues(values); details[i] = values; i++; oldGroup = group; } numBlock++; AddCompetency(details); AddCommentBlock("Comentarios"); myReader.NextResult(); //Comments string[] labels = new string[] { "Evaluador", "Concurrente", "Doble Reporte", "Jefe RRHH" }; bool _enable = false; bool _visible = false; while (myReader.Read()) { AddSeparator(); Label lbl = new Label(); lbl.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(myReader.GetValue(1).ToString().Trim().ToLower()); lbl.Attributes.Add("class", "titulo"); lbl.Height = 20; this.Controls.Add(lbl); lbl.Dispose(); Panel pnlContainer = new Panel(); pnlContainer.Attributes.Add("class", "tab-pane"); Literal L = new Literal(); //L.Text = "<div style = 'position:absolute; left:655px; top:7px;z-index:1000;'><a href='#t' class='link'>Ir a Competencias</a></div>"; // ******************** 10 linea modificada del original L.Text = "<div style = 'position:absolute; left:655px; top:-20px;z-index:1000;'><a href='#t' class='link'>Ir a Competencias</a></div>"; pnlContainer.Controls.Add(L); L.Dispose(); int _tabs = 1; // 1 = siempre // 2 = > 3,4,5,6,7,8 // 3 = > 6 // 1 Pendiente // 2 Iniciada // 3 Pendiente en Concurrente // 4 Aprobada por Concurrente // 5 Rechazada por Concurrente // 6 Pendiente en Doble Reporte // 7 Aprobada por Doble Reporte // 8 Rechazada por Doble Reporte // 9 Pendiente en RRHH // 10 Aprobada por RRHH // 11 Rechazada por RRHH // 12 Cerrada int _status = Convert.ToInt16(myReader[5]); switch (profile) { case 1: if (_status == 4 && !Convert.ToBoolean(myReader[6])) { _tabs = 2; if (_status == 11) { _tabs = 4; } } if (_status == 5 && !Convert.ToBoolean(myReader[6])) { _tabs = 2; if (_status == 11) { _tabs = 4; } } else if (_status == 11) { _tabs = 4; } else if (_status == 12) { _tabs = 4; } else if (_status == 6 && Convert.ToBoolean(myReader[6])) { _tabs = 2; } else if (_status >= 7 && Convert.ToBoolean(myReader[6])) { _tabs = 3; } else if (_status == 9) { _tabs = 2; } if (_status == 10) { _tabs = 4; } break; // ******************* 8 lineas agregadas al original case 5: _tabs = 4; break; default: _tabs = profile; break; } for (int c = 0; c < _tabs; c++) { Panel pnlPage = new Panel(); Literal H = new Literal(); pnlPage.Attributes.Add("class", "tab-page"); H.Text = "<h2 class='tab'>" + labels[c] + "</h2>"; pnlPage.Controls.Add(H); TextBox txtA = new TextBox(); txtA.Rows = 3; txtA.TextMode = TextBoxMode.MultiLine; //txtA.Text = myReader.GetValue( c + 2 ).ToString( ); // ************* 7 linea modificada del original switch (c) { case 0: //if( myReader.GetValue( 7 ).ToString( ) == "A" && indicegrupo == 1 ) // txtA.Text = myReader.GetValue( c + 2 ).ToString( ); //if( indicegrupo == 0 ) txtA.Text = myReader.GetValue(c + 2).ToString(); break; case 1: if (myReader.GetValue(7).ToString() == "A") { txtA.Text = myReader.GetValue(c + 2).ToString(); } if (indicegrupo == 0) { txtA.Text = myReader.GetValue(c + 2).ToString(); } if (txtA.Text == string.Empty) { txtA.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; case 2: if (myReader.GetValue(8).ToString() == "A") { txtA.Text = myReader.GetValue(c + 2).ToString(); } if (indicegrupo == 0) { txtA.Text = myReader.GetValue(c + 2).ToString(); } if (txtA.Text == string.Empty) { txtA.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; case 3: if (myReader.GetValue(10).ToString() == "A") { txtA.Text = myReader.GetValue(c + 6).ToString(); } else { txtA.Text = string.Empty; } if (txtA.Text == string.Empty) { txtA.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; } txtA.Attributes["class"] = "tM"; txtA.Attributes["onBlur"] = "o(this)"; txtA.Attributes["onFocus"] = "_i(this)"; txtA.Attributes["onkeyup"] = "kIP(this)"; txtA.SkinID = myReader.GetValue(0).ToString() + "_" + c.ToString(); HttpResponse myHttpReponse = Response; HtmlTextWriter myHtmlTextWriter = new HtmlTextWriter(myHttpReponse.Output); txtA.Attributes.AddAttributes(myHtmlTextWriter); RadioButton radioA = new RadioButton(); radioA.Text = "Aprobar"; //radioA.GroupName = "AR"; // **************** 7 linea modificada original radioA.GroupName = "AR" + indicegrupo.ToString(); radioA.Attributes["onClick"] = "_a(this)"; // *************** agregado del original switch (c) { case 0: if (myReader.GetValue(7).ToString() == "A") { radioA.Checked = true; } break; case 1: if (myReader.GetValue(7).ToString() == "A") { radioA.Checked = true; } break; case 2: if (myReader.GetValue(8).ToString() == "A") { radioA.Checked = true; } break; case 3: if (myReader.GetValue(10).ToString() == "A") { radioA.Checked = true; } break; } RadioButton radioR = new RadioButton(); radioR.Text = "Rechazar"; //radioR.GroupName = "AR"; // **************** 7 linea modificada original radioR.GroupName = "AR" + indicegrupo.ToString(); radioR.Attributes["onClick"] = "_r(this)"; // *************** agregado del original switch (c) { case 0: if (myReader.GetValue(7).ToString() == "R") { radioR.Checked = true; } break; case 1: if (myReader.GetValue(7).ToString() == "R") { radioR.Checked = true; } break; case 2: if (myReader.GetValue(8).ToString() == "R") { radioR.Checked = true; } break; case 3: if (myReader.GetValue(10).ToString() == "R") { radioR.Checked = true; } break; } TextBox txtR = new TextBox(); // 3 Pendiente en Concurrente // 4 Aprobada por Concurrente // 5 Rechazada por Concurrente // 6 Pendiente en Doble Reporte // 7 Aprobada por Doble Reporte // 8 Rechazada por Doble Reporte // 9 Pendiente en RRHH // 10 Aprobada por RRHH // 11 Rechazada por RRHH // 12 Cerrada switch (profile) { case 1: switch (c) { case 0: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; break; case 1: switch (_status) { case 5: radioA.Visible = false; txtA.Visible = false; radioR.Visible = true; txtR.Visible = true; break; case 6: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 8: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 9: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 10: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 11: radioA.Visible = false; txtA.Visible = true; txtR.Visible = false; radioR.Visible = false; break; case 12: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; } break; case 2: switch (_status) { case 5: radioA.Visible = false; txtA.Visible = false; radioR.Visible = false; txtR.Visible = true; break; case 8: radioA.Visible = false; txtA.Visible = false; radioR.Visible = false; txtR.Visible = true; break; case 9: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 10: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 11: radioA.Visible = false; txtA.Visible = true; txtR.Visible = false; radioR.Visible = false; break; case 12: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; } break; case 3: switch (_status) { case 5: radioA.Visible = false; txtA.Visible = false; radioR.Visible = false; txtR.Visible = true; break; case 8: radioA.Visible = false; txtA.Visible = false; radioR.Visible = false; txtR.Visible = true; break; case 9: radioA.Visible = true; txtA.Visible = true; radioR.Visible = true; txtR.Visible = true; break; case 10: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; case 11: radioA.Visible = false; txtA.Visible = false; txtR.Visible = true; radioR.Visible = false; break; case 12: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtR.Visible = false; break; } break; } txtA.ReadOnly = !(("1.2.5.8.11".IndexOf(_status.ToString()) >= 0) && (c == 0)); txtR.ReadOnly = !(("1.2.5.8.11".IndexOf(_status.ToString()) >= 0) && (c == 0)); break; case 2: // *************** 6 modificado del original //radioA.Visible = (c >= 1); //txtA.ReadOnly = ((_status == 3) && (c == 1)); //radioR.Visible = (c >= 1); //txtR.ReadOnly = ((_status == 3) && (c == 1)); //break; radioA.Visible = (c >= 1); txtA.ReadOnly = (c == 0); // || ( c != 0 && txtA.Text == string.Empty ); radioR.Visible = (c >= 1); txtR.ReadOnly = (c == 0); // || ( c != 0 && txtR.Text == string.Empty ); break; case 3: _visible = (c >= 1); _enable = (_status == 6) && (c == 2); switch (c) { case 0: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; txtA.ReadOnly = true; txtR.ReadOnly = true; break; case 1: radioA.Visible = !("8.9.6".IndexOf(_status.ToString()) >= 0); txtA.Visible = !("8.11".IndexOf(_status.ToString()) >= 0); radioR.Visible = !("8.9.6".IndexOf(_status.ToString()) >= 0); txtR.Visible = ("8.11".IndexOf(_status.ToString()) >= 0); txtA.ReadOnly = true; txtR.ReadOnly = true; break; case 2: radioA.Visible = !("8.9.11".IndexOf(_status.ToString()) >= 0); txtA.Visible = !("8.9".IndexOf(_status.ToString()) >= 0); radioR.Visible = !("8.9.11".IndexOf(_status.ToString()) >= 0); txtR.Visible = ("8.9.6".IndexOf(_status.ToString()) >= 0); txtA.ReadOnly = false; txtR.ReadOnly = false; break; case 3: radioA.Visible = true; radioR.Visible = true; break; } //radioA.Enabled = ( c == 3 ); //txtA.ReadOnly = ( c < 3 ) || ( c != 0 && c != 3 && txtA.Text == string.Empty ); //radioR.Enabled = ( c == 3 ); //txtR.ReadOnly = ( c < 3 ) || ( c != 0 && c != 3 && txtR.Text == string.Empty ); break; // *************** 11 lineas agregadas al original case 5: switch (c) { case 0: radioA.Visible = false; txtA.Visible = true; radioR.Visible = false; break; case 1: radioA.Visible = !("8.9".IndexOf(_status.ToString()) >= 0); txtA.Visible = !("8.11".IndexOf(_status.ToString()) >= 0); radioR.Visible = !("8.9".IndexOf(_status.ToString()) >= 0); txtR.Visible = ("8.11".IndexOf(_status.ToString()) >= 0); break; case 2: radioA.Visible = !("8.9.11".IndexOf(_status.ToString()) >= 0); txtA.Visible = !("8".IndexOf(_status.ToString()) >= 0); radioR.Visible = !("8.9.11".IndexOf(_status.ToString()) >= 0); txtR.Visible = ("8".IndexOf(_status.ToString()) >= 0); break; case 3: radioA.Visible = true; radioR.Visible = true; break; } //radioA.Enabled = ( c == 3 ); txtA.ReadOnly = (c < 3) || (c != 0 && c != 3 && txtA.Text == string.Empty); //radioR.Enabled = ( c == 3 ); txtR.ReadOnly = (c < 3) || (c != 0 && c != 3 && txtR.Text == string.Empty); break; default: _visible = true; _enable = false; break; } //tab 1 //txtA.ReadOnly = (!radioA.Checked || txtA.ReadOnly); pnlPage.Controls.Add(radioA); pnlPage.Controls.Add(txtA); pnlPage.Controls.Add(new LiteralControl("<br />")); if (c >= 1) { txtR.Rows = 3; txtR.TextMode = TextBoxMode.MultiLine; //txtR.Text = myReader.GetValue(c + 2).ToString(); // ******************* agregado del original switch (c) { case 0: if (myReader.GetValue(7).ToString() == "R") { txtR.Text = myReader.GetValue(c + 2).ToString(); } else { txtR.Text = string.Empty; } if (txtR.Text == string.Empty) { txtR.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; case 1: if (myReader.GetValue(7).ToString() == "R") { txtR.Text = myReader.GetValue(c + 2).ToString(); } else { txtR.Text = string.Empty; } if (txtR.Text == string.Empty) { txtR.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; case 2: if (myReader.GetValue(8).ToString() == "R") { txtR.Text = myReader.GetValue(c + 2).ToString(); } else { txtR.Text = string.Empty; } if (txtR.Text == string.Empty) { txtR.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; case 3: if (myReader.GetValue(10).ToString() == "R") { txtR.Text = myReader.GetValue(c + 6).ToString(); } else { txtR.Text = string.Empty; } if (txtR.Text == string.Empty) { txtR.Text = "En caso de elegir esta opción no olvide que es obligatorio completar el comentario ..........."; } break; } txtR.Attributes["class"] = "tM"; txtR.Attributes["onBlur"] = "o(this)"; txtR.Attributes["onFocus"] = "_i(this)"; txtR.Attributes["onkeyup"] = "kIP(this)"; txtR.SkinID = myReader.GetValue(0).ToString() + "_" + c.ToString(); HttpResponse myHttpReponseR = Response; HtmlTextWriter myHtmlTextWriterR = new HtmlTextWriter(myHttpReponseR.Output); txtR.Attributes.AddAttributes(myHtmlTextWriterR); //txtR.ReadOnly = (!radioR.Checked || txtR.ReadOnly); pnlPage.Controls.Add(radioR); pnlPage.Controls.Add(txtR); } pnlContainer.Controls.Add(pnlPage); if (c >= 1) { if (!radioA.Checked && !radioR.Checked) { radioA.Checked = true; } if (!radioA.Checked) { txtA.Attributes.Add("readonly", "readonly"); } if (!radioR.Checked) { txtR.Attributes.Add("readonly", "readonly"); } } txtA.Dispose(); txtR.Dispose(); radioA.Dispose(); radioR.Dispose(); H.Dispose(); pnlPage.Dispose(); pnlContainer.Dispose(); // ************* 7 linea agregada al original indicegrupo++; } this.Controls.Add(pnlContainer); } myReader.Close(); } }