Exemplo n.º 1
0
        public static Oeircustomercreditresults BuildOeircustomercreditresultsFromRow(DataRow row)
        {
            Oeircustomercreditresults entity = new Oeircustomercreditresults();

            entity.custno            = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.orderno           = row.IsNull("orderno") ? 0 : row.Field <int>("orderno");
            entity.ordersuf          = row.IsNull("ordersuf") ? 0 : row.Field <int>("ordersuf");
            entity.fpcustfl          = row.Field <bool>("fpcustfl");
            entity.name              = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.apmgr             = row.IsNull("apmgr") ? string.Empty : row.Field <string>("apmgr");
            entity.phoneno           = row.IsNull("phoneno") ? string.Empty : row.Field <string>("phoneno");
            entity.totalinvamount    = row.IsNull("totalinvamount") ? decimal.Zero : row.Field <decimal>("totalinvamount");
            entity.totaldue          = row.IsNull("totaldue") ? decimal.Zero : row.Field <decimal>("totaldue");
            entity.credtext          = row.IsNull("credtext") ? string.Empty : row.Field <string>("credtext");
            entity.period1           = row.IsNull("period1") ? decimal.Zero : row.Field <decimal>("period1");
            entity.period1label      = row.IsNull("period1label") ? string.Empty : row.Field <string>("period1label");
            entity.period2           = row.IsNull("period2") ? decimal.Zero : row.Field <decimal>("period2");
            entity.period2label      = row.IsNull("period2label") ? string.Empty : row.Field <string>("period2label");
            entity.period3           = row.IsNull("period3") ? decimal.Zero : row.Field <decimal>("period3");
            entity.period3label      = row.IsNull("period3label") ? string.Empty : row.Field <string>("period3label");
            entity.period4           = row.IsNull("period4") ? decimal.Zero : row.Field <decimal>("period4");
            entity.period4label      = row.IsNull("period4label") ? string.Empty : row.Field <string>("period4label");
            entity.period5           = row.IsNull("period5") ? decimal.Zero : row.Field <decimal>("period5");
            entity.period5label      = row.IsNull("period5label") ? string.Empty : row.Field <string>("period5label");
            entity.futbal            = row.IsNull("futbal") ? decimal.Zero : row.Field <decimal>("futbal");
            entity.futballabel       = row.IsNull("futballabel") ? string.Empty : row.Field <string>("futballabel");
            entity.approved          = row.IsNull("approved") ? decimal.Zero : row.Field <decimal>("approved");
            entity.approvedlabel     = row.IsNull("approvedlabel") ? string.Empty : row.Field <string>("approvedlabel");
            entity.totalbal1         = row.IsNull("totalbal1") ? decimal.Zero : row.Field <decimal>("totalbal1");
            entity.totalbal1label    = row.IsNull("totalbal1label") ? string.Empty : row.Field <string>("totalbal1label");
            entity.totalbal2         = row.IsNull("totalbal2") ? decimal.Zero : row.Field <decimal>("totalbal2");
            entity.totalbal2label    = row.IsNull("totalbal2label") ? string.Empty : row.Field <string>("totalbal2label");
            entity.totalbal3         = row.IsNull("totalbal3") ? decimal.Zero : row.Field <decimal>("totalbal3");
            entity.totalbal3label    = row.IsNull("totalbal3label") ? string.Empty : row.Field <string>("totalbal3label");
            entity.totalbal4         = row.IsNull("totalbal4") ? decimal.Zero : row.Field <decimal>("totalbal4");
            entity.totalbal4label    = row.IsNull("totalbal4label") ? string.Empty : row.Field <string>("totalbal4label");
            entity.totalbal5         = row.IsNull("totalbal5") ? decimal.Zero : row.Field <decimal>("totalbal5");
            entity.totalbal5label    = row.IsNull("totalbal5label") ? string.Empty : row.Field <string>("totalbal5label");
            entity.creditlimit       = row.IsNull("creditlimit") ? decimal.Zero : row.Field <decimal>("creditlimit");
            entity.creditlimitlabel  = row.IsNull("creditlimitlabel") ? string.Empty : row.Field <string>("creditlimitlabel");
            entity.orderbalance      = row.IsNull("orderbalance") ? decimal.Zero : row.Field <decimal>("orderbalance");
            entity.approvedorders    = row.IsNull("approvedorders") ? decimal.Zero : row.Field <decimal>("approvedorders");
            entity.unapprovedorders  = row.IsNull("unapprovedorders") ? decimal.Zero : row.Field <decimal>("unapprovedorders");
            entity.pastdue           = row.IsNull("pastdue") ? decimal.Zero : row.Field <decimal>("pastdue");
            entity.pastduepct        = row.IsNull("pastduepct") ? decimal.Zero : row.Field <decimal>("pastduepct");
            entity.lastpaymentamount = row.IsNull("lastpaymentamount") ? decimal.Zero : row.Field <decimal>("lastpaymentamount");
            entity.lastpaydate       = row.Field <DateTime?>("lastpaydate");
            entity.highbalance       = row.IsNull("highbalance") ? decimal.Zero : row.Field <decimal>("highbalance");
            entity.annual            = row.IsNull("annual") ? decimal.Zero : row.Field <decimal>("annual");
            entity.monthsback        = row.IsNull("monthsback") ? 0 : row.Field <int>("monthsback");
            entity.avgpaydays        = row.IsNull("avgpaydays") ? 0 : row.Field <int>("avgpaydays");
            entity.nopastdue         = row.IsNull("nopastdue") ? 0 : row.Field <int>("nopastdue");
            entity.credittext        = row.IsNull("credittext") ? string.Empty : row.Field <string>("credittext");
            entity.userfield         = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOeircustomercreditresults(ref DataRow row, Oeircustomercreditresults entity)
 {
     row.SetField("custno", entity.custno);
     row.SetField("orderno", entity.orderno);
     row.SetField("ordersuf", entity.ordersuf);
     row.SetField("fpcustfl", entity.fpcustfl);
     row.SetField("name", entity.name);
     row.SetField("apmgr", entity.apmgr);
     row.SetField("phoneno", entity.phoneno);
     row.SetField("totalinvamount", entity.totalinvamount);
     row.SetField("totaldue", entity.totaldue);
     row.SetField("credtext", entity.credtext);
     row.SetField("period1", entity.period1);
     row.SetField("period1label", entity.period1label);
     row.SetField("period2", entity.period2);
     row.SetField("period2label", entity.period2label);
     row.SetField("period3", entity.period3);
     row.SetField("period3label", entity.period3label);
     row.SetField("period4", entity.period4);
     row.SetField("period4label", entity.period4label);
     row.SetField("period5", entity.period5);
     row.SetField("period5label", entity.period5label);
     row.SetField("futbal", entity.futbal);
     row.SetField("futballabel", entity.futballabel);
     row.SetField("approved", entity.approved);
     row.SetField("approvedlabel", entity.approvedlabel);
     row.SetField("totalbal1", entity.totalbal1);
     row.SetField("totalbal1label", entity.totalbal1label);
     row.SetField("totalbal2", entity.totalbal2);
     row.SetField("totalbal2label", entity.totalbal2label);
     row.SetField("totalbal3", entity.totalbal3);
     row.SetField("totalbal3label", entity.totalbal3label);
     row.SetField("totalbal4", entity.totalbal4);
     row.SetField("totalbal4label", entity.totalbal4label);
     row.SetField("totalbal5", entity.totalbal5);
     row.SetField("totalbal5label", entity.totalbal5label);
     row.SetField("creditlimit", entity.creditlimit);
     row.SetField("creditlimitlabel", entity.creditlimitlabel);
     row.SetField("orderbalance", entity.orderbalance);
     row.SetField("approvedorders", entity.approvedorders);
     row.SetField("unapprovedorders", entity.unapprovedorders);
     row.SetField("pastdue", entity.pastdue);
     row.SetField("pastduepct", entity.pastduepct);
     row.SetField("lastpaymentamount", entity.lastpaymentamount);
     row.SetField("lastpaydate", entity.lastpaydate);
     row.SetField("highbalance", entity.highbalance);
     row.SetField("annual", entity.annual);
     row.SetField("monthsback", entity.monthsback);
     row.SetField("avgpaydays", entity.avgpaydays);
     row.SetField("nopastdue", entity.nopastdue);
     row.SetField("credittext", entity.credittext);
     row.SetField("userfield", entity.userfield);
 }