Beispiel #1
0
        public static FreightMapping GetMapping(DataSource ds, long tempId, int provice, int city)
        {
            long id = FreightAreaMapping.GetMapping(ds, tempId, provice, city);

            if (id > 0)
            {
                return(GetById(ds, id));
            }
            return(null);
        }
Beispiel #2
0
 protected override DataStatus OnDeleteAfter(DataSource ds)
 {
     try
     {
         if (FreightAreaMapping.DeleteByMapping(ds, Id) == DataStatus.Success)
         {
             ds.Commit();
             return(DataStatus.Success);
         }
     }
     catch (Exception)
     { }
     ds.Rollback();
     return(DataStatus.Rollback);
 }
Beispiel #3
0
        public static long GetMapping(DataSource ds, long tempId, int provice, int city)
        {
            FreightAreaMapping area = ExecuteSingleRow <FreightAreaMapping>(ds, P("ProvinceId", provice) & P("CityId", city) & P("TemplateId", tempId));

            if (area == null)
            {
                area = ExecuteSingleRow <FreightAreaMapping>(ds, P("ProvinceId", provice) & P("CityId", 0) & P("TemplateId", tempId));
            }
            if (area == null)
            {
                area = ExecuteSingleRow <FreightAreaMapping>(ds, P("ProvinceId", 0) & P("CityId", 0) & P("TemplateId", tempId));
            }
            if (area != null)
            {
                return(area.MappingId);
            }
            return(0);
        }
Beispiel #4
0
 public IList <FreightAreaMapping> GetMapping(DataSource ds)
 {
     return(FreightAreaMapping.GetAllByMapping(ds, Id));
 }