namespace XYZ.ABC.Services.ServiceObjects { [DataContract] public class SpecimenType { [DataMember] public DateTimeOffset CreateDate { get; set; } [DataMember] public DateTimeOffset? UpdatedDate { get; set; } } } using Technossus.LIS.Services.ServiceObjects; namespace Technossus.LIS.Services.InterFaces { [ServiceContract] public interface IDosService { [OperationContract] IEnumerable<SpecimenType> GetAllSpecimenType(); } } using XYZ.ABC.Services.InterFaces; namespace XYZ.ABC.Services { public class DosService : ServiceBase, IDosService { public IEnumerable<SpecimenType> GetAllSpecimenType() { IEnumerable<SpecimenType> result = null; var manager = new DOSManager(SecurityUserId); var specimenList = manager.GetSpecimenTypeList(); result = Mappe r.Map<ienumerable><specimentype>>(specimenList); return result; } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; namespace XVZ.ABC.Web.Models { public class SpecimenTypeModel { public DateTimeOffset CreateDate { get; set; } public DateTimeOffset? UpdatedDate { get; set; } } }
using System.Collections.Generic; using System.Web.Mvc; using Technossus.LIS.Web.Models; using Technossus.LIS.Web.DosService; using AutoMapper; namespace Technossus.LIS.Web.Controllers { public partial class DosController : BaseController { // // GET: /Dos/ public virtual ActionResult SpecimenTypes() { //IEnumerable<specimentypemodel> model = null; List<specimentypemodel> model = null; using (var client = new DosServiceClient()) { var serviceUser = client.GetAllSpecimenType(); foreach (var servicelist in serviceUser) { SpecimenTypeModel objspecimentype = new SpecimenTypeModel(); objspecimentype.SpecimenTypeName = servicelist.SpecimenTypeName; objspecimentype.SpecimenTypeCode = servicelist.SpecimenTypeCode; objspecimentype.CreateDate = servicelist.CreateDate; objspecimentype.UpdatedDate = servicelist.UpdatedDate; model.Add(objspecimentype); } //model = Mapper.Map<list><specimentypemodel>>(serviceUser); } return View(model); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)