示例#1
0
        public GetPlanResponseDTO GetPlan(GetPlanRequestDTO planRequest)
        {
            GetPlanResponseDTO empresaResponse = new GetPlanResponseDTO();
            List <CatPlan>     listaEmpresa    = new List <CatPlan>();

            PlanDal   planDal = new PlanDal();
            DataTable dtDatos = new DataTable();

            try
            {
                dtDatos = planDal.GetPlan(planRequest.IdPlan, planRequest.Plan);

                listaEmpresa = dtDatos.AsEnumerable()
                               .Select(row => new CatPlan
                {
                    idPlan          = row.Field <int?>("idPlan").GetValueOrDefault(),
                    plan            = string.IsNullOrEmpty(row.Field <string>("plan")) ? "" : row.Field <string>("plan"),
                    descripcion     = string.IsNullOrEmpty(row.Field <string>("descripcion")) ? "" : row.Field <string>("descripcion"),
                    idModalidadPago = row.Field <int?>("idModalidadPago").GetValueOrDefault(),
                    usuarioInsert   = string.IsNullOrEmpty(row.Field <string>("usuarioInsert")) ? "" : row.Field <string>("usuarioInsert"),
                    fechaInsert     = row.Field <DateTime?>("fechaInsert").GetValueOrDefault(),
                    usuarioUpdate   = string.IsNullOrEmpty(row.Field <string>("usuarioUpdate")) ? "" : row.Field <string>("usuarioUpdate"),
                    fechaUpdate     = row.Field <DateTime?>("fechaUpdate").GetValueOrDefault(),
                }).ToList();

                empresaResponse.ListaEmpresa = listaEmpresa;
                empresaResponse.Mensaje      = "OK";
            }
            catch (Exception ex)
            {
                empresaResponse.ListaEmpresa = new List <CatPlan>();
                empresaResponse.Mensaje      = "ERROR: " + ex.Message;
            }

            return(empresaResponse);
        }
示例#2
0
文件: PlanBl.cs 项目: binumon/Binu
        public string GetPlan()
        {
            PlanDal Dal = new PlanDal();

            return(Dal.GetPlan());
        }