/// <summary> 格式化 /// </summary> private void dgvDicList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { try { if (e.Value == null || string.IsNullOrEmpty(e.Value.ToString())) { return; } string fieldNmae = dgvDicList.Columns[e.ColumnIndex].DataPropertyName; if (fieldNmae.Equals("create_time") || fieldNmae.Equals("update_time")) { long ticks = (long)e.Value; e.Value = Common.UtcLongToLocalDateTime(ticks); } if (fieldNmae.Equals("enable_flag")) { DataSources.EnumEnableFlag enumEnableFlag = (DataSources.EnumEnableFlag)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumEnableFlag, true); } if (fieldNmae.Equals("data_source")) { DataSources.EnumDataSources enumDataSources = (DataSources.EnumDataSources)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumDataSources, true); } } catch (Exception ex) { Utility.Log.Log.writeLineToLog("【字典码表】" + ex.Message, "client"); } }
/// <summary> 格式化 /// </summary> private void dgvDicList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.Value == null) { return; } try { string fieldNmae = dgvDicList.Columns[e.ColumnIndex].DataPropertyName; if (fieldNmae.Equals("enable_flag")) { DataSources.EnumEnableFlag enumEnableFlag = (DataSources.EnumEnableFlag)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumEnableFlag, true); } if (fieldNmae.Equals("data_source")) { DataSources.EnumDataSources enumDataSources = (DataSources.EnumDataSources)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumDataSources, true); } } catch (Exception ex) { Utility.Log.Log.writeLineToLog("【字典码表】" + ex.Message, "client"); } }
private void dgvRole_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.Value == null) { return; } string fieldNmae = dgvRole.Columns[e.ColumnIndex].DataPropertyName; if (fieldNmae.Equals("create_time") || fieldNmae.Equals("update_time")) { long ticks = (long)e.Value; e.Value = Common.UtcLongToLocalDateTime(ticks); } if (fieldNmae.Equals("enable_flag")) { DataSources.EnumEnableFlag enumEnableFlag = (DataSources.EnumEnableFlag)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumEnableFlag, true); } if (fieldNmae.Equals("state")) { SYSModel.DataSources.EnumStatus EnumStatus = (SYSModel.DataSources.EnumStatus)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(EnumStatus, true); } if (fieldNmae.Equals("data_sources")) { SYSModel.DataSources.EnumDataSources EnumDataSources = (SYSModel.DataSources.EnumDataSources)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(EnumDataSources, true); } }
/// <summary> 格式化 /// </summary> private void dgvDicList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.Value == null) { return; } string fieldNmae = dgvDicList.Columns[e.ColumnIndex].DataPropertyName; if (fieldNmae.Equals("enable_flag")) { DataSources.EnumEnableFlag enumEnableFlag = (DataSources.EnumEnableFlag)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumEnableFlag, true); } if (fieldNmae.Equals("data_source")) { DataSources.EnumDataSources enumDataSources = (DataSources.EnumDataSources)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumDataSources, true); } }
private void dgvRole_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.Value == null) { return; } try { string fieldNmae = dgvRole.Columns[e.ColumnIndex].DataPropertyName; if (fieldNmae.Equals("create_time") || fieldNmae.Equals("update_time")) { long ticks = (long)e.Value; e.Value = Common.UtcLongToLocalDateTime(ticks); } if (fieldNmae.Equals("enable_flag")) { DataSources.EnumEnableFlag enumEnableFlag = (DataSources.EnumEnableFlag)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(enumEnableFlag, true); } if (fieldNmae.Equals("state")) { SYSModel.DataSources.EnumStatus EnumStatus = (SYSModel.DataSources.EnumStatus)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(EnumStatus, true); } if (fieldNmae.Equals("data_sources")) { SYSModel.DataSources.EnumDataSources EnumDataSources = (SYSModel.DataSources.EnumDataSources)Convert.ToInt16(e.Value.ToString()); e.Value = DataSources.GetDescription(EnumDataSources, true); } } catch (Exception ex) { GlobalStaticObj_Server.GlobalLogService.WriteLog("角色管理", ex); MessageBoxEx.ShowWarning("程序异常"); } }