public static Aosystemmenuitem BuildAosystemmenuitemFromRow(DataRow row) { Aosystemmenuitem entity = new Aosystemmenuitem(); entity.menuset = row.IsNull("menuset") ? string.Empty : row.Field <string>("menuset"); entity.functionname = row.IsNull("functionname") ? string.Empty : row.Field <string>("functionname"); entity.trmgrlang = row.IsNull("trmgrlang") ? string.Empty : row.Field <string>("trmgrlang"); entity.windowtitle = row.IsNull("windowtitle") ? string.Empty : row.Field <string>("windowtitle"); entity.minSecurityLevel = row.IsNull("min_security_level") ? 0 : row.Field <int>("min_security_level"); entity.menutitle = row.IsNull("menutitle") ? string.Empty : row.Field <string>("menutitle"); entity.buttontitle = row.IsNull("buttontitle") ? string.Empty : row.Field <string>("buttontitle"); entity.tiptext = row.IsNull("tiptext") ? string.Empty : row.Field <string>("tiptext"); entity.parentmenu = row.IsNull("parentmenu") ? string.Empty : row.Field <string>("parentmenu"); entity.parentpos = row.IsNull("parentpos") ? 0 : row.Field <int>("parentpos"); entity.recordtype = row.IsNull("recordtype") ? string.Empty : row.Field <string>("recordtype"); entity.keyviewer = row.IsNull("keyviewer") ? string.Empty : row.Field <string>("keyviewer"); entity.nxtrendOurproc = row.IsNull("nxtrend_ourproc") ? string.Empty : row.Field <string>("nxtrend_ourproc"); entity.browsename = row.IsNull("browsename") ? string.Empty : row.Field <string>("browsename"); entity.website = row.IsNull("website") ? string.Empty : row.Field <string>("website"); entity.standardty = row.IsNull("standardty") ? string.Empty : row.Field <string>("standardty"); entity.crmsubject = row.IsNull("crmsubject") ? string.Empty : row.Field <string>("crmsubject"); entity.functionprocedure = row.IsNull("functionprocedure") ? string.Empty : row.Field <string>("functionprocedure"); entity.pvSassmRowid = row.Field <byte[]>("pv_sassm-rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }
/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAosystemmenuitem(ref DataRow row, Aosystemmenuitem entity) { row.SetField("menuset", entity.menuset); row.SetField("functionname", entity.functionname); row.SetField("trmgrlang", entity.trmgrlang); row.SetField("windowtitle", entity.windowtitle); row.SetField("min_security_level", entity.minSecurityLevel); row.SetField("menutitle", entity.menutitle); row.SetField("buttontitle", entity.buttontitle); row.SetField("tiptext", entity.tiptext); row.SetField("parentmenu", entity.parentmenu); row.SetField("parentpos", entity.parentpos); row.SetField("recordtype", entity.recordtype); row.SetField("keyviewer", entity.keyviewer); row.SetField("nxtrend_ourproc", entity.nxtrendOurproc); row.SetField("browsename", entity.browsename); row.SetField("website", entity.website); row.SetField("standardty", entity.standardty); row.SetField("crmsubject", entity.crmsubject); row.SetField("functionprocedure", entity.functionprocedure); row.SetField("pv_sassm-rowid", entity.pvSassmRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }