/// <summary> /// Update a database row from a class /// </summary> public static void UpdateRowFromPorrarlineprogbuy(ref DataRow row, Porrarlineprogbuy entity) { row.SetField("cono", entity.cono); row.SetField("reportno", entity.reportno); row.SetField("lineno", entity.lineno); row.SetField("seqno", entity.seqno); row.SetField("fiallocqty", entity.fiallocqty); row.SetField("fiprice", entity.fiprice); row.SetField("fiprod", entity.fiprod); row.SetField("fiproddesc", entity.fiproddesc); row.SetField("fiqty", entity.fiqty); row.SetField("fiunitstock", entity.fiunitstock); row.SetField("icspecrecno", entity.icspecrecno); row.SetField("dunitconv", entity.dunitconv); row.SetField("dqtyord", entity.dqtyord); row.SetField("userfield", entity.userfield); }
public static Porrarlineprogbuy BuildPorrarlineprogbuyFromRow(DataRow row) { Porrarlineprogbuy entity = new Porrarlineprogbuy(); entity.cono = row.IsNull("cono") ? 0 : row.Field <int>("cono"); entity.reportno = row.IsNull("reportno") ? 0 : row.Field <int>("reportno"); entity.lineno = row.IsNull("lineno") ? 0 : row.Field <int>("lineno"); entity.seqno = row.IsNull("seqno") ? 0 : row.Field <int>("seqno"); entity.fiallocqty = row.IsNull("fiallocqty") ? decimal.Zero : row.Field <decimal>("fiallocqty"); entity.fiprice = row.IsNull("fiprice") ? decimal.Zero : row.Field <decimal>("fiprice"); entity.fiprod = row.IsNull("fiprod") ? string.Empty : row.Field <string>("fiprod"); entity.fiproddesc = row.IsNull("fiproddesc") ? string.Empty : row.Field <string>("fiproddesc"); entity.fiqty = row.IsNull("fiqty") ? decimal.Zero : row.Field <decimal>("fiqty"); entity.fiunitstock = row.IsNull("fiunitstock") ? string.Empty : row.Field <string>("fiunitstock"); entity.icspecrecno = row.IsNull("icspecrecno") ? 0 : row.Field <int>("icspecrecno"); entity.dunitconv = row.IsNull("dunitconv") ? decimal.Zero : row.Field <decimal>("dunitconv"); entity.dqtyord = row.IsNull("dqtyord") ? decimal.Zero : row.Field <decimal>("dqtyord"); entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield"); return(entity); }