/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromAppocostingresults(ref DataRow row, Appocostingresults entity) { row.SetField("jrnlno", entity.jrnlno); row.SetField("setno", entity.setno); row.SetField("lineno", entity.lineno); row.SetField("ponosort", entity.ponosort); row.SetField("posufsort", entity.posufsort); row.SetField("ponumber", entity.ponumber); row.SetField("ponotesfl", entity.ponotesfl); row.SetField("prod", entity.prod); row.SetField("prodnotesfl", entity.prodnotesfl); row.SetField("proddesc", entity.proddesc); row.SetField("qtycost", entity.qtycost); row.SetField("cost", entity.cost); row.SetField("paidfl", entity.paidfl); row.SetField("qtyord", entity.qtyord); row.SetField("qtyrecv", entity.qtyrecv); row.SetField("user1", entity.user1); row.SetField("user2", entity.user2); row.SetField("user3", entity.user3); row.SetField("user4", entity.user4); row.SetField("user5", entity.user5); row.SetField("user6", entity.user6); row.SetField("user7", entity.user7); row.SetField("user8", entity.user8); row.SetField("user9", entity.user9); }
public static Appocostingresults BuildAppocostingresultsFromRow(DataRow row) { Appocostingresults entity = new Appocostingresults(); entity.jrnlno = row.IsNull("jrnlno") ? 0 : row.Field <int>("jrnlno"); entity.setno = row.IsNull("setno") ? 0 : row.Field <int>("setno"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.ponosort = row.IsNull("ponosort") ? 0 : row.Field <int>("ponosort"); entity.posufsort = row.IsNull("posufsort") ? 0 : row.Field <int>("posufsort"); entity.ponumber = row.IsNull("ponumber") ? string.Empty : row.Field <string>("ponumber"); entity.ponotesfl = row.IsNull("ponotesfl") ? string.Empty : row.Field <string>("ponotesfl"); entity.prod = row.IsNull("prod") ? string.Empty : row.Field <string>("prod"); entity.prodnotesfl = row.IsNull("prodnotesfl") ? string.Empty : row.Field <string>("prodnotesfl"); entity.proddesc = row.IsNull("proddesc") ? string.Empty : row.Field <string>("proddesc"); entity.qtycost = row.IsNull("qtycost") ? decimal.Zero : row.Field <decimal>("qtycost"); entity.cost = row.IsNull("cost") ? decimal.Zero : row.Field <decimal>("cost"); entity.paidfl = row.Field <bool>("paidfl"); entity.qtyord = row.IsNull("qtyord") ? string.Empty : row.Field <string>("qtyord"); entity.qtyrecv = row.IsNull("qtyrecv") ? string.Empty : row.Field <string>("qtyrecv"); entity.user1 = row.IsNull("user1") ? string.Empty : row.Field <string>("user1"); entity.user2 = row.IsNull("user2") ? string.Empty : row.Field <string>("user2"); entity.user3 = row.IsNull("user3") ? string.Empty : row.Field <string>("user3"); entity.user4 = row.IsNull("user4") ? string.Empty : row.Field <string>("user4"); entity.user5 = row.IsNull("user5") ? string.Empty : row.Field <string>("user5"); entity.user6 = row.Field <decimal?>("user6"); entity.user7 = row.Field <decimal?>("user7"); entity.user8 = row.Field <DateTime?>("user8"); entity.user9 = row.Field <DateTime?>("user9"); return(entity); }