/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPdemgridupdatepdsr(ref DataRow row, Pdemgridupdatepdsr entity) { row.SetField("updttype", entity.updttype); row.SetField("ContractNo", entity.contractNo); row.SetField("startdt", entity.startdt); row.SetField("enddt", entity.enddt); row.SetField("rebcalcty", entity.rebcalcty); row.SetField("margincostty", entity.margincostty); row.SetField("rebatecostty", entity.rebatecostty); row.SetField("rebdowntoty", entity.rebdowntoty); row.SetField("rebateamt", entity.rebateamt); row.SetField("rebatepct", entity.rebatepct); row.SetField("PriceSheet", entity.priceSheet); row.SetField("PriceEffectiveDate", entity.priceEffectiveDate); row.SetField("PriceSheetTo", entity.priceSheetTo); row.SetField("PriceEffectiveDateTo", entity.priceEffectiveDateTo); row.SetField("refer", entity.refer); row.SetField("sharefl", entity.sharefl); row.SetField("sharepct", entity.sharepct); row.SetField("capsellamount", entity.capsellamount); row.SetField("capselltypefl", entity.capselltypefl); row.SetField("manualfl", entity.manualfl); row.SetField("contractlineno", entity.contractlineno); row.SetField("region", entity.region); row.SetField("contractcostfl", entity.contractcostfl); row.SetField("pv_pdmline_rowid", entity.pvPdmlineRowid.ToByteArray()); row.SetField("userfield", entity.userfield); }
public static Pdemgridupdatepdsr BuildPdemgridupdatepdsrFromRow(DataRow row) { Pdemgridupdatepdsr entity = new Pdemgridupdatepdsr(); entity.updttype = row.Field <bool>("updttype"); entity.contractNo = row.IsNull("ContractNo") ? string.Empty : row.Field <string>("ContractNo"); entity.startdt = row.Field <DateTime?>("startdt"); entity.enddt = row.Field <DateTime?>("enddt"); entity.rebcalcty = row.IsNull("rebcalcty") ? string.Empty : row.Field <string>("rebcalcty"); entity.margincostty = row.IsNull("margincostty") ? string.Empty : row.Field <string>("margincostty"); entity.rebatecostty = row.IsNull("rebatecostty") ? string.Empty : row.Field <string>("rebatecostty"); entity.rebdowntoty = row.IsNull("rebdowntoty") ? string.Empty : row.Field <string>("rebdowntoty"); entity.rebateamt = row.IsNull("rebateamt") ? decimal.Zero : row.Field <decimal>("rebateamt"); entity.rebatepct = row.IsNull("rebatepct") ? decimal.Zero : row.Field <decimal>("rebatepct"); entity.priceSheet = row.IsNull("PriceSheet") ? string.Empty : row.Field <string>("PriceSheet"); entity.priceEffectiveDate = row.Field <DateTime?>("PriceEffectiveDate"); entity.priceSheetTo = row.IsNull("PriceSheetTo") ? string.Empty : row.Field <string>("PriceSheetTo"); entity.priceEffectiveDateTo = row.Field <DateTime?>("PriceEffectiveDateTo"); entity.refer = row.IsNull("refer") ? string.Empty : row.Field <string>("refer"); entity.sharefl = row.Field <bool>("sharefl"); entity.sharepct = row.IsNull("sharepct") ? decimal.Zero : row.Field <decimal>("sharepct"); entity.capsellamount = row.IsNull("capsellamount") ? decimal.Zero : row.Field <decimal>("capsellamount"); entity.capselltypefl = row.Field <bool>("capselltypefl"); entity.manualfl = row.Field <bool>("manualfl"); entity.contractlineno = row.IsNull("contractlineno") ? 0 : row.Field <int>("contractlineno"); entity.region = row.IsNull("region") ? string.Empty : row.Field <string>("region"); entity.contractcostfl = row.Field <bool>("contractcostfl"); entity.pvPdmlineRowid = row.Field <byte[]>("pv_pdmline_rowid").ToStringEncoded(); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }