public bool UpdatePackage(PackageEntities pe)
        {
            var              config  = new MapperConfiguration(cfg => cfg.CreateMap <PackageEntities, tblPackageDetail>());
            IMapper          mapper  = config.CreateMapper();
            tblPackageDetail package = mapper.Map <PackageEntities, tblPackageDetail>(pe);

            return(bookingRepository.UpdatePackage(package));
        }
        public int AddPackage(PackageEntities pe)
        {
            var     config = new MapperConfiguration(cfg => cfg.CreateMap <PackageEntities, tblPackageDetail>());
            IMapper mapper = config.CreateMapper();

            tblPackageDetail pa = mapper.Map <PackageEntities, tblPackageDetail>(pe);
            int PackageId       = bookingRepository.AddPackage(pa);

            return(PackageId);
        }
        public int AddPackage(PackageEntities pe)
        {
            var              config    = new MapperConfiguration(cfg => cfg.CreateMap <PackageEntities, tblPackageDetail>());
            IMapper          mapper    = config.CreateMapper();
            tblPackageDetail package   = mapper.Map <PackageEntities, tblPackageDetail>(pe);
            int              PackageId = quotationRepository.BookPackage(package);

            return(PackageId);
            //if (UserLogin.IsUserLogin())
            //{

            //}
            //else
            //{
            //    return 0;
            //}
        }
        public PackageEntities GetPackageById(int packageId)
        {
            var              config  = new MapperConfiguration(cfg => cfg.CreateMap <tblPackageDetail, PackageEntities>());
            IMapper          mapper  = config.CreateMapper();
            tblPackageDetail package = bookingRepository.GetPackageById(packageId);
            //tblPackageDetail pd = new tblPackageDetail();
            PackageEntities packagedata = new PackageEntities();

            packagedata.CreatedBy   = package.CreatedBy;
            packagedata.Height      = package.Height;
            packagedata.Id          = package.Id;
            packagedata.IsActive    = package.IsActive;
            packagedata.Lenght      = package.Lenght;
            packagedata.Packagename = package.Packagename;
            packagedata.Quantity    = package.Quantity;
            packagedata.UserId      = package.UserId;
            packagedata.Weight      = package.Weight;
            packagedata.Width       = package.Width;

            return(packagedata);
        }
Exemple #5
0
 public int BookPackage(tblPackageDetail objPackage)
 {
     db.tblPackageDetails.Add(objPackage);
     db.SaveChanges();
     return(objPackage.Id);
 }
 public bool UpdatePackage(tblPackageDetail pd)
 {
     db.Entry(pd).State = System.Data.Entity.EntityState.Modified;
     return(db.SaveChanges() > 0);
 }
        public tblPackageDetail GetPackageById(int packageId)
        {
            tblPackageDetail pd = db.tblPackageDetails.Find(packageId);

            return(pd);
        }