Пример #1
0
 public static DT.ValueName ToDto(DA.ValueName source)
 {
     if (source == null)
     {
         return(null);
     }
     return(new DT.ValueName()
     {
         Id = source.Id, Category = source.Category, Name = source.Name
     });
 }
Пример #2
0
        private static DA.ValueName ToEntity(string name, DA.ValueNameCategory category, DA.ValueNameType type, DA.OKBDataContext okb)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(null);
            }
            var entity = okb.ValueNames.FirstOrDefault(x => (x.Name == name) && (x.Category == category) && (x.Type == type));

            if (entity == null)
            {
                entity = new DA.ValueName()
                {
                    Id = 0, Name = name, Category = category, Type = type
                }
            }
            ;
            return(entity);
        }
Пример #3
0
 private static DA.ValueName ToEntity(string name, DA.ValueNameCategory category, DA.ValueNameType type, DA.OKBDataContext okb) {
   if (string.IsNullOrEmpty(name)) return null;
   var entity = okb.ValueNames.Where(x => (x.Name == name) && (x.Category == category) && (x.Type == type)).FirstOrDefault();
   if (entity == null)
     entity = new DA.ValueName() { Id = 0, Name = name, Category = category, Type = type };
   return entity;
 }
Пример #4
0
 partial void DeleteValueName(ValueName instance);
Пример #5
0
 partial void UpdateValueName(ValueName instance);
Пример #6
0
 partial void InsertValueName(ValueName instance);