public SubCategory2Dto Create(SubCategory2Dto dto)
        {
            try
            {
                SubCategory1Dto subCategory1;

                if (!string.IsNullOrEmpty(dto.SubCategory1.Name))
                {
                    subCategory1 = new SubCategory1Dal().GetByName(dto.SubCategory1.Name).ToDto();
                }
                else
                {
                    subCategory1 = new SubCategory1Dal().GetById(dto.SubCategory1.Id).ToDto();
                }

                var retVal = this.dal.Create(dto.Name, subCategory1.Id).ToDto();
                return(retVal);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 public SubCategory1Logic()
 {
     this.dal = new SubCategory1Dal();
 }