/// <summary> /// 显示行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void resultGrid_PreRowDataBound(object sender, GridPreRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; FineUI.BoundField supName = resultGrid.FindColumn("SUP_NAME") as FineUI.BoundField; supName.NullDisplayText = supDic[row["SUP_ID"].ToString()]; FineUI.BoundField status = resultGrid.FindColumn("STATUS_DESC") as FineUI.BoundField; switch (row["STATUS"].ToString()) { case "1": status.NullDisplayText = "存档"; break; case "2": status.NullDisplayText = "核准"; break; case "3": status.NullDisplayText = "作废"; break; case "4": break; case "5": status.NullDisplayText = "月结(关单)"; break; } }
protected void Page_Init(object sender, EventArgs e) { List <Entity.Waste> itemss = DAL.Waste.GetPartWasteEx(3); foreach (Entity.Waste item in itemss) { FineUI.BoundField bf = new FineUI.BoundField(); if (string.IsNullOrEmpty(item.Unit)) { bf.HeaderText = item.WasteName; } else { bf.HeaderText = item.WasteName + "(" + item.Unit + ")"; } //bf.HeaderText = item.WasteName; bf.DataField = item.WasteCode; //bf.SortField = item.WasteCode; bf.Width = 120; //bf.HeaderText = item.ItemName; bf.TextAlign = FineUI.TextAlign.Center; GF2.Columns.Add(bf); } }
protected void Page_Init(object sender, EventArgs e) { List <Entity.AnalysisItem> items = DAL.AnalysisItem.GetAnalysisItemList(1); foreach (Entity.AnalysisItem item in items) { FineUI.BoundField bf = new FineUI.BoundField(); if (string.IsNullOrEmpty(item.Unit)) { bf.HeaderText = item.ItemName; } else { bf.HeaderText = item.ItemName + "(" + item.Unit + ")"; } //bf.HeaderText = item.ItemName; bf.DataField = item.ItemCode; bf.SortField = item.ItemCode; bf.Width = 70; //bf.HeaderText = item.ItemName; bf.TextAlign = FineUI.TextAlign.Center; GF1.Columns.Add(bf); } }
protected void Page_Init(object sender, EventArgs e) { List <Entity.Waste> items = DAL.Waste.GetPartWasteEx(2); foreach (Entity.Waste item in items) { FineUI.GroupField gf = new GroupField(); gf.HeaderText = item.WasteName; FineUI.BoundField bf = new FineUI.BoundField(); if (string.IsNullOrEmpty(item.Unit)) { bf.HeaderText = "数量"; } else { bf.HeaderText = "数量(" + item.Unit + ")"; } bf.DataField = item.WasteCode; //bf.SortField = item.WasteCode; bf.Width = 70; //bf.HeaderText = item.ItemName; bf.TextAlign = FineUI.TextAlign.Center; FineUI.BoundField bf2 = new FineUI.BoundField(); bf2.HeaderText = "罐池号"; bf2.DataField = item.WasteCode + "Pond"; //bf.SortField = item.WasteCode; bf2.Width = 70; //bf.HeaderText = item.ItemName; bf.TextAlign = FineUI.TextAlign.Center; bf2.TextAlign = FineUI.TextAlign.Center; gf.Columns.Add(bf); gf.Columns.Add(bf2); GF1.Columns.Add(gf); } //List<Entity.Waste> itemss = DAL.Waste.GetPartWasteEx(3); //foreach (Entity.Waste item in itemss) //{ // FineUI.BoundField bf = new FineUI.BoundField(); // bf.HeaderText = item.WasteName; // bf.DataField = item.WasteCode; // //bf.SortField = item.WasteCode; // bf.Width = 50; // //bf.HeaderText = item.ItemName; // bf.TextAlign = FineUI.TextAlign.Center; // GF2.Columns.Add(bf); //} }
private void InitGrid() { ta = bllTa.GetOne(Guid.Parse(Request.QueryString["actId"])); DataTable dt = bllAta.GetDTbyLvTicket(ta.Id); FineUI.BoundField bf; for (int i = 0; i < dt.Columns.Count; i++) { bf = new FineUI.BoundField(); bf.DataField = dt.Columns[i].ColumnName; bf.HeaderText = dt.Columns[i].ColumnName; gridTimeStatistic.Columns.Add(bf); } dt = bllAta.GetDtBycheckTicket(ta.Id); for (int i = 0; i < dt.Columns.Count; i++) { bf = new FineUI.BoundField(); bf.DataField = dt.Columns[i].ColumnName; bf.HeaderText = dt.Columns[i].ColumnName; gridCheckTicketStatistic.Columns.Add(bf); } }
/// <summary> /// 初始化Grid(自动添加列,自动列宽) /// </summary> public void InitializeGrid(FUI.Grid grid, string[] columns, int[] widths) { List <string> list = new List <string>(); int cnt = grid.Columns.Count; // 动态添加列 for (int i = 0; i < columns.Length; i++) { string title = columns[i]; FUI.BoundField bf = new FUI.BoundField(); bf.DataField = title; bf.HeaderText = title; bf.DataFormatString = "{0}"; bf.Width = new Unit(widths[i]); Grid1.Columns.Add(bf); list.Add(columns[i]); } // 添加导入备注列 FUI.BoundField bz = new FUI.BoundField(); bz.DataField = BzName; bz.HeaderText = BzName; bz.DataFormatString = "{0}"; bz.MinWidth = new Unit(300); bz.ExpandUnusedSpace = true; bz.DataToolTipField = BzName; bz.DataToolTipFormatString = "{0}"; Grid1.Columns.Add(bz); //Ext.TemplateField bz = new Ext.TemplateField(); //bz.ItemTemplate = new Ext.GridRowControl(..TemplateField . = n.DataField = "导入备注"; //bz.HeaderText = "导入备注"; //columnTitles[i]; //bz.DataFormatString = "<span style='color:red'>{0}</span>"; //bz.Width = new Unit(300); //Grid1.Columns.Add(bz); Grid1.DataKeyNames = list.ToArray(); }
private void gen270Grid(EvaluationResult evaluationResult) { FineUI.BoundField bf; bf = new FineUI.BoundField(); bf.DataField = "quota"; bf.DataFormatString = "{0}"; bf.HeaderText = "指标"; bf.Width = 150; Grid1.Columns.Add(bf); bf = new FineUI.BoundField(); bf.DataField = "leader"; bf.DataFormatString = "{0}"; bf.HeaderText = "领导/上级(65%)"; bf.Width = 150; Grid1.Columns.Add(bf); bf = new FineUI.BoundField(); bf.DataField = "colleague"; bf.DataFormatString = "{0}"; bf.HeaderText = "同事(15%)"; bf.Width = 150; Grid1.Columns.Add(bf); bf = new FineUI.BoundField(); bf.DataField = "services"; bf.DataFormatString = "{0}"; bf.HeaderText = "服务对象/客户(20%)"; bf.Width = 150; Grid1.Columns.Add(bf); bf = new FineUI.BoundField(); bf.DataField = "result"; bf.DataFormatString = "{0}"; bf.HeaderText = "小计"; bf.Width = 150; Grid1.Columns.Add(bf); DataTable table = new DataTable(); table.Columns.Add("quota"); table.Columns.Add("leader"); table.Columns.Add("colleague"); table.Columns.Add("services"); table.Columns.Add("result"); DataRow row = table.NewRow(); row["quota"] = "关键绩效指标(50%)"; row["leader"] = evaluationResult.KeyScore[0]; row["colleague"] = evaluationResult.KeyScore[1]; row["services"] = evaluationResult.KeyScore[2]; row["result"] = evaluationResult.KeyScore[3]; table.Rows.Add(row); DataRow row1 = table.NewRow(); row1["quota"] = "岗位职责指标(20%)"; row1["leader"] = evaluationResult.ResponseScore[0]; row1["colleague"] = evaluationResult.ResponseScore[1]; row1["services"] = evaluationResult.ResponseScore[2]; row1["result"] = evaluationResult.ResponseScore[3]; table.Rows.Add(row1); DataRow row2 = table.NewRow(); row2["quota"] = "岗位胜任能力指标(15%)"; row2["leader"] = evaluationResult.QualifyScore[0]; row2["colleague"] = evaluationResult.QualifyScore[1]; row2["services"] = evaluationResult.QualifyScore[2]; row2["result"] = evaluationResult.QualifyScore[3]; table.Rows.Add(row2); DataRow row3 = table.NewRow(); row3["quota"] = "工作态度指标(15%)"; row3["leader"] = evaluationResult.AttitudeScore[0]; row3["colleague"] = evaluationResult.AttitudeScore[1]; row3["services"] = evaluationResult.AttitudeScore[2]; row3["result"] = evaluationResult.AttitudeScore[3]; table.Rows.Add(row3); DataRow row4 = table.NewRow(); row4["quota"] = "否决指标(100%)"; row4["leader"] = evaluationResult.RejectScore[0]; row4["colleague"] = evaluationResult.RejectScore[1]; row4["services"] = evaluationResult.RejectScore[2]; row4["result"] = evaluationResult.RejectScore[3]; table.Rows.Add(row4); DataRow row5 = table.NewRow(); row5["quota"] = "小计"; row5["leader"] = evaluationResult.ResultScore[0]; row5["colleague"] = evaluationResult.ResultScore[1]; row5["services"] = evaluationResult.ResultScore[2]; row5["result"] = evaluationResult.ResultScore[3]; table.Rows.Add(row5); DataRow row6 = table.NewRow(); row6["quota"] = "考评者数量"; row6["leader"] = evaluationResult.EvaluatorNum[0]; row6["colleague"] = evaluationResult.EvaluatorNum[1]; row6["services"] = evaluationResult.EvaluatorNum[2]; row6["result"] = evaluationResult.EvaluatorNum[3]; table.Rows.Add(row6); Grid1.DataSource = table; Grid1.DataBind(); switch (evaluationResult.EvaluationLevel) { case DepartEvaluationLevel.good: Label_EvaluationLevel.Text = "优(91~100)"; break; case DepartEvaluationLevel.notbad: Label_EvaluationLevel.Text = "良(71~90)"; break; case DepartEvaluationLevel.qualified: Label_EvaluationLevel.Text = "中(41~70)"; break; case DepartEvaluationLevel.unqualified: Label_EvaluationLevel.Text = "差(0~40)"; break; default: Label_EvaluationLevel.Text = "未定义状态"; break; } }
/// <summary> /// 保存导入数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { FineOffice.Common.Excel.ExcelHelper toExcel = new FineOffice.Common.Excel.ExcelHelper(); FineOffice.Web.WebExcelHelper excelHelper = new FineOffice.Web.WebExcelHelper(); string serverPath = Server.MapPath("~/Config/Template/CNS_CensusMember.xml"); List <ExcelHeader> headerList = toExcel.GetHeaderList(serverPath); try { foreach (GridRow row in gridMember.Rows) { gridMember.SelectedRowIndex = row.RowIndex; Dictionary <string, object> valueMap = new Dictionary <string, object>(); foreach (GridColumn column in gridMember.Columns) { FineUI.BoundField field = column as FineUI.BoundField; string value = row.Values[column.ColumnIndex].ToString(); if (field != null) { valueMap.Add(field.DataField, value); } } FineOffice.Modules.CNS_CensusMember model = toExcel.Create <FineOffice.Modules.CNS_CensusMember>(headerList, valueMap); FineOffice.Modules.CNS_CensusRegister register = registerBll.GetModel(m => m.RegisterNO == model.RegisterNO); if (register == null) { register = new FineOffice.Modules.CNS_CensusRegister(); register.RegisterNO = model.RegisterNO; register.HouseHolder = model.HouseHolder; FineOffice.Modules.CNS_CensusType type = typeBll.GetModel(t => t.CensusTypeName == model.CensusTypeName); if (type == null) { type = new FineOffice.Modules.CNS_CensusType(); type.CensusTypeName = model.CensusTypeName; type = typeBll.Add(type); } register.CensusTypeID = type.ID; registerBll.Add(register); } if (model.Gender == "男") { model.Sex = 1; } else { model.Sex = 0; } FineOffice.Modules.CNS_PoliticalAffiliation political = politicalBll.GetModel(m => m.Political == model.Political); if (political == null) { political = new FineOffice.Modules.CNS_PoliticalAffiliation(); political.Political = model.Political; political = politicalBll.Add(political); } model.PoliticalID = political.ID; FineOffice.Modules.AM_Kind kind = kindBll.GetModel(m => m.Name == model.Education); if (kind != null) { model.EducationID = kind.ID; } memberBll.Add(model); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("member_close")); } catch (Exception ex) { FineUI.Alert.ShowInParent(ex.Message); } }