public static void treeItemListControl_HtmlRowCreated(object sender, TreeListHtmlRowEventArgs e) { if (e.RowKind == TreeListRowKind.Data) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='lightgray';this.style.cursor='pointer'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';"); } }
protected void tree_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { if (e.RowKind == TreeListRowKind.Data) { e.Row.CssClass += " customRow"; e.Row.Attributes.Add("rowKey", e.NodeKey); } }
protected void tlData_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { ASPxTreeList treeList = sender as ASPxTreeList; if (e.RowKind == TreeListRowKind.Data) { TreeListNode parent = treeList.FindNodeByKeyValue(e.NodeKey).ParentNode; e.Row.Attributes.Add("nodeParent", (parent == null) ? String.Empty : parent.Key); } }
protected void ASPxTreeList1_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { if (e.NodeKey == StartNodeKey) { e.Row.BackColor = System.Drawing.Color.LightGreen; } if (HiddenNodeList.Contains(e.NodeKey)) { e.Row.ForeColor = System.Drawing.Color.Silver; } }
/// <summary> /// 分析依赖 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void treeList_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { if (grid.IsEditing) { Int32 i = grid.EditingRowVisibleIndex; String oid = grid.GetRowValues(i, "OID").ToString(); if (Object.Equals(e.GetValue("OID"), oid)) { e.Row.BackColor = Color.FromArgb(211, 235, 183); } } }
void tree_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { if (e.RowKind == TreeListRowKind.Data) { DevExpress.Web.ASPxTreeList.TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey); if (!node.HasChildren) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='lightgray';this.style.cursor='pointer'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';"); } else { e.Row.BackColor = System.Drawing.Color.Gray; e.Row.Font.Bold = true; } } }
/// <summary> /// 分析依赖 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void treeList_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { if (grid.IsEditing) { Int32 i = grid.EditingRowVisibleIndex; String oid = grid.GetRowValues(i, "OID").ToString(); if (Object.Equals(e.GetValue("OID"), oid)) e.Row.BackColor = Color.FromArgb(211, 235, 183); } }
protected void TreeList_PSN_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { ASPxTreeList tr = (ASPxTreeList)sender; //Image img_Per = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns[" บุคลากร"] as TreeListDataColumn, "img_Per") as Image; //if (e.GetValue("PIC_PATH").ToString() != "") //{ // img_Per.ImageUrl = e.GetValue("PIC_PATH").ToString(); //} //tr.Columns[0].Visible = false; }
protected void treelstProductUnits_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { //if (e.RowKind == TreeListRowKind.Data && e.Level == 1) { // treelstProductUnits.FindNodeByKeyValue(e.NodeKey).Focus(); //} }
protected void tree_ORG_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { HyperLink anchor = new HyperLink(); anchor.Attributes["name"] = e.NodeKey; e.Row.Cells[0].Controls.Add(anchor); }
protected void ASPxTreeList1_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { e.Row.Attributes.Add("nodelevel", e.Level.ToString()); }
protected void ASPxTree_ORG_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { ASPxTreeList tr = (ASPxTreeList)sender; ASPxComboBox cmbApproveBy = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns["ผู้อนุญาต"] as TreeListDataColumn, "cmbApproveBy") as ASPxComboBox; UserControl_txtDatePicker txt_APP_DATE = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns["วันที่อนุญาต"] as TreeListDataColumn, "txt_APP_DATE") as UserControl_txtDatePicker; Label lblRow_Index = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns["ลำดับ"] as TreeListDataColumn, "lblRow_Index") as Label; Panel Pnl_collumn_Date = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns["วันที่อนุญาต"] as TreeListDataColumn, "Pnl_collumn_Date") as Panel; lblRow_Index.Text = e.GetValue("Row_Index").ToString(); DataTable DT = DT_SetDDLApprover(); // list รายชื่อผู้อนุญาตที่สามารถเลือกได้ if (DT.Rows.Count > 0) { cmbApproveBy.TextField = "staff_name"; cmbApproveBy.ValueField = "id"; cmbApproveBy.DataSource = DT; cmbApproveBy.DataBind(); } if (e.GetValue("Approver_ID").ToString() != "") { if (e.GetValue("Approver_ID").ToString() == "0") { cmbApproveBy.SelectedIndex = -1; } else { cmbApproveBy.Value = e.GetValue("Approver_ID").ToString(); } } else { //string Approve_By = GetApprove_By(); //if (Approve_By == "ByBoss") //{ //} cmbApproveBy.SelectedIndex = -1; } if (e.GetValue("approve_date").ToString() != "") { txt_APP_DATE.Text = Convert.ToDateTime(e.GetValue("approve_date")).ToString("dd MMM yyyy", new System.Globalization.CultureInfo("th-TH")); } else { txt_APP_DATE.Value = null; } // IsEnable if (!ISApprove_Enable) { cmbApproveBy.Enabled = false; cmbApproveBy.ForeColor = ColorTranslator.FromHtml("#000000"); cmbApproveBy.BackColor = ColorTranslator.FromHtml("#DDDDDD"); } if (!ISDate_Enable) { txt_APP_DATE.Enabled = false; Pnl_collumn_Date.Enabled = false; } }
protected void tree_PSN_Period_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { ASPxTreeList tr = (ASPxTreeList)sender; rptPeriod = ""; Image img_Per = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns[" บุคลากร"] as TreeListDataColumn, "img_Per") as Image; if (e.GetValue("PIC_PATH").ToString() != "") { img_Per.ImageUrl = e.GetValue("PIC_PATH").ToString(); } if (e.GetValue("ID").ToString() != "0") { string SQL = ""; SQL += " Declare @person_id nvarchar(200) = '" + e.GetValue("ID").ToString() + "' \n"; SQL += " Declare @_DATEFROM nvarchar(200) = '" + DateFrom + "' \n"; SQL += " Declare @_DATETO nvarchar(200) = '" + DateTo + "' \n"; SQL += " Declare @ORG_SERIAL nvarchar(50) = '" + e.GetValue("ORG_SERIAL").ToString() + "' \n"; SQL += " SELECT vw_Calendar.* ,T_PROCESS.remarks \n"; SQL += " ,SUBSTRING ( time_come ,1 , 2 ) _Htime_come \n"; SQL += " ,SUBSTRING ( time_come ,4 , 2 ) _Mtime_come \n"; SQL += " ,SUBSTRING ( time_back ,1 , 2 ) _Htime_back \n"; SQL += " ,SUBSTRING ( time_back ,4 , 2 ) _Mtime_back \n"; SQL += " ,CASE WHEN T_PROCESS.time_come IS NOT NULL AND T_PROCESS.time_come <>'00:00:00' AND T_PROCESS.time_come <> '' THEN T_PROCESS.time_come ELSE '' END time_come \n"; SQL += " ,CASE WHEN T_PROCESS.time_back IS NOT NULL AND T_PROCESS.time_back <>'00:00:00' AND T_PROCESS.time_come <> '' THEN T_PROCESS.time_back ELSE '' END time_back \n"; SQL += " FROM vw_Calendar \n"; SQL += " LEFT JOIN HRM_TIME_PROCESS T_PROCESS ON convert(varchar(8),T_PROCESS.downtime_date,112) = convert(varchar(8),vw_Calendar.CA_HO_DATE,112) \n"; SQL += " AND (convert(varchar(8),T_PROCESS.downtime_date,112) >= @_DATEFROM AND convert(varchar(8),T_PROCESS.downtime_date,112) <= @_DATETO \n"; SQL += " AND T_PROCESS.person_id = @person_id) \n"; SQL += " \n"; SQL += " WHERE convert(varchar(8),vw_Calendar.CA_HO_DATE,112) >= @_DATEFROM AND convert(varchar(8),vw_Calendar.CA_HO_DATE,112) <= @_DATETO \n"; SQL += " order by CA_HO_DATE asc \n"; DataTable DT = OPM_BL.GetDatatable(SQL, null); if (DT.Rows.Count > 0) { rptPeriod += "<table cellpadding='0' cellspacing='1' border='1' style='margin: 0px 0px 0px 0px; border:1px #c0c0c0; width:100%; color:#333333;'>" + Environment.NewLine; rptPeriod += " <tr style='height:30px; background-color:#9CC525;color: white;'>" + Environment.NewLine; rptPeriod += " <td width='120px' style='text-align:center; '>" + Environment.NewLine; rptPeriod += " <b>วันที่</b>" + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td width='100px' style='text-align:center; '>" + Environment.NewLine; rptPeriod += " <b>เวลามา</b>" + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td width='100px' style='text-align:center; '>" + Environment.NewLine; rptPeriod += " <b> เวลากลับ</b>" + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td style='text-align:center; width: 130px;'>" + Environment.NewLine; rptPeriod += " <b>จำนวนเวลาในการ<br>ปฏิบัติราชการ</b></td>" + Environment.NewLine; rptPeriod += " <td style='text-align:center; width: 200px;'>" + Environment.NewLine; rptPeriod += " <b>สถานะการมาปฎิบัติราชการ</b>" + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " </tr>" + Environment.NewLine; for (int i = 0; i < DT.Rows.Count; i++) { String lblTime = ""; if ((DT.Rows[i]["_Htime_come"].ToString() != "" && DT.Rows[i]["_Htime_come"].ToString() != "00") && (DT.Rows[i]["_Htime_back"].ToString() != "" && DT.Rows[i]["_Htime_back"].ToString() != "00")) { double Result_H = 0; double Result_M = 0; //--นาที double ResultM_Come = (GL.CDBL("60") - GL.CDBL(DT.Rows[i]["_Mtime_come"].ToString())) + GL.CDBL(DT.Rows[i]["_Mtime_back"].ToString()); Result_M = ResultM_Come; if (ResultM_Come >= GL.CDBL(60)) { Result_M = ResultM_Come % 60; //--ได้จำนวนนาทีของการทำงาน Result_H = ResultM_Come / 60; //--ได้จำนวนชั่วโมงที่คิดจาก นาที } //--ชั่วโมง double ResultH = GL.CDBL(DT.Rows[i]["_Htime_back"]) - GL.CDBL(DT.Rows[i]["_Htime_come"]); if (ResultH < 0) { ResultH = ResultH * (-1); } ResultH = ResultH + Result_H; string H = GL.CINT(ResultH).ToString(); string M = GL.CINT(Result_M).ToString(); if ((ResultH.ToString().Length) == 1) { H = "0" + H; } if ((Result_M.ToString().Length) == 1) { M = "0" + M; } lblTime = H + ":" + M + " ชม."; } rptPeriod += " <tr style='height:30px;background-color: " + DT.Rows[i]["HO_COLOR"].ToString() + ";' >" + Environment.NewLine; rptPeriod += " <td style='text-align:center; '>" + Environment.NewLine; rptPeriod += " " + DT.Rows[i]["DNAME"].ToString() + " " + DT.Rows[i]["FULLDATE"].ToString() + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td style='text-align:center;'>" + Environment.NewLine; rptPeriod += " " + DT.Rows[i]["time_come"].ToString() + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td style='text-align:center;'>" + Environment.NewLine; rptPeriod += " " + DT.Rows[i]["time_back"].ToString() + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td style='text-align:center;'>" + Environment.NewLine; rptPeriod += " " + lblTime.ToString() + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " <td style='padding-left:10px;'>" + Environment.NewLine; rptPeriod += " " + DT.Rows[i]["remarks"].ToString() + Environment.NewLine; rptPeriod += " </td>" + Environment.NewLine; rptPeriod += " </tr>" + Environment.NewLine; } rptPeriod += "</table>" + Environment.NewLine; } } }
protected void tree_PSN_HtmlRowPrepared(object sender, TreeListHtmlRowEventArgs e) { ASPxTreeList tr = (ASPxTreeList)sender; Label lblTime = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns[" จำนวนเวลาในการ<br>ปฏิบัติราชการ"] as TreeListDataColumn, "lblTime") as Label; Image img_Per = tr.FindDataCellTemplateControl(e.NodeKey, tr.Columns[" บุคลากร"] as TreeListDataColumn, "img_Per") as Image; if (e.GetValue("PIC_PATH").ToString() != "") { img_Per.ImageUrl = e.GetValue("PIC_PATH").ToString(); } if ((e.GetValue("_Htime_come").ToString() != "" && e.GetValue("_Htime_come").ToString() != "00") && (e.GetValue("_Htime_back").ToString() != "" && e.GetValue("_Htime_back").ToString() != "00")) { //double Result_H = 0; //double Result_M = 0; ////--นาที //double ResultM_Come = (GL.CDBL("60") - GL.CDBL(e.GetValue("_Mtime_come").ToString())) + GL.CDBL(e.GetValue("_Mtime_back").ToString()); //Result_M = ResultM_Come; //if (ResultM_Come >= GL.CDBL(60)) //{ // Result_M = ResultM_Come % 60; //--ได้จำนวนนาทีของการทำงาน // Result_H = ResultM_Come / 60; //--ได้จำนวนชั่วโมงที่คิดจาก นาที //} ////--ชั่วโมง //double ResultH = GL.CDBL(e.GetValue("_Htime_back")) - GL.CDBL(e.GetValue("_Htime_come")); //if (ResultH < 0) //{ // ResultH = ResultH * (-1); //} //ResultH = ResultH + Result_H; //string H = GL.CINT(ResultH).ToString(); //string M = GL.CINT(Result_M).ToString(); //if ((ResultH.ToString().Length) == 1) //{ // H = "0" + H; //} //if ((Result_M.ToString().Length) == 1) //{ // M = "0" + M; //} //lblTime.Text = H + ":" + M + " ชม."; //TIME time_come = OPM_BL.ConvertTime(e.GetValue("time_come").ToString()); time_back = OPM_BL.ConvertTime(e.GetValue("time_back").ToString()); time_code = e.GetValue("psst_time_rule_time_code").ToString(); //can_back = ""; if (time_come == "") { time_come = "0000"; } if (time_back == "") { time_back = "0000"; } if (time_code == "") { time_code = "00"; } //can_back = DoTimeCal(e.GetValue("time_come").ToString(), e.GetValue("time_back").ToString(), e.GetValue("psst_time_rule_time_code").ToString()); //can_back = DoTimeCal(time_come, time_back, time_code); } }