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

            entity.discty              = row.IsNull("discty") ? string.Empty : row.Field <string>("discty");
            entity.duety               = row.IsNull("duety") ? string.Empty : row.Field <string>("duety");
            entity.splitfl             = row.IsNull("splitfl") ? string.Empty : row.Field <string>("splitfl");
            entity.termspct            = row.IsNull("termspct") ? decimal.Zero : row.Field <decimal>("termspct");
            entity.termslinefl         = row.IsNull("termslinefl") ? string.Empty : row.Field <string>("termslinefl");
            entity.reqinvfl            = row.IsNull("reqinvfl") ? string.Empty : row.Field <string>("reqinvfl");
            entity.discdays            = row.IsNull("discdays") ? 0 : row.Field <int>("discdays");
            entity.discdt              = row.Field <DateTime?>("discdt");
            entity.disccutday          = row.IsNull("disccutday") ? 0 : row.Field <int>("disccutday");
            entity.proxmonths1         = row.IsNull("proxmonths1") ? 0 : row.Field <int>("proxmonths1");
            entity.proxmonths2         = row.IsNull("proxmonths2") ? 0 : row.Field <int>("proxmonths2");
            entity.discproxday1        = row.IsNull("discproxday1") ? 0 : row.Field <int>("discproxday1");
            entity.discproxday2        = row.IsNull("discproxday2") ? 0 : row.Field <int>("discproxday2");
            entity.dueproxday1         = row.IsNull("dueproxday1") ? 0 : row.Field <int>("dueproxday1");
            entity.dueproxday2         = row.IsNull("dueproxday2") ? 0 : row.Field <int>("dueproxday2");
            entity.termscodfl          = row.IsNull("termscodfl") ? string.Empty : row.Field <string>("termscodfl");
            entity.returnty            = row.IsNull("returnty") ? string.Empty : row.Field <string>("returnty");
            entity.duedays             = row.IsNull("duedays") ? 0 : row.Field <int>("duedays");
            entity.duedt               = row.Field <DateTime?>("duedt");
            entity.duecutday           = row.IsNull("duecutday") ? 0 : row.Field <int>("duecutday");
            entity.nopaymts            = row.IsNull("nopaymts") ? 0 : row.Field <int>("nopaymts");
            entity.termsfreq           = row.IsNull("termsfreq") ? 0 : row.Field <int>("termsfreq");
            entity.discsplitfl         = row.IsNull("discsplitfl") ? string.Empty : row.Field <string>("discsplitfl");
            entity.edidtcd             = row.IsNull("edidtcd") ? string.Empty : row.Field <string>("edidtcd");
            entity.editpcd             = row.IsNull("editpcd") ? string.Empty : row.Field <string>("editpcd");
            entity.cconlyfl            = row.IsNull("cconlyfl") ? string.Empty : row.Field <string>("cconlyfl");
            entity.dnbiinterfacefl     = row.IsNull("dnbiinterfacefl") ? string.Empty : row.Field <string>("dnbiinterfacefl");
            entity.dnbicredlim         = row.IsNull("dnbicredlim") ? decimal.Zero : row.Field <decimal>("dnbicredlim");
            entity.lccinstalled        = row.Field <bool>("lccinstalled");
            entity.termspctenabled     = row.Field <bool>("termspctenabled");
            entity.termslineflenabled  = row.Field <bool>("termslineflenabled");
            entity.reqinvflenabled     = row.Field <bool>("reqinvflenabled");
            entity.discdaysenabled     = row.Field <bool>("discdaysenabled");
            entity.discdtenabled       = row.Field <bool>("discdtenabled");
            entity.disccutdayenabled   = row.Field <bool>("disccutdayenabled");
            entity.proxmonths1enabled  = row.Field <bool>("proxmonths1enabled");
            entity.proxmonths2enabled  = row.Field <bool>("proxmonths2enabled");
            entity.discproxday1enabled = row.Field <bool>("discproxday1enabled");
            entity.discproxday2enabled = row.Field <bool>("discproxday2enabled");
            entity.dueproxday1enabled  = row.Field <bool>("dueproxday1enabled");
            entity.dueproxday2enabled  = row.Field <bool>("dueproxday2enabled");
            entity.termscodflenabled   = row.Field <bool>("termscodflenabled");
            entity.returntyenabled     = row.Field <bool>("returntyenabled");
            entity.duedaysenabled      = row.Field <bool>("duedaysenabled");
            entity.duedtenabled        = row.Field <bool>("duedtenabled");
            entity.duecutdayenabled    = row.Field <bool>("duecutdayenabled");
            entity.nopaymtsenabled     = row.Field <bool>("nopaymtsenabled");
            entity.termsfreqenabled    = row.Field <bool>("termsfreqenabled");
            entity.discsplitflenabled  = row.Field <bool>("discsplitflenabled");
            entity.edidtcdenabled      = row.Field <bool>("edidtcdenabled");
            entity.editpcdenabled      = row.Field <bool>("editpcdenabled");
            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 UpdateRowFromSasttterms(ref DataRow row, Sasttterms entity)
 {
     row.SetField("discty", entity.discty);
     row.SetField("duety", entity.duety);
     row.SetField("splitfl", entity.splitfl);
     row.SetField("termspct", entity.termspct);
     row.SetField("termslinefl", entity.termslinefl);
     row.SetField("reqinvfl", entity.reqinvfl);
     row.SetField("discdays", entity.discdays);
     row.SetField("discdt", entity.discdt);
     row.SetField("disccutday", entity.disccutday);
     row.SetField("proxmonths1", entity.proxmonths1);
     row.SetField("proxmonths2", entity.proxmonths2);
     row.SetField("discproxday1", entity.discproxday1);
     row.SetField("discproxday2", entity.discproxday2);
     row.SetField("dueproxday1", entity.dueproxday1);
     row.SetField("dueproxday2", entity.dueproxday2);
     row.SetField("termscodfl", entity.termscodfl);
     row.SetField("returnty", entity.returnty);
     row.SetField("duedays", entity.duedays);
     row.SetField("duedt", entity.duedt);
     row.SetField("duecutday", entity.duecutday);
     row.SetField("nopaymts", entity.nopaymts);
     row.SetField("termsfreq", entity.termsfreq);
     row.SetField("discsplitfl", entity.discsplitfl);
     row.SetField("edidtcd", entity.edidtcd);
     row.SetField("editpcd", entity.editpcd);
     row.SetField("cconlyfl", entity.cconlyfl);
     row.SetField("dnbiinterfacefl", entity.dnbiinterfacefl);
     row.SetField("dnbicredlim", entity.dnbicredlim);
     row.SetField("lccinstalled", entity.lccinstalled);
     row.SetField("termspctenabled", entity.termspctenabled);
     row.SetField("termslineflenabled", entity.termslineflenabled);
     row.SetField("reqinvflenabled", entity.reqinvflenabled);
     row.SetField("discdaysenabled", entity.discdaysenabled);
     row.SetField("discdtenabled", entity.discdtenabled);
     row.SetField("disccutdayenabled", entity.disccutdayenabled);
     row.SetField("proxmonths1enabled", entity.proxmonths1enabled);
     row.SetField("proxmonths2enabled", entity.proxmonths2enabled);
     row.SetField("discproxday1enabled", entity.discproxday1enabled);
     row.SetField("discproxday2enabled", entity.discproxday2enabled);
     row.SetField("dueproxday1enabled", entity.dueproxday1enabled);
     row.SetField("dueproxday2enabled", entity.dueproxday2enabled);
     row.SetField("termscodflenabled", entity.termscodflenabled);
     row.SetField("returntyenabled", entity.returntyenabled);
     row.SetField("duedaysenabled", entity.duedaysenabled);
     row.SetField("duedtenabled", entity.duedtenabled);
     row.SetField("duecutdayenabled", entity.duecutdayenabled);
     row.SetField("nopaymtsenabled", entity.nopaymtsenabled);
     row.SetField("termsfreqenabled", entity.termsfreqenabled);
     row.SetField("discsplitflenabled", entity.discsplitflenabled);
     row.SetField("edidtcdenabled", entity.edidtcdenabled);
     row.SetField("editpcdenabled", entity.editpcdenabled);
     row.SetField("userfield", entity.userfield);
 }