Beispiel #1
0
 /// <summary>
 /// Update a database row from a class
 /// </summary>
 public static void UpdateRowFromOpencountscustomer(ref DataRow row, Opencountscustomer entity)
 {
     row.SetField("co_num", entity.coNum);
     row.SetField("wh_num", entity.whNum);
     row.SetField("ch_order", entity.chOrder);
     row.SetField("ch_suf", entity.chSuf);
     row.SetField("ch_car", entity.chCar);
     row.SetField("ch_ser", entity.chSer);
     row.SetField("dt_exp_ship", entity.dtExpShip);
     row.SetField("ch_cust_name", entity.chCustName);
     row.SetField("ch_cust_code", entity.chCustCode);
     row.SetField("i_lines", entity.iLines);
     row.SetField("i_priority", entity.iPriority);
     row.SetField("userfield", entity.userfield);
 }
Beispiel #2
0
        public static Opencountscustomer BuildOpencountscustomerFromRow(DataRow row)
        {
            Opencountscustomer entity = new Opencountscustomer();

            entity.coNum      = row.IsNull("co_num") ? string.Empty : row.Field <string>("co_num");
            entity.whNum      = row.IsNull("wh_num") ? string.Empty : row.Field <string>("wh_num");
            entity.chOrder    = row.IsNull("ch_order") ? string.Empty : row.Field <string>("ch_order");
            entity.chSuf      = row.IsNull("ch_suf") ? string.Empty : row.Field <string>("ch_suf");
            entity.chCar      = row.IsNull("ch_car") ? string.Empty : row.Field <string>("ch_car");
            entity.chSer      = row.IsNull("ch_ser") ? string.Empty : row.Field <string>("ch_ser");
            entity.dtExpShip  = row.Field <DateTime?>("dt_exp_ship");
            entity.chCustName = row.IsNull("ch_cust_name") ? string.Empty : row.Field <string>("ch_cust_name");
            entity.chCustCode = row.IsNull("ch_cust_code") ? string.Empty : row.Field <string>("ch_cust_code");
            entity.iLines     = row.IsNull("i_lines") ? 0 : row.Field <int>("i_lines");
            entity.iPriority  = row.IsNull("i_priority") ? 0 : row.Field <int>("i_priority");
            entity.userfield  = row.IsNull("userfield") ? string.Empty : row.Field <string>("userfield");
            return(entity);
        }