//
        // GET: /Appraiser/Find
        public ActionResult Find(int id = 0)
        {
            Appraiser appraiserModel = new Appraiser();

            if (id != 0)
            {
                appraiserModel = _appraisalServiceModel.Get_Appraiser(id);
            }

            return View(appraiserModel);
        }
Пример #2
0
        /// <summary>
        /// Gets an individual Appraiser based on the appraiser's appraiserId
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public virtual Appraiser GetAppraiserById(int id)
        {
            var appraiser = new Appraiser();

            // Build the parameter for the database call
            var parameters = new List<SqlParameter> { new SqlParameter { ParameterName = "@id", Value = id, SqlDbType = System.Data.SqlDbType.Int, Direction = System.Data.ParameterDirection.Input } };

            // Get data from the database
            DataTable dataTable = GetDataFromStoredProc("GetAppraiserById", parameters);

            // Popluate the appraiser object
            if (dataTable.Rows.Count > 0)
            {
                appraiser = PopulateAppraiserFromDataTable(dataTable);
            }

            return appraiser;
        }