// GET: TipoProducto/Details/5 public ActionResult Details(int id) { EcomData_ = new EcomData(StringConnectio); try { EcomData_.Connect(); Ecom_Cliente_ = (Ecom_Cliente)EcomData_.GetObject(DataModel.Cliente); bool result = Ecom_Cliente_.Get(id); if (result) { return(View(Ecom_Cliente_)); } else { throw new Ecom_Exception(EcomData_.GetLastMessage()); } } catch (Ecom_Exception ex) { return(View("../ErrorPages/Error", new { id = ex.Message })); } finally { if (EcomData_ != null) { EcomData_.Disconnect(); } } }
// GET: TipoProducto public ActionResult Index() { EcomData_ = new EcomData(StringConnectio); try { EcomData_.Connect(); Ecom_Cliente_ = (Ecom_Cliente)EcomData_.GetObject(DataModel.Cliente); List <Ecom_Cliente> result = Ecom_Cliente_.Get(); return(View(result)); } catch (Ecom_Exception ex) { return(View("../ErrorPages/Error", new { id = ex.Message })); } finally { if (EcomData_ != null) { EcomData_.Disconnect(); } } }