Beispiel #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromGleta(ref DataRow row, Gleta entity)
 {
     row.SetField("iseqno", entity.iseqno);
     row.SetField("ctype", entity.ctype);
     row.SetField("caccount", entity.caccount);
     row.SetField("damount", entity.damount);
     row.SetField("dcuramount", entity.dcuramount);
     row.SetField("cname", entity.cname);
     row.SetField("clookup", entity.clookup);
     row.SetField("userfield", entity.userfield);
 }
Beispiel #2
0
        public static Gleta BuildGletaFromRow(DataRow row)
        {
            Gleta entity = new Gleta();

            entity.iseqno     = row.IsNull("iseqno") ? 0 : row.Field <int>("iseqno");
            entity.ctype      = row.IsNull("ctype") ? string.Empty : row.Field <string>("ctype");
            entity.caccount   = row.IsNull("caccount") ? string.Empty : row.Field <string>("caccount");
            entity.damount    = row.IsNull("damount") ? decimal.Zero : row.Field <decimal>("damount");
            entity.dcuramount = row.IsNull("dcuramount") ? decimal.Zero : row.Field <decimal>("dcuramount");
            entity.cname      = row.IsNull("cname") ? string.Empty : row.Field <string>("cname");
            entity.clookup    = row.IsNull("clookup") ? string.Empty : row.Field <string>("clookup");
            entity.userfield  = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }