コード例 #1
0
ファイル: ContextBll.cs プロジェクト: SHEMUL9007/Auto
        public int CreateOffer(OfferBLL Offer)
        {
            int proposedReturnValue = -1;

            proposedReturnValue = _context.CreateOffer
                                      (Offer.ProductID, Offer.BuyerID, Offer.Offerprice, Offer.offerstate, Offer.ExpireDate, Offer.Comments, Offer.ProductName, Offer.BuyerName);
            return(proposedReturnValue);
        }
コード例 #2
0
ファイル: ContextBll.cs プロジェクト: SHEMUL9007/Auto
        //Offer

        public OfferBLL FindOfferByID(int OfferID)
        {
            OfferBLL ProposedReturnValue = null;
            OfferDal DataLayerObject     = _context.FindOfferByID(OfferID);

            if (null != DataLayerObject)
            {
                ProposedReturnValue = new OfferBLL(DataLayerObject);
            }
            return(ProposedReturnValue);
        }
コード例 #3
0
        public OfferBLL FindOfferByID(int OfferID)
        {
            OfferBLL rv  = null;
            OfferDAL dal = ctx.FindOfferByID(OfferID);

            if (dal != null)
            {
                rv = new OfferBLL(dal);
            }

            return(rv);
        }
コード例 #4
0
ファイル: ContextBll.cs プロジェクト: SHEMUL9007/Auto
        public List <OfferBLL> GetOffer(int skip, int take)
        {
            List <OfferBLL> ProposedReturnValue    = new List <OfferBLL>();
            List <OfferDal> ListOfDataLayerObjects = _context.GetOffers(skip, take);

            foreach (OfferDal offer in ListOfDataLayerObjects)
            {
                OfferBLL BusinessObject = new OfferBLL(offer);
                ProposedReturnValue.Add(BusinessObject);
            }
            return(ProposedReturnValue);
        }
コード例 #5
0
ファイル: OfferController.cs プロジェクト: SHEMUL9007/Auto
        public ActionResult Delete(int id, BusinessLogicLayer.OfferBLL collection)
        {
            try
            {
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.DeleteOffer(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
コード例 #6
0
ファイル: OfferController.cs プロジェクト: SHEMUL9007/Auto
        public ActionResult Edit(int id, BusinessLogicLayer.OfferBLL collection)
        {
            try
            {
                // TODO: Add insert logic here
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.UpdateOffer(collection);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }
コード例 #7
0
ファイル: ContextBll.cs プロジェクト: SHEMUL9007/Auto
 public void DeleteOffer(OfferBLL offers)
 {
     _context.DeleteOffer(offers.offerID);
 }
コード例 #8
0
ファイル: ContextBll.cs プロジェクト: SHEMUL9007/Auto
 public void UpdateOffer(OfferBLL offer)
 {
     _context.UpdateOffer
         (offer.offerID, offer.ProductID, offer.BuyerID, offer.Offerprice, offer.offerstate, offer.ExpireDate, offer.Comments);
 }