コード例 #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOeercriteria(ref DataRow row, Oeercriteria entity)
 {
     row.SetField("selecttype", entity.selecttype);
     row.SetField("datetype", entity.datetype);
     row.SetField("fromdate", entity.fromdate);
     row.SetField("todate", entity.todate);
     row.SetField("requestno", entity.requestno);
     row.SetField("name", entity.name);
     row.SetField("custno", entity.custno);
     row.SetField("vendno", entity.vendno);
     row.SetField("prospect", entity.prospect);
     row.SetField("recordcountlimit", entity.recordcountlimit);
     row.SetField("userfield", entity.userfield);
 }
コード例 #2
0
        public static Oeercriteria BuildOeercriteriaFromRow(DataRow row)
        {
            Oeercriteria entity = new Oeercriteria();

            entity.selecttype       = row.IsNull("selecttype") ? string.Empty : row.Field <string>("selecttype");
            entity.datetype         = row.IsNull("datetype") ? string.Empty : row.Field <string>("datetype");
            entity.fromdate         = row.Field <DateTime?>("fromdate");
            entity.todate           = row.Field <DateTime?>("todate");
            entity.requestno        = row.IsNull("requestno") ? 0 : row.Field <int>("requestno");
            entity.name             = row.IsNull("name") ? string.Empty : row.Field <string>("name");
            entity.custno           = row.IsNull("custno") ? decimal.Zero : row.Field <decimal>("custno");
            entity.vendno           = row.IsNull("vendno") ? decimal.Zero : row.Field <decimal>("vendno");
            entity.prospect         = row.IsNull("prospect") ? decimal.Zero : row.Field <decimal>("prospect");
            entity.recordcountlimit = row.IsNull("recordcountlimit") ? 0 : row.Field <int>("recordcountlimit");
            entity.userfield        = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }