示例#1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdcreateprcrecord(ref DataRow row, Pdcreateprcrecord entity)
 {
     row.SetField("prod", entity.prod);
     row.SetField("whse", entity.whse);
     row.SetField("custno", entity.custno);
     row.SetField("shipto", entity.shipto);
     row.SetField("unit", entity.unit);
     row.SetField("qty", entity.qty);
     row.SetField("jobfl", entity.jobfl);
     row.SetField("whsefl", entity.whsefl);
     row.SetField("quoteno", entity.quoteno);
     row.SetField("jobno", entity.jobno);
     row.SetField("enddt", entity.enddt);
     row.SetField("updateexistingfl", entity.updateexistingfl);
     row.SetField("prcwrkshtdiscfl", entity.prcwrkshtdiscfl);
     row.SetField("prcwrkshtmdiscamt", entity.prcwrkshtmdiscamt);
     row.SetField("prcwrkshtmdiscpct", entity.prcwrkshtmdiscpct);
     row.SetField("prcwrkshtmprice", entity.prcwrkshtmprice);
     row.SetField("prcwrkshtmmargin", entity.prcwrkshtmmargin);
     row.SetField("prcwrkshtmcostplus", entity.prcwrkshtmcostplus);
 }
示例#2
0
        public static Pdcreateprcrecord BuildPdcreateprcrecordFromRow(DataRow row)
        {
            Pdcreateprcrecord entity = new Pdcreateprcrecord();

            entity.prod               = row.IsNull("prod") ? string.Empty : row.Field <string>("prod");
            entity.whse               = row.IsNull("whse") ? string.Empty : row.Field <string>("whse");
            entity.custno             = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.shipto             = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.unit               = row.IsNull("unit") ? string.Empty : row.Field <string>("unit");
            entity.qty                = row.IsNull("qty") ? decimal.Zero : row.Field <decimal>("qty");
            entity.jobfl              = row.Field <bool>("jobfl");
            entity.whsefl             = row.Field <bool>("whsefl");
            entity.quoteno            = row.IsNull("quoteno") ? string.Empty : row.Field <string>("quoteno");
            entity.jobno              = row.IsNull("jobno") ? string.Empty : row.Field <string>("jobno");
            entity.enddt              = row.Field <DateTime?>("enddt");
            entity.updateexistingfl   = row.Field <bool>("updateexistingfl");
            entity.prcwrkshtdiscfl    = row.Field <bool>("prcwrkshtdiscfl");
            entity.prcwrkshtmdiscamt  = row.IsNull("prcwrkshtmdiscamt") ? decimal.Zero : row.Field <decimal>("prcwrkshtmdiscamt");
            entity.prcwrkshtmdiscpct  = row.IsNull("prcwrkshtmdiscpct") ? decimal.Zero : row.Field <decimal>("prcwrkshtmdiscpct");
            entity.prcwrkshtmprice    = row.IsNull("prcwrkshtmprice") ? decimal.Zero : row.Field <decimal>("prcwrkshtmprice");
            entity.prcwrkshtmmargin   = row.IsNull("prcwrkshtmmargin") ? decimal.Zero : row.Field <decimal>("prcwrkshtmmargin");
            entity.prcwrkshtmcostplus = row.IsNull("prcwrkshtmcostplus") ? decimal.Zero : row.Field <decimal>("prcwrkshtmcostplus");
            return(entity);
        }