예제 #1
0
 public DataModel.planes CreateEntity(PlanBE be)
 {
     DataModel.planes entity = new DataModel.planes()
     {
         id_plan         = be.id_plan,
         id_especialidad = be.id_especialidad,
         desc_plan       = be.desc_plan,
         estado          = be.estado
     };
     return(entity);
 }
예제 #2
0
        public PlanBE CreateBusiness(DataModel.planes entity)
        {
            PlanBE be = new PlanBE()
            {
                id_plan         = entity.id_plan,
                id_especialidad = entity.id_especialidad,
                desc_plan       = entity.desc_plan,
                estado          = entity.estado
            };

            return(be);
        }
예제 #3
0
        public long Create(PlanBE Be)
        {
            try
            {
                if (Be != null)
                {
                    DataModel.planes entity = Factory.FactoryPlan.GetInstance().CreateEntity(Be);
                    _puente.Planrepository.Insert(entity);
                    _puente.Commit();

                    return(entity.id_plan);
                }
                else
                {
                    throw new ApiBusinessException(1012, "No se pudo crear el plan", System.Net.HttpStatusCode.NotFound, "Http");
                }
            }
            catch (Exception ex)
            {
                throw HandlerErrorExceptions.GetInstance().RunCustomExceptions(ex);
            }
        }