/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromIcsocresults(ref DataRow row, Icsocresults entity) { row.SetField("custno", entity.custno); row.SetField("custtype", entity.custtype); row.SetField("daymo", entity.daymo); row.SetField("daymofl", entity.daymofl); row.SetField("levelcd", entity.levelcd); row.SetField("operinit", entity.operinit); row.SetField("pricetype", entity.pricetype); row.SetField("shipto", entity.shipto); row.SetField("whse", entity.whse); row.SetField("custnotesfl", entity.custnotesfl); row.SetField("shiptonotesfl", entity.shiptonotesfl); row.SetField("icsocrowid", entity.icsocrowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Icsocresults BuildIcsocresultsFromRow(DataRow row) { Icsocresults entity = new Icsocresults(); entity.custno = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno"); entity.custtype = row.IsNull("custtype") ? string.Empty : row.Field <string>("custtype"); entity.daymo = row.IsNull("daymo") ? 0 : row.Field <int>("daymo"); entity.daymofl = row.Field <bool>("daymofl"); entity.levelcd = row.IsNull("levelcd") ? 0 : row.Field <int>("levelcd"); entity.operinit = row.IsNull("operinit") ? string.Empty : row.Field <string>("operinit"); entity.pricetype = row.IsNull("pricetype") ? string.Empty : row.Field <string>("pricetype"); entity.shipto = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto"); entity.whse = row.IsNull("whse") ? string.Empty : row.Field <string>("whse"); entity.custnotesfl = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl"); entity.shiptonotesfl = row.IsNull("shiptonotesfl") ? string.Empty : row.Field <string>("shiptonotesfl"); entity.icsocrowid = row.Field <byte[]>("icsocrowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }