protected void GridList_RowDataBound(object sender, GridRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; if (row != null) { string flag = row["FLAG"].ToString(); FineUIPro.BoundField flagcol = GridList.FindColumn("FLAGNAME") as FineUIPro.BoundField; if (flag == "W") { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color2"; } } }
protected void GridList_RowDataBound(object sender, GridRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; FineUIPro.BoundField flagcol = GridList.FindColumn("GDNAME") as FineUIPro.BoundField; if (row != null) { string DSNUM = row["DSNUM"].ToString(); string NUM1 = row["NUM1"].ToString(); if (DSNUM == "0" && NUM1 == "0") { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color1"; } } }
protected void GridList_RowDataBound(object sender, GridRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; if (row != null) { //string flag = row["FLAG"].ToString(); //if (flag == "新单") //{ // highlightRows.Text += e.RowIndex.ToString() + ","; //} string flag = row["FLAG"].ToString(); FineUIPro.BoundField flagcol = GridList.FindColumn("FLAG") as FineUIPro.BoundField; if (flag == "新单") { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color1"; } } }
protected void GridGoods_RowDataBound(object sender, GridRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; if (row != null) { string flag = row["FLAG_CN"].ToString(); int num = int.Parse(row["PRINTNUM"].ToString()); FineUIPro.BoundField flagcol = GridList.FindColumn("FLAG_CN") as FineUIPro.BoundField; if (flag == "已分配") { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color1"; } else if (num < 1) { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color2"; } } }
private void InitGrid() { DataTable table = new DataTable(); object objCache = CacheHelper.GetCache("STATISTICS_TYPE"); if (objCache != null) { table = objCache as DataTable; } else { table = DbHelperOra.Query("SELECT CODE,NAME FROM SYS_CATEGORY WHERE SJCODE='0' ").Tables[0]; CacheHelper.SetCache("STATISTICS_TYPE", table, TimeSpan.FromMinutes(30.0)); } if (table != null && table.Rows.Count > 0) { dtSource.Columns.Add("DEPTID", Type.GetType("System.String")); dtSource.Columns.Add("DEPTNAME", Type.GetType("System.String")); dtSource.Columns.Add("TOTALJE", Type.GetType("System.String")); foreach (DataRow row in table.Rows) { dtSource.Columns.Add(row["CODE"].ToString(), Type.GetType("System.String")); FineUIPro.BoundField category = new FineUIPro.BoundField(); category.DataField = row["CODE"].ToString(); category.ColumnID = row["CODE"].ToString(); category.HeaderText = row["NAME"].ToString(); category.TextAlign = FineUIPro.TextAlign.Right; GridDeptKC.Columns.Add(category); } FineUIPro.BoundField total = new FineUIPro.BoundField(); total.DataField = "TOTALJE"; total.ColumnID = "TOTALJE"; total.HeaderText = "总计"; total.TextAlign = FineUIPro.TextAlign.Right; GridDeptKC.Columns.Add(total); } }
protected void GridList_RowDataBound(object sender, GridRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; if (row != null) { if (string.IsNullOrWhiteSpace(row["XQ"].ToString())) { row["XQ"] = "0"; } string flag = row["XQ"].ToString(); FineUIPro.BoundField flagcol = GridList.FindColumn("XQ") as FineUIPro.BoundField; int SYXQ = System.Int32.Parse(flag); if (SYXQ > 0 && SYXQ <= 30) { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color2"; } else if (SYXQ < 0) { e.CellAttributes[flagcol.ColumnIndex]["data-color"] = "color3"; } } }
protected void CheckPowerFailWithBoundField(FineUIPro.Grid grid, string columnID) { FineUIPro.BoundField btn = grid.FindColumn(columnID) as FineUIPro.BoundField; btn.Hidden = true; btn.ToolTip = CHECK_POWER_FAIL_ACTION_MESSAGE; }
private void HistoryDataSearch() { string strSQL = "SELECT SUPID,SUPNAME,decode(flag,'Y','已审核','N','已保存','S','已提交','R','已驳回','待录入')flag, "; string strISBEGIN = @""; string strSQLBEG = @"FROM(select ta.supid,ta.supname,(select flag from doc_license_log where supid=ta.supid and rownum=1) flag, "; string strSQLEND = @"from (select a.supid, a.supname, b.code, b.name from doc_supplier a, doc_license b where a.issupplier = 'Y' and b.objuser='******') ta, doc_license_log tb where ta.supid = tb.supid(+) and ta.name = tb.licensename(+)"; string strsql = "group by ta.supid, ta.supname order by ta.supid, ta.supname)"; StringBuilder sb = new StringBuilder(); StringBuilder sb1 = new StringBuilder(); string strSQLAFTER = @"select distinct 'sum(decode(tb.licensename,''' || tb.name || ''',tb.picnum, 0))" + "\"" + "' || tb.name ||'" + "\"" + "'from doc_license tb where tb.objuser='******'"; strISBEGIN = @"select 'DECODE(SIGN(" + "\"" + "'|| tb.name ||'" + "\"" + "), 0,''未上传'',''已上传'') " + "\"" + "' || tb.name ||'" + "\"" + "'from doc_license tb where tb.objuser='******'"; DataTable mydtable = DbHelperOra.Query(strISBEGIN).Tables[0]; if (mydtable.Rows.Count > 0) { foreach (DataRow dr in mydtable.Rows) { sb1.Append(dr[0].ToString()); sb1.Append(","); } } else { Alert.Show("请先维护供应商证照再上传证照图片!"); return; } sb1 = sb1.Remove(sb1.Length - 1, 1); DataTable dtafter = DbHelperOra.Query(strSQLAFTER).Tables[0]; if (dtafter.Rows.Count > 0) { foreach (DataRow dr in dtafter.Rows) { sb.Append(dr[0].ToString()); sb.Append(","); FineUIPro.BoundField bf; bf = new FineUIPro.BoundField(); Match M = Regex.Match(dr[0].ToString(), "\".*\""); bf = new FineUIPro.BoundField(); bf.ColumnID = M.ToString().Replace("\"", ""); bf.DataField = M.ToString().Replace("\"", ""); bf.HeaderText = M.ToString().Replace("\"", ""); bf.TextAlign = FineUIPro.TextAlign.Center; bf.Width = 96; GridLIS.Columns.Add(bf); } } if (!string.IsNullOrWhiteSpace(txtName.Text)) { strSQLEND = strSQLEND + " and (ta.supid like '%" + txtName.Text + "%' or ta.supname like '%" + txtName.Text + "%')"; } strSQL = strSQL + sb1 + strSQLBEG + sb.ToString().TrimEnd(',') + strSQLEND + strsql; if (sb.ToString().Length == 0) { strSQL = "select 1 from dual where 1=2 "; } int total = 0; DataTable dt = PubFunc.DbGetPage(GridLIS.PageIndex, GridLIS.PageSize, strSQL, ref total); GridLIS.RecordCount = total; GridLIS.DataSource = dt; GridLIS.DataBind(); if (dt.Rows.Count > 0) { DataTable lisDT = DbHelperOra.Query(@"SELECT B.CODE, B.NAME, T.SEQNO, T.LICENSEID, T.LICENSENAME, T.SUPNAME, T.SUPID, T.OPERTIME, nvl(decode(T.FLAG,'N','已保存','S','已提交','Y','已审核','R','已驳回'),'待录入') FLAG, decode(T.PICNUM,'','【'||0||'】','【'||T.PICNUM||'】')PICNUM FROM (SELECT T.SEQNO, T.LICENSEID, T.LICENSENAME, T.SUPID, T.SUPNAME,T.OPERTIME,T.FLAG,T.PICNUM FROM DOC_LICENSE_LOG T WHERE SUPID = '" + dt.Rows[0][0].ToString() + "' AND T.ISCUR='N') T,DOC_LICENSE B WHERE B.CODE = T.LICENSEID(+) AND B.OBJUSER = '******'").Tables[0]; GridCertype.DataSource = lisDT; GridCertype.DataBind(); } }