Esempio n. 1
0
        public IHttpActionResult Detail(Int32 id)
        {
            PartnerViewModel      viewmodel = new PartnerViewModel();
            PartnerDataController dataCtrl  = new PartnerDataController();

            viewmodel.Data.FromModel(dataCtrl.GetItem(id));

            return(Ok(viewmodel));
        }
Esempio n. 2
0
        public IHttpActionResult Backend_Detail(Int32 id)
        {
            BackendPartnerViewModel   viewmodel           = new BackendPartnerViewModel();
            PartnerDataController     dataCtrl            = new PartnerDataController();
            PartnerPackDataController partnerPackdataCtrl = new PartnerPackDataController();

            try
            {
                viewmodel.Data.FromModel(dataCtrl.GetItem(id));
                viewmodel.PartnerTypeOptions = partnerPackdataCtrl.GetItems().ToList().ConvertAll(x =>
                {
                    return(new BackendPartnerType()
                    {
                        ID = x.ID, Name = x.Name
                    });
                }).OrderBy(x => x.Name).ToList();
            }
            catch (Exception ex)
            {
                return(Error(viewmodel, ex));
            }

            return(Ok(viewmodel));
        }