protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { NB_save.Text = "Recordá ir grabando la evaluación a medida que la vas cargando."; } _params = Encryption.Decrypt(Request.Params["."]).Split('.'); int profile = Convert.ToInt16(_params[1]); pId.Value = profile.ToString(); SetButtonSend(); SetButtons(profile); DataTable dt = new DataTable(); dt = new clsDAO().SqlCall("SELECT TOP 1 BlockId FROM ResultCommentSelfEvaluation WHERE NetworkAssessmentId = " + _params[3] + " AND BlockId = 1"); if (dt.Rows.Count > 0) { btnSave.Visible = false; btnSendSelf.Visible = false; btnPrint.Visible = true; } else { btnSave.Visible = true; btnSendSelf.Visible = true; btnPrint.Visible = false; } }
// ******************* 3 linea modificada del original private void SetStatus(int current_profile) { // **************** 2 linea modificada del original //string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name); //SQLHelper.ExecuteNonQuery(Cache["ApplicationDatabase"].ToString(), "[SetAssessmentsSatus]", new object[] { null, Convert.ToInt16(_params[0]), username, _status }); string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name); //SqlDataReader myReader = SQLHelper.ExecuteReader( Cache["ApplicationDatabase"].ToString( ) , "GetEvaluatedPeople" , new object[] { _params[2] } ); //myReader.Read( ); bool exit = false; string description = string.Empty; string assessment = string.Empty; string _letter = string.Empty; CultureInfo ci = new CultureInfo("es-AR"); string separator = ci.NumberFormat.NumberDecimalSeparator; _params = Encryption.Decrypt(Request.Params["."]).Split('.'); int groupId = Convert.ToInt16(_params[0]); int profile = Convert.ToInt16(_params[1]); t2c.Value = "0"; Save(); DataTable dt = new DataTable(); dt = new clsDAO().SqlCall("GetSelfEvaluationCompletion " + _params[3]); if (dt == null || dt.Rows.Count == 0 || !dt.Rows[0][0].ToString().Equals("0")) { ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "key", "SetSelfError(1);", true); } else { new clsDAO().SqlCall("SendSelfEvaluation " + _params[3]); ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "key", "SetSelfError(0);", true); } }
public void Build() { string username = UserHelper.GetUserId(Request.LogonUserIdentity.Name); string group = string.Empty; string name = string.Empty; bool pendings = false; SqlDataReader myReader = SQLHelper.ExecuteReader(Cache["ApplicationDatabase"].ToString(), "GetEvaluatedPeople", new object[] { username }); #region SelfEvaluation DataTable dt = new DataTable(); clsDAO objDAO = new clsDAO(); dt = objDAO.SqlCall("GetSelfEvaluationAllowance '" + username + "'"); if (dt.Rows.Count > 0) { TblSelfEvaluation.Visible = true; TableRow tblRowGroup = new TableRow(); TableCell tblCellGroup = new TableCell(); TableCell tblCellButton = new TableCell(); Button button = new Button(); button.Text = "Autoevaluación"; button.Attributes.Add("class", "btn"); button.PostBackUrl = Server.HtmlEncode("~/EvaluationFormSelf.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(dt.Rows[0][2].ToString() + ".0.0." + dt.Rows[0][0].ToString()))); tblCellGroup.Text = dt.Rows[0][1].ToString(); tblCellGroup.ColumnSpan = 4; tblCellGroup.Attributes.Add("class", "td06"); tblRowGroup.Cells.Add(tblCellGroup); tblRowGroup.Cells.Add(tblCellButton); tblCellButton.Controls.Add(button); tblCellButton.Attributes.Add("class", "td06"); tblCellButton.ColumnSpan = 2; TblSelfEvaluation.Rows.Add(tblRowGroup); tblCellGroup.Dispose(); tblCellButton.Dispose(); tblRowGroup.Dispose(); button.Dispose(); } #endregion #region Evaluator int c = 0; Tbl1.Visible = (myReader.HasRows); while (myReader.Read()) { pendings = true; if (group != myReader.GetValue(0).ToString()) { TableRow tblRowGroup = new TableRow(); TableCell tblCellGroup = new TableCell(); TableCell tblCellButton = new TableCell(); Button button = new Button(); bool _status = ("1,2,5,8,11".IndexOf(myReader[8].ToString(), 0) >= 0); DataSet myReaderEnabled = SQLHelper.ExecuteDataset(Cache["ApplicationDatabase"].ToString(), "GetAssessmentAccesibility", new object[] { username }); if (myReaderEnabled.Tables[0].Rows[0].ItemArray[0].ToString() == "1" || myReaderEnabled.Tables[0].Rows[0].ItemArray[0].ToString() == "5") { button.Visible = true; } else { button.Visible = false; } button.Text = (_status) ? "Evaluar" : "Visualizar"; button.ToolTip = ((_status) ? "Evalua" : "Visualiza") + " las personas del " + myReader.GetValue(0).ToString(); button.Attributes.Add("class", "btn"); button.PostBackUrl = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(6).ToString() + ".1." + myReader[8].ToString()))); tblCellGroup.Text = myReader.GetValue(0).ToString(); tblCellGroup.ColumnSpan = 4; tblCellGroup.Attributes.Add("class", "td06"); tblRowGroup.Cells.Add(tblCellGroup); tblRowGroup.Cells.Add(tblCellButton); tblCellButton.Controls.Add(button); tblCellButton.Attributes.Add("class", "td06"); tblCellButton.ColumnSpan = 2; Tbl1.Rows.Add(tblRowGroup); tblCellGroup.Dispose(); tblCellButton.Dispose(); tblRowGroup.Dispose(); button.Dispose(); } TableRow tblRow = new TableRow(); TableCell tblCellImg = new TableCell(); ImageButton img = new ImageButton(); //if (((decimal)myReader[7] != 10)) //{ img.ID = c.ToString(); img.ImageUrl = "~/App_Images/search.jpg"; img.ToolTip = "Ver solo esta evaluación"; c++; img.PostBackUrl = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader[6].ToString() + ".1." + myReader[7].ToString() + "." + myReader[9].ToString()))); tblCellImg.Width = 16; tblCellImg.Attributes.Add("class", "td02"); tblCellImg.Controls.Add(img); img.Dispose(); if ((decimal)myReader[7] == 10 || (decimal)myReader[7] == 12) { img = new ImageButton(); img.ID = c.ToString(); c++; img.ImageUrl = "~/App_Images/imp.gif"; img.OnClientClick = "p(" + myReader[9].ToString() + ")"; img.ToolTip = "Imprimir Evaluación"; tblCellImg.Controls.Add(img); img.Dispose(); tblCellImg.Width = 38; } tblRow.Cells.Add(tblCellImg); tblCellImg.Dispose(); //} //else //{ // img.ID = c.ToString(); // img.ImageUrl = "~/App_Images/imp.gif"; // img.OnClientClick = "p(" + myReader[9].ToString() + ")"; // img.ToolTip = "Imprimir Evaluación"; // c++; // tblCellImg.Width = 16; // tblCellImg.Attributes.Add("class", "td02"); // tblCellImg.Controls.Add(img); // img.Dispose(); // tblRow.Cells.Add(tblCellImg); // tblCellImg.Dispose(); //} for (int i = 1; i < 6; i++) { TableCell tblCell = new TableCell(); switch (i) { case 3: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 5) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02c"); break; case 4: tblCell.Text = myReader.GetValue(i).ToString(); tblCell.Attributes.Add("class", "td02"); break; case 5: tblCell.Attributes.Add("class", (i == 5) ? myReader.GetValue(i).ToString() : "td02"); break; default: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 5) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02"); break; } if (i == 1 && ((decimal)myReader[7] != 10)) { // tblCell.ColumnSpan = 2; } tblRow.Cells.Add(tblCell); tblCell.Dispose(); } Tbl1.Rows.Add(tblRow); tblRow.Dispose(); group = myReader.GetValue(0).ToString(); } if (Tbl1.Visible) { AddSeparator(Tbl1); } ; #endregion #region Concurrent myReader.NextResult(); Tbl2.Visible = (myReader.HasRows); name = string.Empty; group = string.Empty; while (myReader.Read()) { pendings = true; if (name != myReader.GetValue(0).ToString()) { TableRow tblRowName = new TableRow(); TableCell tblCellName = new TableCell(); tblCellName.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower()); tblCellName.ColumnSpan = 6; tblCellName.Attributes.Add("class", "td06L"); tblRowName.Cells.Add(tblCellName); Tbl2.Rows.Add(tblRowName); tblCellName.Dispose(); tblRowName.Dispose(); group = string.Empty; } if (group != myReader.GetValue(1).ToString()) { TableRow tblRowGroup = new TableRow(); TableCell tblCellGroup = new TableCell(); TableCell tblCellButton = new TableCell(); Button button = new Button(); button.Text = "Aprobar/Rechazar"; button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString(); button.Attributes.Add("class", "btn"); button.PostBackUrl = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".2." + myReader[9].ToString()))); tblCellGroup.Text = myReader.GetValue(1).ToString(); tblCellGroup.ColumnSpan = 4; tblCellGroup.Attributes.Add("class", "td06"); tblRowGroup.Cells.Add(tblCellGroup); tblRowGroup.Cells.Add(tblCellButton); tblCellButton.Controls.Add(button); tblCellButton.Attributes.Add("class", "td06"); tblCellButton.ColumnSpan = 2; Tbl2.Rows.Add(tblRowGroup); tblCellGroup.Dispose(); tblCellButton.Dispose(); tblRowGroup.Dispose(); button.Dispose(); } TableRow tblRow = new TableRow(); for (int i = 2; i < 7; i++) { TableCell tblCell = new TableCell(); switch (i) { case 4: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02c"); break; case 5: tblCell.Text = myReader.GetValue(i).ToString(); tblCell.Attributes.Add("class", "td02"); break; case 6: tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02"); break; default: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02"); break; } if (i == 2) { tblCell.ColumnSpan = 2; } tblRow.Cells.Add(tblCell); tblCell.Dispose(); } Tbl2.Rows.Add(tblRow); tblRow.Dispose(); name = myReader.GetValue(0).ToString(); group = myReader.GetValue(1).ToString(); } if (Tbl2.Visible) { AddSeparator(Tbl2); } ; #endregion #region Double Report myReader.NextResult(); Tbl3.Visible = (myReader.HasRows); name = string.Empty; group = string.Empty; while (myReader.Read()) { pendings = true; if (name != myReader.GetValue(0).ToString()) { TableRow tblRowName = new TableRow(); TableCell tblCellName = new TableCell(); tblCellName.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower()); tblCellName.ColumnSpan = 6; tblCellName.Attributes.Add("class", "td06L"); tblRowName.Cells.Add(tblCellName); Tbl3.Rows.Add(tblRowName); tblCellName.Dispose(); tblRowName.Dispose(); group = string.Empty; } if (group != myReader.GetValue(1).ToString()) { TableRow tblRowGroup = new TableRow(); TableCell tblCellGroup = new TableCell(); TableCell tblCellButton = new TableCell(); Button button = new Button(); button.Text = "Aprobar/Rechazar"; button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString(); button.Attributes.Add("class", "btn"); button.PostBackUrl = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".3." + myReader[9].ToString()))); tblCellGroup.Text = myReader.GetValue(1).ToString(); tblCellGroup.ColumnSpan = 4; tblCellGroup.Attributes.Add("class", "td06"); tblRowGroup.Cells.Add(tblCellGroup); tblRowGroup.Cells.Add(tblCellButton); tblCellButton.Controls.Add(button); tblCellButton.Attributes.Add("class", "td06"); tblCellButton.ColumnSpan = 2; Tbl3.Rows.Add(tblRowGroup); tblCellGroup.Dispose(); tblCellButton.Dispose(); tblRowGroup.Dispose(); button.Dispose(); } TableRow tblRow = new TableRow(); for (int i = 2; i < 7; i++) { TableCell tblCell = new TableCell(); switch (i) { case 4: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02c"); break; case 5: tblCell.Text = myReader.GetValue(i).ToString(); tblCell.Attributes.Add("class", "td02"); break; case 6: tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02"); break; default: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02"); break; } if (i == 2) { tblCell.ColumnSpan = 2; } tblRow.Cells.Add(tblCell); tblCell.Dispose(); } Tbl3.Rows.Add(tblRow); tblRow.Dispose(); name = myReader.GetValue(0).ToString(); group = myReader.GetValue(1).ToString(); } if (Tbl3.Visible) { AddSeparator(Tbl3); } ; #endregion #region HHRR myReader.NextResult(); Tbl4.Visible = (myReader.HasRows); name = string.Empty; group = string.Empty; while (myReader.Read()) { pendings = true; if (name != myReader.GetValue(0).ToString()) { TableRow tblRowName = new TableRow(); TableCell tblCellName = new TableCell(); tblCellName.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("Evaluador: " + myReader.GetValue(0).ToString().Trim().ToLower()); tblCellName.ColumnSpan = 6; tblCellName.Attributes.Add("class", "td06L"); tblRowName.Cells.Add(tblCellName); Tbl4.Rows.Add(tblRowName); tblCellName.Dispose(); tblRowName.Dispose(); group = string.Empty; } if (group != myReader.GetValue(1).ToString()) { TableRow tblRowGroup = new TableRow(); TableCell tblCellGroup = new TableCell(); TableCell tblCellButton = new TableCell(); Button button = new Button(); button.Text = "Aprobar/Rechazar"; button.ToolTip = "Aprueba/Rechaza personas del " + myReader.GetValue(1).ToString(); button.Attributes.Add("class", "btn"); button.PostBackUrl = Server.HtmlEncode("~/EvaluationForm.aspx?.=" + Server.UrlEncode(Encryption.Encrypt(myReader.GetValue(7).ToString() + ".5." + myReader[9].ToString()))); tblCellGroup.Text = myReader.GetValue(1).ToString(); tblCellGroup.ColumnSpan = 4; tblCellGroup.Attributes.Add("class", "td06"); tblRowGroup.Cells.Add(tblCellGroup); tblRowGroup.Cells.Add(tblCellButton); tblCellButton.Controls.Add(button); tblCellButton.Attributes.Add("class", "td06"); tblCellButton.ColumnSpan = 2; Tbl4.Rows.Add(tblRowGroup); tblCellGroup.Dispose(); tblCellButton.Dispose(); tblRowGroup.Dispose(); button.Dispose(); } TableRow tblRow = new TableRow(); for (int i = 2; i < 7; i++) { TableCell tblCell = new TableCell(); switch (i) { case 4: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02c"); break; case 5: tblCell.Text = myReader.GetValue(i).ToString(); tblCell.Attributes.Add("class", "td02"); break; case 6: tblCell.Attributes.Add("class", (i == 6) ? myReader.GetValue(i).ToString() : "td02"); break; default: tblCell.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase((i == 6) ? "" : myReader.GetValue(i).ToString().Trim().ToLower()); tblCell.Attributes.Add("class", "td02"); break; } if (i == 2) { tblCell.ColumnSpan = 2; } tblRow.Cells.Add(tblCell); tblCell.Dispose(); } Tbl4.Rows.Add(tblRow); tblRow.Dispose(); name = myReader.GetValue(0).ToString(); group = myReader.GetValue(1).ToString(); } if (Tbl4.Visible) { AddSeparator(Tbl4); } ; #endregion myReader.Close(); QD.Visible = pendings; if (!pendings) { NB.Text = "Usted no posee evaluaciones pendientes."; NB.Visible = true; } }
private void Build(object[] d) { string _style = ""; int color = 0; Table tbl = new Table(); tbl.Attributes.Add("width", "100%"); tbl.BorderWidth = 1; tbl.CellSpacing = 1; tbl.CellPadding = 0; tbl.ID = "tbl_" + tblID.ToString(); TableRow tblRowEvaluated = new TableRow(); TableCell tblCellEvaluated = new TableCell(); tblCellEvaluated.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(d[1].ToString().Trim().ToLower()); tblCellEvaluated.ColumnSpan = 3; tblCellEvaluated.Attributes.Add("class", "td01"); tblRowEvaluated.Cells.Add(tblCellEvaluated); tbl.Rows.Add(tblRowEvaluated); tblCellEvaluated.Dispose(); tblRowEvaluated.Dispose(); TableRow tblRow1 = new TableRow(); TableRow tblRow2 = new TableRow(); TableRow tblRow3 = new TableRow(); TableRow tblRow4 = new TableRow(); TableCell tblCell1 = new TableCell(); TableCell tblCell2 = new TableCell(); TableCell tblCell3 = new TableCell(); tblCell2.Text = "Qué mejorar"; tblCell3.Text = "Cómo"; tblCell2.Attributes.Add("class", "td03"); tblCell3.Attributes.Add("class", "td03"); TableCell tblCell11 = new TableCell(); TableCell tblCell21 = new TableCell(); TableCell tblCell31 = new TableCell(); tblCell11.Width = 100; tblCell11.Text = "70% On The Job"; tblCell11.Attributes.Add("class", "td03"); tblCell21.Attributes.Add("class", "td02"); tblCell31.Attributes.Add("class", "td02"); TextBox txt1 = new TextBox(); txt1.Text = d[2].ToString(); if (txt1.Text.Trim().Length > 0) { color++; } ; txt1.Attributes["class"] = "tM"; txt1.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt1.Attributes["onfocus"] = "_i(this)"; txt1.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt1.Rows = 3; txt1.TextMode = TextBoxMode.MultiLine; txt1.Width = Unit.Percentage(98); //txt1.ReadOnly = (d[8].ToString() == "t") ? false : true; txt1.ReadOnly = true; txt1.SkinID = d[0].ToString(); tblCell21.Controls.Add(txt1); //TextBox txt11 = new TextBox(); //txt11.Text = d[3].ToString(); //if (txt11.Text.Trim().Length > 0) { color++; }; //txt11.Attributes["class"] = "tM"; //txt11.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; //txt11.Attributes["onfocus"] = "_i(this)"; //txt11.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; //txt11.Rows = 3; //txt11.TextMode = TextBoxMode.MultiLine; //txt11.Width = Unit.Percentage(98); ////txt11.ReadOnly = (d[8].ToString() == "t") ? false : true; //txt11.ReadOnly = true; //txt11.SkinID = d[0].ToString(); //tblCell31.Controls.Add(txt11); DropDownList ddl1 = new DropDownList(); ddl1.Attributes["onchange"] = "_k(event, '" + tbl.ClientID + "')"; ddl1.Enabled = (d[8].ToString() == "t") ? true : false; ddl1.Items.Add("<< Seleccione una competencia a mejorar >>"); ddl1.Items.Add("Compañerismo"); ddl1.Items.Add("Esfuerzo"); ddl1.Items.Add("Prueba"); tblCell21.Controls.Add(ddl1); tblCell21.Controls.Add(new LiteralControl("<br />")); DropDownList ddl2 = new DropDownList(); ddl2.Attributes["onchange"] = "_k(event, '" + tbl.ClientID + "')"; ddl2.Enabled = (d[8].ToString() == "t") ? true : false; ddl2.Items.Add("<< Seleccione una competencia a mejorar >>"); ddl2.Items.Add("Compañerismo"); ddl2.Items.Add("Esfuerzo"); ddl2.Items.Add("Prueba"); tblCell21.Controls.Add(ddl2); TableCell tblCell111 = new TableCell(); TableCell tblCell211 = new TableCell(); TableCell tblCell311 = new TableCell(); tblCell111.Width = 100; tblCell111.Text = "Competencias Técnicas"; tblCell111.Attributes.Add("class", "td03"); tblCell211.Attributes.Add("class", "td02"); tblCell311.Attributes.Add("class", "td02"); TextBox txt2 = new TextBox(); txt2.Text = d[4].ToString(); if (txt2.Text.Trim().Length > 0) { color++; } ; txt2.Attributes["class"] = "tM"; txt2.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt2.Attributes["onfocus"] = "_i(this)"; txt2.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt2.Rows = 3; txt2.TextMode = TextBoxMode.MultiLine; txt2.Width = Unit.Percentage(98); //txt2.ReadOnly = (d[8].ToString() == "t") ? false : true; txt2.ReadOnly = true; txt2.SkinID = d[0].ToString(); tblCell211.Controls.Add(txt2); TextBox txt21 = new TextBox(); txt21.Text = d[5].ToString(); if (txt21.Text.Trim().Length > 0) { color++; } ; txt21.Attributes["class"] = "tM"; txt21.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt21.Attributes["onfocus"] = "_i(this)"; txt21.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt21.Rows = 3; txt21.TextMode = TextBoxMode.MultiLine; txt21.Width = Unit.Percentage(98); //txt21.ReadOnly = (d[8].ToString() == "t") ? false : true; txt21.ReadOnly = true; txt21.SkinID = d[0].ToString(); tblCell311.Controls.Add(txt21); TableCell tblCell1111 = new TableCell(); TableCell tblCell2111 = new TableCell(); TableCell tblCell3111 = new TableCell(); tblCell1111.Width = 100; tblCell1111.Text = "Aspectos Actitudinales"; tblCell1111.Attributes.Add("class", "td03"); tblCell2111.Attributes.Add("class", "td02"); tblCell3111.Attributes.Add("class", "td02"); TextBox txt3 = new TextBox(); txt3.Text = d[6].ToString(); if (txt3.Text.Trim().Length > 0) { color++; } ; txt3.Attributes["class"] = "tM"; txt3.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt3.Attributes["onfocus"] = "_i(this)"; txt3.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt3.Rows = 3; txt3.TextMode = TextBoxMode.MultiLine; txt3.Width = Unit.Percentage(98); //txt3.ReadOnly = (d[8].ToString() == "t") ? false : true; txt3.ReadOnly = true; txt3.SkinID = d[0].ToString(); tblCell2111.Controls.Add(txt3); TextBox txt31 = new TextBox(); txt31.Text = d[7].ToString(); if (txt31.Text.Trim().Length > 0) { color++; } ; txt31.Attributes["class"] = "tM"; txt31.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt31.Attributes["onfocus"] = "_i(this)"; txt31.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt31.Rows = 3; txt31.TextMode = TextBoxMode.MultiLine; txt31.Width = Unit.Percentage(98); //txt31.ReadOnly = (d[8].ToString() == "t") ? false : true; txt31.ReadOnly = true; txt31.SkinID = d[0].ToString(); tblCell3111.Controls.Add(txt31); tblRow1.Cells.AddRange(new TableCell[] { tblCell1, tblCell2, tblCell3 }); tblRow2.Cells.AddRange(new TableCell[] { tblCell11, tblCell21, tblCell31 }); tblRow3.Cells.AddRange(new TableCell[] { tblCell111, tblCell211, tblCell311 }); tblRow4.Cells.AddRange(new TableCell[] { tblCell1111, tblCell2111, tblCell3111 }); TableRow tblRowColor = new TableRow(); TableCell tblCellColor = new TableCell(); TableCell tblCellColorL = new TableCell(); tblCellColorL.ColumnSpan = 2; if (color == 6) { //Button btn = (Button)this.Page.Master.FindControl("CPH").FindControl("btnSend"); //btn.Enabled = true; _style = "g"; } else if (color == 0) { _style = "r"; } else { _style = "y"; } tblCellColorL.Attributes.Add("class", _style); // tblCellColorL.ID = "C"; tblRowColor.Cells.AddRange(new TableCell[] { tblCellColor, tblCellColorL }); TableRow tblRowSeguimiento = new TableRow(); TableCell tblCellSeguimiento = new TableCell(); tblCellSeguimiento.ColumnSpan = 2; Label lblSeguimiento = new Label(); lblSeguimiento.Text = "Añadir seguimiento de desarrollo"; lblSeguimiento.Attributes.Add("class", "titulo"); tblCellSeguimiento.Controls.Add(lblSeguimiento); TextBox txtSeguimiento = new TextBox(); txtSeguimiento.Rows = 3; txtSeguimiento.TextMode = TextBoxMode.MultiLine; txtSeguimiento.Width = Unit.Percentage(99); txtSeguimiento.ReadOnly = false; txtSeguimiento.Attributes["class"] = "Seg"; txtSeguimiento.Attributes["onkeyup"] = "kSeg('" + tbl.ClientID + "')"; txtSeguimiento.SkinID = d[0].ToString(); tblCellSeguimiento.Controls.Add(txtSeguimiento); DataTable dtSeguimiento = new DataTable(); dtSeguimiento = new clsDAO().SqlCall("GetFollowupHistory " + d[0].ToString()); if (dtSeguimiento.Rows.Count > 0) { Label lblHistorial = new Label(); lblHistorial.Text = "Historial de seguimiento"; lblHistorial.Attributes.Add("class", "titulo"); tblCellSeguimiento.Controls.Add(lblHistorial); GridView gvSeguimiento = new GridView(); gvSeguimiento.DataSource = dtSeguimiento; gvSeguimiento.DataBind(); tblCellSeguimiento.Controls.Add(gvSeguimiento); } tblRowSeguimiento.Cells.Add(tblCellSeguimiento); tbl.Rows.AddRange(new TableRow[] { tblRow1, tblRow2, tblRow3, tblRow4, tblRowColor, tblRowSeguimiento }); this.Controls.Add(tbl); }
protected void Page_Load(object sender, EventArgs e) { clsDAO objDAO = new clsDAO(); int _Status = Convert.ToInt32(objDAO.SqlCall("GetStatusPrint '" + Request.QueryString["EvaluationId"] + "'").Rows[0][0].ToString()); string _Evaluated = objDAO.SqlCall("GetEvaluatedByEvaluated '" + Request.QueryString["EvaluationId"].ToString() + "'").Rows[0][0].ToString(); string _Evaluator = objDAO.SqlCall("GetEvaluatorbyEvaluated '" + _Evaluated + "'").Rows[0][0].ToString(); if ((ConfigurationManager.AppSettings["Printers"].Contains(UserHelper.GetUserId(Request.LogonUserIdentity.Name))) || ((_Status == 10 || _Status == 12) && UserHelper.GetUserId(Request.LogonUserIdentity.Name).Replace("SA\\", "").Equals(_Evaluator))) { try { //string parameter = Request.Params["__EVENTARGUMENT"]; string parameter = Request.QueryString["EvaluationId"]; TemplateProcessor tp = new TemplateProcessor(); Pf.SetData(Convert.ToInt32(parameter)); tp.Filename = Server.MapPath("PrintPage.htm"); tp.References = new object[] { Pf }; Response.Clear(); Response.Write(tp.Parse()); Response.End(); } catch (Exception ex) { throw ex; } } else if ((UserHelper.GetUserId(Request.LogonUserIdentity.Name).Replace("SA\\", "").Equals(_Evaluated)) && (_Status == 10 || _Status == 12)) { try { //string parameter = Request.Params["__EVENTARGUMENT"]; string parameter = Request.QueryString["EvaluationId"]; TemplateProcessor tp = new TemplateProcessor(); Pf.SetData(Convert.ToInt32(parameter)); tp.Filename = Server.MapPath("PrintPageView.htm"); tp.References = new object[] { Pf }; Response.Clear(); Response.Write(tp.Parse()); Response.End(); } catch (Exception ex) { throw ex; } } else { RegisterStartupScript("startupScript", "<script language=JavaScript type=\"text/javascript\">alert('Usted no posee permisos para imprimir');window.location.replace(\"Default.aspx\");</script>"); } }
private void Build(object[] d) { string _style = ""; string tmpText = ""; int color = 0; Table tbl = new Table(); tbl.Attributes.Add("width", "100%"); tbl.BorderWidth = 0; tbl.CellSpacing = 1; tbl.CellPadding = 0; tbl.ID = "tbl_" + tblID.ToString(); TableRow tblRowEvaluated = new TableRow(); TableCell tblCellEvaluated = new TableCell(); tblCellEvaluated.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(d[1].ToString().Trim().ToLower()); tblCellEvaluated.ColumnSpan = 2; tblCellEvaluated.Attributes.Add("class", "td01"); tblRowEvaluated.Cells.Add(tblCellEvaluated); tbl.Rows.Add(tblRowEvaluated); tblCellEvaluated.Dispose(); tblRowEvaluated.Dispose(); TableRow tblRowAclaracionCompetencias = new TableRow(); TableCell tblCellAclaracionCompetencias = new TableCell(); tblCellAclaracionCompetencias.Text = "Por favor, seleccionar 2 competencias que usted considera que el colaborador debería desarrollar y la forma en que podría mejorarlas."; tblCellAclaracionCompetencias.ForeColor = System.Drawing.Color.Red; tblRowAclaracionCompetencias.Cells.Add(new TableCell()); tblRowAclaracionCompetencias.Cells.Add(tblCellAclaracionCompetencias); TableRow tblRow0 = new TableRow(); TableRow tblRow1 = new TableRow(); TableRow tblRow2 = new TableRow(); TableRow tblRow3 = new TableRow(); TableRow tblRow4 = new TableRow(); TableCell tblCell01 = new TableCell(); TableCell tblCell02 = new TableCell(); DataTable dtCompetencies = new clsDAO().SqlCall("[GetCompetenciesImprovement] '" + d[0].ToString() + "'"); DropDownList ddl1 = new DropDownList(); ddl1.Attributes["onchange"] = "_k(event, '" + tbl.ClientID + "')"; ddl1.Enabled = (d[8].ToString() == "t") ? true : false; ddl1.Items.Add("<< Seleccione una competencia a mejorar >>"); foreach (DataRow dr in dtCompetencies.Rows) { ddl1.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString())); } ddl1.SelectedValue = d[2].ToString(); if (ddl1.SelectedIndex > 0) { color++; } tblCell02.Controls.Add(ddl1); DropDownList ddl2 = new DropDownList(); ddl2.Attributes["onchange"] = "_k(event, '" + tbl.ClientID + "')"; ddl2.Enabled = (d[8].ToString() == "t") ? true : false; ddl2.Items.Add("<< Seleccione una competencia a mejorar >>"); foreach (DataRow dr in dtCompetencies.Rows) { ddl2.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString())); } ddl2.SelectedValue = d[4].ToString(); if (ddl2.SelectedIndex > 0 && ddl1.SelectedIndex != ddl2.SelectedIndex) { color++; } tblCell02.Controls.Add(ddl2); TableCell tblCell1 = new TableCell(); TableCell tblCell2 = new TableCell(); TableCell tblCell3 = new TableCell(); tblCell2.Text = "Qué mejorar"; tblCell3.Text = "Cómo"; tblCell2.Attributes.Add("class", "td03"); tblCell3.Attributes.Add("class", "td03"); TableCell tblCell11 = new TableCell(); TableCell tblCell21 = new TableCell(); TableCell tblCell31 = new TableCell(); tblCell11.Width = 200; //tblCell2.Width = Unit.Percentage(40); //tblCell3.Width = Unit.Percentage(40); //tblCell11.Text = "70% On The Job"; //tblCell11.ToolTip = "ON THE JOB:\n1.Enriquecimiento de las responsabilidades.\n2.Rotación en el trabajo, ampliación del puesto.\n3.Asignaciones a proyectos desafiantes.\n4.Transferencias laterales o asignaciones especiales.\n5.Dar oportunidad para hacer presentaciones y luego exponerlas.\n6.Involucramiento en reuniones, juntas, discusiones, etc.\n7.Liderar como instructor, capacitar a otros, etc.\n8.Sesiones especiales de feedback.\nCOMPLEMENTARIAS:\n9.Células de entrenamiento.\n10.Investigación. Aprendizaje del mercado.\n11.Autoestudio.\n12.Bench de prácticas.\n13.Programas institucionales.\n14.Círculo de aprendizaje con otros pares."; HyperLink lnk = new HyperLink(); lnk.Text = "70% On The Job"; lnk.NavigateUrl = "~/img/On The Job.jpg"; lnk.Target = "blank"; lnk.ForeColor = System.Drawing.Color.Black; tblCell11.Controls.Add(lnk); tblCell11.Attributes.Add("class", "td03"); tblCell21.Attributes.Add("class", "td02"); tblCell31.Attributes.Add("class", "td02"); TextBox txt11 = new TextBox(); txt11.Text = d[3].ToString(); tmpText = System.Text.RegularExpressions.Regex.Replace(txt11.Text, @"[^0-9a-zA-Z]+", "").Trim(); if (tmpText.Length > 2 || tmpText.Equals("NA")) { color++; } ; txt11.Attributes["class"] = "tM"; txt11.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt11.Attributes["onfocus"] = "_i(this)"; txt11.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt11.Rows = 3; txt11.TextMode = TextBoxMode.MultiLine; txt11.Width = Unit.Percentage(99); txt11.ReadOnly = (d[8].ToString() == "t") ? false : true; txt11.SkinID = d[0].ToString(); tblCell31.Controls.Add(txt11); TableCell tblCell111 = new TableCell(); TableCell tblCell211 = new TableCell(); TableCell tblCell311 = new TableCell(); tblCell111.Width = 100; HyperLink lnk2 = new HyperLink(); lnk2.Text = "20% Coaching"; lnk2.NavigateUrl = "~/img/Coaching.jpg"; lnk2.Target = "blank"; lnk2.ForeColor = System.Drawing.Color.Black; tblCell111.Controls.Add(lnk2); tblCell111.Attributes.Add("class", "td03"); tblCell211.Attributes.Add("class", "td02"); tblCell311.Attributes.Add("class", "td02"); TextBox txt21 = new TextBox(); txt21.Text = d[5].ToString(); tmpText = System.Text.RegularExpressions.Regex.Replace(txt21.Text, @"[^0-9a-zA-Z]+", "").Trim(); if (tmpText.Length > 2 || tmpText.Equals("NA")) { color++; } ; txt21.Attributes["class"] = "tM"; txt21.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt21.Attributes["onfocus"] = "_i(this)"; txt21.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt21.Rows = 3; txt21.TextMode = TextBoxMode.MultiLine; txt21.Width = Unit.Percentage(99); txt21.ReadOnly = (d[8].ToString() == "t") ? false : true; txt21.SkinID = d[0].ToString(); tblCell311.Controls.Add(txt21); TableCell tblCell1111 = new TableCell(); TableCell tblCell2111 = new TableCell(); TableCell tblCell3111 = new TableCell(); tblCell1111.Width = 100; HyperLink lnk3 = new HyperLink(); lnk3.Text = "10% Capacitación Formal"; lnk3.NavigateUrl = "~/img/Capacitación.jpg"; lnk3.Target = "blank"; lnk3.ForeColor = System.Drawing.Color.Black; tblCell1111.Controls.Add(lnk3); tblCell1111.Attributes.Add("class", "td03"); tblCell2111.Attributes.Add("class", "td02"); tblCell3111.Attributes.Add("class", "td02"); TextBox txt31 = new TextBox(); txt31.Text = d[7].ToString(); tmpText = System.Text.RegularExpressions.Regex.Replace(txt31.Text, @"[^0-9a-zA-Z]+", "").Trim(); if (tmpText.Length > 2 || tmpText.Equals("NA")) { color++; } ; txt31.Attributes["class"] = "tM"; txt31.Attributes["onblur"] = "_o(this, '" + tbl.ClientID + "')"; txt31.Attributes["onfocus"] = "_i(this)"; txt31.Attributes["onkeyup"] = "_k(event, '" + tbl.ClientID + "')"; txt31.Rows = 3; txt31.TextMode = TextBoxMode.MultiLine; txt31.Width = Unit.Percentage(99); txt31.ReadOnly = (d[8].ToString() == "t") ? false : true; txt31.SkinID = d[0].ToString(); tblCell3111.Controls.Add(txt31); //tblRow1.Cells.AddRange(new TableCell[] { tblCell1, tblCell2, tblCell3 }); //tblRow2.Cells.AddRange(new TableCell[] { tblCell11, tblCell21, tblCell31 }); //tblRow3.Cells.AddRange(new TableCell[] { tblCell111, tblCell211, tblCell311 }); //tblRow4.Cells.AddRange(new TableCell[] { tblCell1111, tblCell2111, tblCell3111 }); tblRow0.Cells.AddRange(new TableCell[] { tblCell01, tblCell02 }); tblRow1.Cells.AddRange(new TableCell[] { tblCell1, tblCell3 }); tblRow2.Cells.AddRange(new TableCell[] { tblCell11, tblCell31 }); tblRow3.Cells.AddRange(new TableCell[] { tblCell111, tblCell311 }); tblRow4.Cells.AddRange(new TableCell[] { tblCell1111, tblCell3111 }); TableRow tblRowColor = new TableRow(); TableRow tblRowCursos = new TableRow(); TableRow tblRowAclaracion = new TableRow(); TableCell tblCellColor = new TableCell(); TableCell tblCellColorL = new TableCell(); tblCellColorL.ColumnSpan = 2; if (color == 5) { //Button btn = (Button)this.Page.Master.FindControl("CPH").FindControl("btnSend"); //btn.Enabled = true; _style = "g"; } else if (color == 0) { _style = "r"; } else { _style = "y"; } tblCellColorL.Attributes.Add("class", _style); // tblCellColorL.ID = "C"; tblRowColor.Cells.AddRange(new TableCell[] { tblCellColor, tblCellColorL }); DataTable dt = new clsDAO().SqlCall("[sp_GetAllRegistrationsData] '" + d[0].ToString() + "','" + System.Configuration.ConfigurationManager.AppSettings["Year"] + "'"); TreeView tvw = new TreeView(); TreeNode tnCursos = new TreeNode("Cursos del empleado", "Cursos del empleado"); if (dt.Rows.Count > 0) { tnCursos.SelectAction = TreeNodeSelectAction.Expand; tnCursos.Expanded = false; } else { tnCursos = new TreeNode("Sin cursos en el período evaluado", "Sin cursos en el período evaluado"); tnCursos.SelectAction = TreeNodeSelectAction.None; tnCursos.Expanded = false; } tvw.Nodes.Add(tnCursos); foreach (DataRow dr in dt.Rows) { TreeNode tnCurso = new TreeNode(dr[0].ToString()); tnCurso.SelectAction = TreeNodeSelectAction.None; tnCursos.ChildNodes.Add(tnCurso); } TableCell tblCellCursos = new TableCell(); tblRowCursos.Controls.Add(tblCellCursos); tblCellCursos.Controls.Add(tvw); tblCellCursos.ColumnSpan = 2; Label lblAclaracion = new Label(); lblAclaracion.Text = "Para activar el botón ENVIAR tendrás que completar todos los campos de la Agenda de Desarrollo de tu colaborador."; lblAclaracion.ForeColor = System.Drawing.Color.Red; TableCell tblCellAclaracion = new TableCell(); tblRowAclaracion.Controls.Add(tblCellAclaracion); tblCellAclaracion.Controls.Add(lblAclaracion); tblCellAclaracion.ColumnSpan = 2; TableRow tblRowSeguimiento = new TableRow(); if (d[9].ToString().Equals("10") || d[9].ToString().Equals("12")) { TableCell tblCellSeguimiento = new TableCell(); tblCellSeguimiento.ColumnSpan = 2; Label lblSeguimiento = new Label(); lblSeguimiento.Text = "Añadir seguimiento de desarrollo"; lblSeguimiento.Attributes.Add("class", "titulo"); tblCellSeguimiento.Controls.Add(lblSeguimiento); TextBox txtSeguimiento = new TextBox(); txtSeguimiento.Rows = 3; txtSeguimiento.TextMode = TextBoxMode.MultiLine; txtSeguimiento.Width = Unit.Percentage(99); txtSeguimiento.ReadOnly = false; txtSeguimiento.Attributes["class"] = "Seg"; txtSeguimiento.Attributes["onkeyup"] = "kSeg('" + tbl.ClientID + "')"; txtSeguimiento.SkinID = d[0].ToString(); tblCellSeguimiento.Controls.Add(txtSeguimiento); DataTable dtSeguimiento = new DataTable(); dtSeguimiento = new clsDAO().SqlCall("GetFollowupHistory " + d[0].ToString()); if (dtSeguimiento.Rows.Count > 0) { Label lblHistorial = new Label(); lblHistorial.Text = "Historial de seguimiento"; lblHistorial.Attributes.Add("class", "titulo"); tblCellSeguimiento.Controls.Add(lblHistorial); GridView gvSeguimiento = new GridView(); gvSeguimiento.DataSource = dtSeguimiento; gvSeguimiento.DataBind(); tblCellSeguimiento.Controls.Add(gvSeguimiento); } tblRowSeguimiento.Cells.Add(tblCellSeguimiento); } tbl.Rows.AddRange(new TableRow[] { tblRowAclaracionCompetencias, tblRow0, tblRow1, tblRow2, tblRow3, tblRow4, tblRowColor, tblRowAclaracion, tblRowCursos, tblRowSeguimiento }); this.Controls.Add(tbl); }