/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { int status = Convert.ToInt16(e.Row.Cells[1].Text); e.Row.Cells[1].ForeColor = status.Equals(0) ? Color.Blue : Color.Red; e.Row.Cells[1].Text = status.ToString().GetStatusCH().HtmlEncode(); e.StopButton(status); DropDownList ddlIPAddres = (DropDownList)e.Row.FindControl("ddlIPAddres"); string[] ip_address = e.Row.Cells[8].Text.Trim().Split(','); for (int i = 0; i < ip_address.Length; i++) { if (!String.IsNullOrEmpty(ip_address[i])) { ddlIPAddres.Items.Add(new ListItem() { Text = ip_address[i], Value = ip_address[i] }); } } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.Header) { ((HtmlInputCheckBox)e.Row.FindControl("chBoxSelectAll")).Attributes.Add("onclick", "return selectAll(this);"); } else if (e.Row.RowType == DataControlRowType.DataRow) { ((HtmlInputCheckBox)e.Row.FindControl("chBoxSelected")).Attributes.Add("key", "selected"); int status = Convert.ToInt16(e.Row.Cells[2].Text); e.Row.Cells[2].ForeColor = status.Equals(0) ? Color.Blue : Color.Red; e.Row.Cells[2].Text = status.ToString().GetStatusCH().HtmlEncode(); e.StopButton(status); status = Convert.ToInt16(e.Row.Cells[5].Text); e.Row.Cells[5].ForeColor = status.Equals(0) ? Color.Blue : Color.Red; e.Row.Cells[5].Text = status.ToString().GetStatusCH().HtmlEncode(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { StringBuilder sb = new StringBuilder(); string os_type = e.Row.Cells[3].Text.Trim(); foreach (OsTypeMode os in Enum.GetValues(typeof(OsTypeMode))) { bool check = (Convert.ToInt32(os_type) & (int)os) > 0; if (!check) { continue; } sb.Append(string.Format("{0}<br/>", ((int)os).ToString().GetOsTypeCH())); } e.Row.Cells[3].Text = sb.ToString(); int token_total = Convert.ToInt16(e.Row.Cells[5].Text.Trim()); ((Button)e.Row.FindControl("btnDelete")).Visible = token_total == 0; sb = null; } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { ((Button)e.Row.FindControl("btnVerify")).Visible = !this.SessionMgr.UserInfos.UserID.Equals(e.Row.Cells[7].Text.Trim()); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { int status = Convert.ToInt16(e.Row.Cells[1].Text); e.Row.Cells[1].ForeColor = status.Equals(0) ? Color.Blue : Color.Red; e.Row.Cells[1].Text = status.ToString().GetStatusCH().HtmlEncode(); e.StopButton(status); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { if (!String.IsNullOrEmpty(e.Row.Cells[6].Text.Replace(StringFormatException.Mode.Nbsp))) { HyperLink lblComments = (HyperLink)e.Row.FindControl("lblComments"); lblComments.Text = e.Row.Cells[6].Text.Replace(StringFormatException.Mode.Nbsp).HtmlEncode(); lblComments.Attributes.Add("data-toggle", "tooltip"); lblComments.Attributes.Add("title", e.Row.Cells[7].Text.Replace(StringFormatException.Mode.Nbsp).HtmlEncode()); lblComments.Attributes.Add("onclick", string.Format("alertBoxBase64('{0}')", e.Row.Cells[7].Text.HtmlEncode().Replace("\r\n", "<br/>").EncryptBase64())); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { VerifyInfo verifyInfo = JsonConvert.DeserializeObject <VerifyInfo>(e.Row.Cells[9].Text.HtmlDecode().DecryptBase64()); int verify_status = verifyInfo.VerifyStatus; e.Row.Cells[1].Text = verify_status.ToString().GetVerifyStatusCH().HtmlEncode(); verify_status = Convert.ToInt32(e.Row.Cells[2].Text.Trim()); e.Row.Cells[2].ForeColor = verify_status == 8 ? Color.Blue : verify_status == 9 ? Color.Red : Color.Green; Button btnVerify = (Button)e.Row.FindControl("btnVerify"); if (verify_status > 3) { btnVerify.Text = "檢視覆核"; btnVerify.CssClass = "btn btn-info btn-sm"; e.Row.Cells[2].Text = verify_status.ToString().GetVerifyStatusCH().HtmlEncode(); } else { e.Row.Cells[2].Text = string.Format("待審"); e.Row.Cells[4].Text = string.Empty; btnVerify.Visible = !this.SessionMgr.UserInfos.UserID.Equals(e.Row.Cells[10].Text.Trim()); } e.Row.Cells[3].Text = verifyInfo.SubmittalDate.ToString("yyyy/MM/dd HH:mm:ss").HtmlEncode(); e.Row.Cells[5].Text = verifyInfo.AcctName.DecryptBase64().HtmlEncode(); e.Row.Cells[6].Text = verifyInfo.RoleName.DecryptBase64().HtmlEncode(); this.WriteLog(string.Format("{0},{1},{2},{3},{4}", e.Row.Cells[3].Text, e.Row.Cells[1].Text, e.Row.Cells[2].Text, this.SessionMgr.UserInfos.UserID, e.Row.Cells[10].Text.Trim())); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); if (e.Row.RowType == DataControlRowType.DataRow) { int status = Convert.ToInt32(e.Row.Cells[3].Text.Trim()); Color foreColor = Color.Black; switch (status) { case 1: foreColor = Color.Chocolate; break; case 2: foreColor = Color.Green; break; case 3: foreColor = Color.Blue; break; case 4: foreColor = Color.Red; break; case 5: foreColor = Color.Gray; break; } e.Row.Cells[3].ForeColor = foreColor; bool check = e.Row.Cells[11].Text.Trim().Equals(this.SessionMgr.UserInfos.UserID) && !status.Equals(5); e.Row.Cells[3].Text = status.ToString().GetPushMessageCH().HtmlEncode(); ((Button)e.Row.FindControl("btnDelete")).Text = status == 4 ? "作廢" : "刪除"; ((Button)e.Row.FindControl("btnUpdate")).Visible = check && (status.Equals(1) || status.Equals(4)); ((Button)e.Row.FindControl("btnDelete")).Visible = check && (status.Equals(1) || status.Equals(4)); ((Button)e.Row.FindControl("btnQuery")).Visible = !status.Equals(5); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { e.RowPermissions(sender, this.SessionMgr.WebTypePrivilege, this.WebTypePrivilege); }