/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromArecewodata(ref DataRow row, Arecewodata entity) { row.SetField("aretid", entity.aretid); row.SetField("amount", entity.amount); row.SetField("creditwofl", entity.creditwofl); row.SetField("custno", entity.custno); row.SetField("discamt", entity.discamt); row.SetField("divno", entity.divno); row.SetField("gldivfl", entity.gldivfl); row.SetField("invno", entity.invno); row.SetField("invsuf", entity.invsuf); row.SetField("invseq", entity.invseq); row.SetField("jrnlno", entity.jrnlno); row.SetField("oneinvoice", entity.oneinvoice); row.SetField("selectedfl", entity.selectedfl); row.SetField("webuifilter", entity.webuifilter); row.SetField("areledtlrowid", entity.areledtlrowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Arecewodata BuildArecewodataFromRow(DataRow row) { Arecewodata entity = new Arecewodata(); entity.aretid = row.IsNull("aretid") ? 0 : row.Field <long>("aretid"); entity.amount = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount"); entity.creditwofl = row.Field <bool>("creditwofl"); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.discamt = row.IsNull("discamt") ? decimal.Zero : row.Field <decimal>("discamt"); entity.divno = row.IsNull("divno") ? 0 : row.Field <int>("divno"); entity.gldivfl = row.Field <bool>("gldivfl"); entity.invno = row.IsNull("invno") ? string.Empty : row.Field <string>("invno"); entity.invsuf = row.IsNull("invsuf") ? string.Empty : row.Field <string>("invsuf"); entity.invseq = row.IsNull("invseq") ? string.Empty : row.Field <string>("invseq"); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.oneinvoice = row.Field <bool>("oneinvoice"); entity.selectedfl = row.Field <bool>("selectedfl"); entity.webuifilter = row.IsNull("webuifilter") ? string.Empty : row.Field <string>("webuifilter"); entity.areledtlrowid = row.Field <byte[]>("areledtlrowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }