Esempio n. 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSastooeaddon(ref DataRow row, Sastooeaddon entity)
 {
     row.SetField("codeval", entity.codeval);
     row.SetField("descrip", entity.descrip);
     row.SetField("addonamt", entity.addonamt);
     row.SetField("addonmin", entity.addonmin);
     row.SetField("addontype", entity.addontype);
     row.SetField("addonzero", entity.addonzero);
     row.SetField("frghtcalcty", entity.frghtcalcty);
     row.SetField("zipcd", entity.zipcd);
     row.SetField("addonmax", entity.addonmax);
     row.SetField("cglno", entity.cglno);
     row.SetField("cgldesc", entity.cgldesc);
     row.SetField("sastnrowid", entity.sastnrowid.ToByteArray());
     row.SetField("cCurrSymbol", entity.cCurrSymbol);
     row.SetField("multlang-enabled", entity.multlangEnabled);
     row.SetField("state", entity.state);
     row.SetField("ehffl", entity.ehffl);
     row.SetField("user1", entity.user1);
     row.SetField("user2", entity.user2);
     row.SetField("user3", entity.user3);
     row.SetField("user4", entity.user4);
     row.SetField("user5", entity.user5);
     row.SetField("user6", entity.user6);
     row.SetField("user7", entity.user7);
     row.SetField("user8", entity.user8);
     row.SetField("user9", entity.user9);
     row.SetField("userfield", entity.userfield);
 }
Esempio n. 2
0
        public static Sastooeaddon BuildSastooeaddonFromRow(DataRow row)
        {
            Sastooeaddon entity = new Sastooeaddon();

            entity.codeval         = row.IsNull("codeval") ? 0 : row.Field <int>("codeval");
            entity.descrip         = row.IsNull("descrip") ? string.Empty : row.Field <string>("descrip");
            entity.addonamt        = row.IsNull("addonamt") ? decimal.Zero : row.Field <decimal>("addonamt");
            entity.addonmin        = row.IsNull("addonmin") ? decimal.Zero : row.Field <decimal>("addonmin");
            entity.addontype       = row.Field <bool>("addontype");
            entity.addonzero       = row.IsNull("addonzero") ? decimal.Zero : row.Field <decimal>("addonzero");
            entity.frghtcalcty     = row.IsNull("frghtcalcty") ? string.Empty : row.Field <string>("frghtcalcty");
            entity.zipcd           = row.IsNull("zipcd") ? string.Empty : row.Field <string>("zipcd");
            entity.addonmax        = row.IsNull("addonmax") ? decimal.Zero : row.Field <decimal>("addonmax");
            entity.cglno           = row.IsNull("cglno") ? string.Empty : row.Field <string>("cglno");
            entity.cgldesc         = row.IsNull("cgldesc") ? string.Empty : row.Field <string>("cgldesc");
            entity.sastnrowid      = row.Field <byte[]>("sastnrowid").ToStringEncoded();
            entity.cCurrSymbol     = row.IsNull("cCurrSymbol") ? string.Empty : row.Field <string>("cCurrSymbol");
            entity.multlangEnabled = row.Field <bool>("multlang-enabled");
            entity.state           = row.IsNull("state") ? string.Empty : row.Field <string>("state");
            entity.ehffl           = row.Field <bool>("ehffl");
            entity.user1           = row.IsNull("user1") ? string.Empty : row.Field <string>("user1");
            entity.user2           = row.IsNull("user2") ? string.Empty : row.Field <string>("user2");
            entity.user3           = row.IsNull("user3") ? string.Empty : row.Field <string>("user3");
            entity.user4           = row.IsNull("user4") ? string.Empty : row.Field <string>("user4");
            entity.user5           = row.IsNull("user5") ? string.Empty : row.Field <string>("user5");
            entity.user6           = row.Field <decimal?>("user6");
            entity.user7           = row.Field <decimal?>("user7");
            entity.user8           = row.Field <DateTime?>("user8");
            entity.user9           = row.Field <DateTime?>("user9");
            entity.userfield       = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }