public static string GetObjectName(string code) { string text2; try { string text = ""; if (code == "") { return(text); } EntityData remindObjectByCode = RemindDAO.GetRemindObjectByCode(code); if (remindObjectByCode.HasRecord()) { text = remindObjectByCode.GetString("ObjectName"); } remindObjectByCode.Dispose(); text2 = text; } catch (Exception exception) { throw exception; } return(text2); }
private void dgRemindList_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { try { string strKey = this.dgRemindList.DataKeys[(int)e.Item.ItemIndex].ToString(); EntityData entity = RemindDAO.GetRemindObjectByCode(strKey); RemindDAO.DeleteRemindObject(entity); entity.Dispose(); this.LoadData(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "获取提醒列表失败"); } }
public static string GetFieldName(string Code, string FieldName) { string text2; try { string text = ""; if (Code == "") { return(text); } EntityData remindObjectByCode = RemindDAO.GetRemindObjectByCode(Code); if (remindObjectByCode.HasRecord() && remindObjectByCode.CurrentTable.Columns.Contains(FieldName)) { if (remindObjectByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.Int32")) { return(remindObjectByCode.GetIntString(FieldName)); } if (remindObjectByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.Decimal")) { return(remindObjectByCode.GetDecimalString(FieldName)); } if (remindObjectByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.DateTime")) { return(remindObjectByCode.GetDateTimeOnlyDate(FieldName)); } if (remindObjectByCode.CurrentTable.Columns[FieldName].DataType == Type.GetType("System.String")) { return(remindObjectByCode.GetString(FieldName)); } } text2 = text; } catch (Exception exception) { throw exception; } return(text2); }