/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromCorereturnautoalloc(ref DataRow row, Corereturnautoalloc entity) { row.SetField("mOrderNo", entity.mOrderNo); row.SetField("mOrdersuf", entity.mOrdersuf); row.SetField("mCurrentLineno", entity.mCurrentLineno); row.SetField("cCoreType", entity.cCoreType); row.SetField("iRetOrderNo", entity.iRetOrderNo); row.SetField("iRetOrdersuf", entity.iRetOrdersuf); row.SetField("iRetLineNo", entity.iRetLineNo); row.SetField("cCallMode", entity.cCallMode); row.SetField("cProd", entity.cProd); row.SetField("mCustno", entity.mCustno); row.SetField("dStkQtyOrd", entity.dStkQtyOrd); row.SetField("iImplyQty", entity.iImplyQty); row.SetField("speccostty", entity.speccostty); row.SetField("csunperstk", entity.csunperstk); row.SetField("userfield", entity.userfield); }
public static Corereturnautoalloc BuildCorereturnautoallocFromRow(DataRow row) { Corereturnautoalloc entity = new Corereturnautoalloc(); entity.mOrderNo = row.IsNull("mOrderNo") ? 0 : row.Field <int>("mOrderNo"); entity.mOrdersuf = row.IsNull("mOrdersuf") ? 0 : row.Field <int>("mOrdersuf"); entity.mCurrentLineno = row.IsNull("mCurrentLineno") ? 0 : row.Field <int>("mCurrentLineno"); entity.cCoreType = row.IsNull("cCoreType") ? string.Empty : row.Field <string>("cCoreType"); entity.iRetOrderNo = row.IsNull("iRetOrderNo") ? 0 : row.Field <int>("iRetOrderNo"); entity.iRetOrdersuf = row.IsNull("iRetOrdersuf") ? 0 : row.Field <int>("iRetOrdersuf"); entity.iRetLineNo = row.IsNull("iRetLineNo") ? 0 : row.Field <int>("iRetLineNo"); entity.cCallMode = row.IsNull("cCallMode") ? string.Empty : row.Field <string>("cCallMode"); entity.cProd = row.IsNull("cProd") ? string.Empty : row.Field <string>("cProd"); entity.mCustno = row.IsNull("mCustno") ? decimal.Zero : row.Field <decimal>("mCustno"); entity.dStkQtyOrd = row.IsNull("dStkQtyOrd") ? decimal.Zero : row.Field <decimal>("dStkQtyOrd"); entity.iImplyQty = row.IsNull("iImplyQty") ? decimal.Zero : row.Field <decimal>("iImplyQty"); entity.speccostty = row.IsNull("speccostty") ? string.Empty : row.Field <string>("speccostty"); entity.csunperstk = row.IsNull("csunperstk") ? decimal.Zero : row.Field <decimal>("csunperstk"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }