/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromReportsecurity(ref DataRow row, Reportsecurity entity) { row.SetField("functionname", entity.functionname); row.SetField("menutitle", entity.menutitle); row.SetField("parentmenu", entity.parentmenu); row.SetField("parentpos", entity.parentpos); row.SetField("commandparameter", entity.commandparameter); row.SetField("moduleresource", entity.moduleresource); row.SetField("securitylevel", entity.securitylevel); }
public static Reportsecurity BuildReportsecurityFromRow(DataRow row) { Reportsecurity entity = new Reportsecurity(); entity.functionname = row.IsNull("functionname") ? string.Empty : row.Field <string>("functionname"); entity.menutitle = row.IsNull("menutitle") ? string.Empty : row.Field <string>("menutitle"); entity.parentmenu = row.IsNull("parentmenu") ? string.Empty : row.Field <string>("parentmenu"); entity.parentpos = row.IsNull("parentpos") ? 0 : row.Field <int>("parentpos"); entity.commandparameter = row.IsNull("commandparameter") ? string.Empty : row.Field <string>("commandparameter"); entity.moduleresource = row.IsNull("moduleresource") ? string.Empty : row.Field <string>("moduleresource"); entity.securitylevel = row.IsNull("securitylevel") ? 0 : row.Field <int>("securitylevel"); return(entity); }