/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromSastcnotes(ref DataRow row, Sastcnotes entity) { row.SetField("currencyty", entity.currencyty); row.SetField("changetype", entity.changetype); row.SetField("changedt", entity.changedt); row.SetField("changetm", entity.changetm); row.SetField("changenote", entity.changenote); row.SetField("glno", entity.glno); row.SetField("rvglno", entity.rvglno); row.SetField("edicurrency", entity.edicurrency); row.SetField("draftfl", entity.draftfl); row.SetField("newexrate", entity.newexrate); row.SetField("oldexrate", entity.oldexrate); row.SetField("ratesource", entity.ratesource); row.SetField("glacctno", entity.glacctno); row.SetField("gldeptno", entity.gldeptno); row.SetField("gldivno", entity.gldivno); row.SetField("glsubno", entity.glsubno); row.SetField("rvglacctno", entity.rvglacctno); row.SetField("rvgldeptno", entity.rvgldeptno); row.SetField("rvgldivno", entity.rvgldivno); row.SetField("rvglsubno", entity.rvglsubno); row.SetField("operinit", entity.operinit); row.SetField("transdt", entity.transdt); row.SetField("transtm", entity.transtm); row.SetField("userfield", entity.userfield); }
public static Sastcnotes BuildSastcnotesFromRow(DataRow row) { Sastcnotes entity = new Sastcnotes(); entity.currencyty = row.IsNull("currencyty") ? string.Empty : row.Field <string>("currencyty"); entity.changetype = row.IsNull("changetype") ? string.Empty : row.Field <string>("changetype"); entity.changedt = row.Field <DateTime?>("changedt"); entity.changetm = row.IsNull("changetm") ? string.Empty : row.Field <string>("changetm"); entity.changenote = row.IsNull("changenote") ? string.Empty : row.Field <string>("changenote"); entity.glno = row.IsNull("glno") ? string.Empty : row.Field <string>("glno"); entity.rvglno = row.IsNull("rvglno") ? string.Empty : row.Field <string>("rvglno"); entity.edicurrency = row.IsNull("edicurrency") ? string.Empty : row.Field <string>("edicurrency"); entity.draftfl = row.Field <bool>("draftfl"); entity.newexrate = row.IsNull("newexrate") ? decimal.Zero : row.Field <decimal>("newexrate"); entity.oldexrate = row.IsNull("oldexrate") ? decimal.Zero : row.Field <decimal>("oldexrate"); entity.ratesource = row.IsNull("ratesource") ? string.Empty : row.Field <string>("ratesource"); entity.glacctno = row.IsNull("glacctno") ? 0 : row.Field <int>("glacctno"); entity.gldeptno = row.IsNull("gldeptno") ? 0 : row.Field <int>("gldeptno"); entity.gldivno = row.IsNull("gldivno") ? 0 : row.Field <int>("gldivno"); entity.glsubno = row.IsNull("glsubno") ? 0 : row.Field <int>("glsubno"); entity.rvglacctno = row.IsNull("rvglacctno") ? 0 : row.Field <int>("rvglacctno"); entity.rvgldeptno = row.IsNull("rvgldeptno") ? 0 : row.Field <int>("rvgldeptno"); entity.rvgldivno = row.IsNull("rvgldivno") ? 0 : row.Field <int>("rvgldivno"); entity.rvglsubno = row.IsNull("rvglsubno") ? 0 : row.Field <int>("rvglsubno"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.transdt = row.Field <DateTime?>("transdt"); entity.transtm = row.IsNull("transtm") ? string.Empty : row.Field <string>("transtm"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }