Ejemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromSasbrresults(ref DataRow row, Sasbrresults entity)
 {
     row.SetField("ruledescrip", entity.ruledescrip);
     row.SetField("ruletype", entity.ruletype);
     row.SetField("level", entity.level);
     row.SetField("edipartner", entity.edipartner);
     row.SetField("custno", entity.custno);
     row.SetField("custnotesfl", entity.custnotesfl);
     row.SetField("custname", entity.custname);
     row.SetField("shipto", entity.shipto);
     row.SetField("shiptoname", entity.shiptoname);
     row.SetField("shiptonotesfl", entity.shiptonotesfl);
     row.SetField("vendno", entity.vendno);
     row.SetField("vendnotesfl", entity.vendnotesfl);
     row.SetField("shipfmno", entity.shipfmno);
     row.SetField("vendname", entity.vendname);
     row.SetField("cono", entity.cono);
     row.SetField("conm", entity.conm);
     row.SetField("docHandler", entity.docHandler);
     row.SetField("nodeNm", entity.nodeNm);
     row.SetField("AttrNm", entity.attrNm);
     row.SetField("rulevalue", entity.rulevalue);
     row.SetField("tradingpartner", entity.tradingpartner);
     row.SetField("direction", entity.direction);
     row.SetField("extdescrip", entity.extdescrip);
     row.SetField("categorylist", entity.categorylist);
     row.SetField("sxxmlrule-rowid", entity.sxxmlruleRowid.ToByteArray());
     row.SetField("userfield", entity.userfield);
 }
Ejemplo n.º 2
0
        public static Sasbrresults BuildSasbrresultsFromRow(DataRow row)
        {
            Sasbrresults entity = new Sasbrresults();

            entity.ruledescrip    = row.IsNull("ruledescrip") ? string.Empty : row.Field <string>("ruledescrip");
            entity.ruletype       = row.IsNull("ruletype") ? string.Empty : row.Field <string>("ruletype");
            entity.level          = row.IsNull("level") ? string.Empty : row.Field <string>("level");
            entity.edipartner     = row.IsNull("edipartner") ? string.Empty : row.Field <string>("edipartner");
            entity.custno         = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.custnotesfl    = row.IsNull("custnotesfl") ? string.Empty : row.Field <string>("custnotesfl");
            entity.custname       = row.IsNull("custname") ? string.Empty : row.Field <string>("custname");
            entity.shipto         = row.IsNull("shipto") ? string.Empty : row.Field <string>("shipto");
            entity.shiptoname     = row.IsNull("shiptoname") ? string.Empty : row.Field <string>("shiptoname");
            entity.shiptonotesfl  = row.IsNull("shiptonotesfl") ? string.Empty : row.Field <string>("shiptonotesfl");
            entity.vendno         = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.vendnotesfl    = row.IsNull("vendnotesfl") ? string.Empty : row.Field <string>("vendnotesfl");
            entity.shipfmno       = row.IsNull("shipfmno") ? 0 : row.Field <int>("shipfmno");
            entity.vendname       = row.IsNull("vendname") ? string.Empty : row.Field <string>("vendname");
            entity.cono           = row.IsNull("cono") ? 0 : row.Field <int>("cono");
            entity.conm           = row.IsNull("conm") ? string.Empty : row.Field <string>("conm");
            entity.docHandler     = row.IsNull("docHandler") ? string.Empty : row.Field <string>("docHandler");
            entity.nodeNm         = row.IsNull("nodeNm") ? string.Empty : row.Field <string>("nodeNm");
            entity.attrNm         = row.IsNull("AttrNm") ? string.Empty : row.Field <string>("AttrNm");
            entity.rulevalue      = row.IsNull("rulevalue") ? string.Empty : row.Field <string>("rulevalue");
            entity.tradingpartner = row.IsNull("tradingpartner") ? string.Empty : row.Field <string>("tradingpartner");
            entity.direction      = row.IsNull("direction") ? string.Empty : row.Field <string>("direction");
            entity.extdescrip     = row.IsNull("extdescrip") ? string.Empty : row.Field <string>("extdescrip");
            entity.categorylist   = row.IsNull("categorylist") ? string.Empty : row.Field <string>("categorylist");
            entity.sxxmlruleRowid = row.Field <byte[]>("sxxmlrule-rowid").ToStringEncoded();
            entity.userfield      = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }