Exemplo n.º 1
0
        private static UnitOfMeasureType PopulateUOMType(UnitOfMeasureType uomtype, DataRow dr)
        {
            if (dr["UOMType"] != DBNull.Value)
            {
                uomtype.UOMType = Convert.ToString(dr["UOMType"]);
            }

            return(uomtype);
        }
Exemplo n.º 2
0
        public static List <UnitOfMeasureType> GetUOMType()
        {
            var paramList = new List <ParameterValue>();

            var dataTable = DataFacade.GetDataTable("UOMTypeGetAll",
                                                    paramList.ToArray());

            var returnList = new List <UnitOfMeasureType>();

            foreach (DataRow r in dataTable.Rows)
            {
                var uomtype = new UnitOfMeasureType();

                PopulateUOMType(uomtype, r);

                returnList.Add(uomtype);
            }

            return(returnList);
        }
        public int Add(UnitOfMeasureTypeDto dto)
        {
            var entity = new UnitOfMeasureType();

            try
            {
                Mapper.Map(dto, entity);
                _repository.Repository <UnitOfMeasureType>().Insert(entity);
                _repository.Save();
            }
            catch (DbEntityValidationException valEx)
            {
                HandleValidationException(valEx);
            }
            catch (Exception ex)
            {
                LogException(ex);
                throw;
            }
            return(entity.ID);
        }
 private UnitOfMeasureTypeDto Map(UnitOfMeasureType entity)
 {
     return(Mapper.Map <UnitOfMeasureType, UnitOfMeasureTypeDto>(entity));
 }