Exemplo n.º 1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromGletacriteria(ref DataRow row, Gletacriteria entity)
 {
     row.SetField("currproc", entity.currproc);
     row.SetField("s-exchrate", entity.sExchrate);
     row.SetField("ddiscgl", entity.ddiscgl);
     row.SetField("daddon1", entity.daddon1);
     row.SetField("daddon2", entity.daddon2);
     row.SetField("amount", entity.amount);
     row.SetField("transcd", entity.transcd);
     row.SetField("sourcecd", entity.sourcecd);
     row.SetField("divno", entity.divno);
     row.SetField("custno", entity.custno);
     row.SetField("userfield", entity.userfield);
 }
Exemplo n.º 2
0
        public static Gletacriteria BuildGletacriteriaFromRow(DataRow row)
        {
            Gletacriteria entity = new Gletacriteria();

            entity.currproc  = row.IsNull("currproc") ? string.Empty : row.Field <string>("currproc");
            entity.sExchrate = row.IsNull("s-exchrate") ? decimal.Zero : row.Field <decimal>("s-exchrate");
            entity.ddiscgl   = row.IsNull("ddiscgl") ? decimal.Zero : row.Field <decimal>("ddiscgl");
            entity.daddon1   = row.IsNull("daddon1") ? decimal.Zero : row.Field <decimal>("daddon1");
            entity.daddon2   = row.IsNull("daddon2") ? decimal.Zero : row.Field <decimal>("daddon2");
            entity.amount    = row.IsNull("amount") ? decimal.Zero : row.Field <decimal>("amount");
            entity.transcd   = row.IsNull("transcd") ? 0 : row.Field <int>("transcd");
            entity.sourcecd  = row.IsNull("sourcecd") ? 0 : row.Field <int>("sourcecd");
            entity.divno     = row.IsNull("divno") ? 0 : row.Field <int>("divno");
            entity.custno    = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.userfield = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }