Пример #1
0
        public static Pdemgridupdatepdsc1 BuildPdemgridupdatepdsc1FromRow(DataRow row)
        {
            Pdemgridupdatepdsc1 entity = new Pdemgridupdatepdsc1();

            entity.updttype           = row.Field <bool>("updttype");
            entity.contractNo         = row.IsNull("ContractNo") ? string.Empty : row.Field <string>("ContractNo");
            entity.prctype            = row.Field <bool>("prctype");
            entity.priceSheet         = row.IsNull("PriceSheet") ? string.Empty : row.Field <string>("PriceSheet");
            entity.priceEffectiveDate = row.Field <DateTime?>("PriceEffectiveDate");
            entity.startdt            = row.Field <DateTime?>("startdt");
            entity.enddt          = row.Field <DateTime?>("enddt");
            entity.refer          = row.IsNull("refer") ? string.Empty : row.Field <string>("refer");
            entity.statustype     = row.IsNull("statustype") ? string.Empty : row.Field <string>("statustype");
            entity.qtybreakty     = row.IsNull("qtybreakty") ? string.Empty : row.Field <string>("qtybreakty");
            entity.priceonty      = row.IsNull("priceonty") ? string.Empty : row.Field <string>("priceonty");
            entity.prcmult1       = row.IsNull("prcmult1") ? decimal.Zero : row.Field <decimal>("prcmult1");
            entity.prcmult2       = row.IsNull("prcmult2") ? decimal.Zero : row.Field <decimal>("prcmult2");
            entity.prcmult3       = row.IsNull("prcmult3") ? decimal.Zero : row.Field <decimal>("prcmult3");
            entity.prcmult4       = row.IsNull("prcmult4") ? decimal.Zero : row.Field <decimal>("prcmult4");
            entity.prcmult5       = row.IsNull("prcmult5") ? decimal.Zero : row.Field <decimal>("prcmult5");
            entity.prcmult6       = row.IsNull("prcmult6") ? decimal.Zero : row.Field <decimal>("prcmult6");
            entity.prcmult7       = row.IsNull("prcmult7") ? decimal.Zero : row.Field <decimal>("prcmult7");
            entity.prcmult8       = row.IsNull("prcmult8") ? decimal.Zero : row.Field <decimal>("prcmult8");
            entity.prcmult9       = row.IsNull("prcmult9") ? decimal.Zero : row.Field <decimal>("prcmult9");
            entity.qtybrk1        = row.IsNull("qtybrk1") ? 0 : row.Field <int>("qtybrk1");
            entity.qtybrk2        = row.IsNull("qtybrk2") ? 0 : row.Field <int>("qtybrk2");
            entity.qtybrk3        = row.IsNull("qtybrk3") ? 0 : row.Field <int>("qtybrk3");
            entity.qtybrk4        = row.IsNull("qtybrk4") ? 0 : row.Field <int>("qtybrk4");
            entity.qtybrk5        = row.IsNull("qtybrk5") ? 0 : row.Field <int>("qtybrk5");
            entity.qtybrk6        = row.IsNull("qtybrk6") ? 0 : row.Field <int>("qtybrk6");
            entity.qtybrk7        = row.IsNull("qtybrk7") ? 0 : row.Field <int>("qtybrk7");
            entity.qtybrk8        = row.IsNull("qtybrk8") ? 0 : row.Field <int>("qtybrk8");
            entity.prcdisc1       = row.IsNull("prcdisc1") ? decimal.Zero : row.Field <decimal>("prcdisc1");
            entity.prcdisc2       = row.IsNull("prcdisc2") ? decimal.Zero : row.Field <decimal>("prcdisc2");
            entity.prcdisc3       = row.IsNull("prcdisc3") ? decimal.Zero : row.Field <decimal>("prcdisc3");
            entity.prcdisc4       = row.IsNull("prcdisc4") ? decimal.Zero : row.Field <decimal>("prcdisc4");
            entity.prcdisc5       = row.IsNull("prcdisc5") ? decimal.Zero : row.Field <decimal>("prcdisc5");
            entity.prcdisc6       = row.IsNull("prcdisc6") ? decimal.Zero : row.Field <decimal>("prcdisc6");
            entity.prcdisc7       = row.IsNull("prcdisc7") ? decimal.Zero : row.Field <decimal>("prcdisc7");
            entity.prcdisc8       = row.IsNull("prcdisc8") ? decimal.Zero : row.Field <decimal>("prcdisc8");
            entity.prcdisc9       = row.IsNull("prcdisc9") ? decimal.Zero : row.Field <decimal>("prcdisc9");
            entity.modifiernm     = row.IsNull("modifiernm") ? string.Empty : row.Field <string>("modifiernm");
            entity.modifierrebfl  = row.Field <bool>("modifierrebfl");
            entity.hardpricefl    = row.Field <bool>("hardpricefl");
            entity.hardmaxqtyfl   = row.Field <bool>("hardmaxqtyfl");
            entity.maxqty         = row.IsNull("maxqty") ? decimal.Zero : row.Field <decimal>("maxqty");
            entity.maxqtytype     = row.IsNull("maxqtytype") ? string.Empty : row.Field <string>("maxqtytype");
            entity.ovrridepctup   = row.IsNull("ovrridepctup") ? decimal.Zero : row.Field <decimal>("ovrridepctup");
            entity.ovrridepctdown = row.IsNull("ovrridepctdown") ? decimal.Zero : row.Field <decimal>("ovrridepctdown");
            entity.region         = row.IsNull("region") ? string.Empty : row.Field <string>("region");
            entity.pvPdmlineRowid = row.Field <byte[]>("pv_pdmline_rowid").ToStringEncoded();
            entity.userfield      = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Пример #2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromPdemgridupdatepdsc1(ref DataRow row, Pdemgridupdatepdsc1 entity)
 {
     row.SetField("updttype", entity.updttype);
     row.SetField("ContractNo", entity.contractNo);
     row.SetField("prctype", entity.prctype);
     row.SetField("PriceSheet", entity.priceSheet);
     row.SetField("PriceEffectiveDate", entity.priceEffectiveDate);
     row.SetField("startdt", entity.startdt);
     row.SetField("enddt", entity.enddt);
     row.SetField("refer", entity.refer);
     row.SetField("statustype", entity.statustype);
     row.SetField("qtybreakty", entity.qtybreakty);
     row.SetField("priceonty", entity.priceonty);
     row.SetField("prcmult1", entity.prcmult1);
     row.SetField("prcmult2", entity.prcmult2);
     row.SetField("prcmult3", entity.prcmult3);
     row.SetField("prcmult4", entity.prcmult4);
     row.SetField("prcmult5", entity.prcmult5);
     row.SetField("prcmult6", entity.prcmult6);
     row.SetField("prcmult7", entity.prcmult7);
     row.SetField("prcmult8", entity.prcmult8);
     row.SetField("prcmult9", entity.prcmult9);
     row.SetField("qtybrk1", entity.qtybrk1);
     row.SetField("qtybrk2", entity.qtybrk2);
     row.SetField("qtybrk3", entity.qtybrk3);
     row.SetField("qtybrk4", entity.qtybrk4);
     row.SetField("qtybrk5", entity.qtybrk5);
     row.SetField("qtybrk6", entity.qtybrk6);
     row.SetField("qtybrk7", entity.qtybrk7);
     row.SetField("qtybrk8", entity.qtybrk8);
     row.SetField("prcdisc1", entity.prcdisc1);
     row.SetField("prcdisc2", entity.prcdisc2);
     row.SetField("prcdisc3", entity.prcdisc3);
     row.SetField("prcdisc4", entity.prcdisc4);
     row.SetField("prcdisc5", entity.prcdisc5);
     row.SetField("prcdisc6", entity.prcdisc6);
     row.SetField("prcdisc7", entity.prcdisc7);
     row.SetField("prcdisc8", entity.prcdisc8);
     row.SetField("prcdisc9", entity.prcdisc9);
     row.SetField("modifiernm", entity.modifiernm);
     row.SetField("modifierrebfl", entity.modifierrebfl);
     row.SetField("hardpricefl", entity.hardpricefl);
     row.SetField("hardmaxqtyfl", entity.hardmaxqtyfl);
     row.SetField("maxqty", entity.maxqty);
     row.SetField("maxqtytype", entity.maxqtytype);
     row.SetField("ovrridepctup", entity.ovrridepctup);
     row.SetField("ovrridepctdown", entity.ovrridepctdown);
     row.SetField("region", entity.region);
     row.SetField("pv_pdmline_rowid", entity.pvPdmlineRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }