public void RejectMultiAdvertise(List <int> listAccept, string userID)
 {
     foreach (var item in listAccept)
     {
         int PurchaseAdsID = item;
         PurchaseAdvertise purchaseAdvertise = PurchaseAdvertiseRepository.GetByID(PurchaseAdsID);
         purchaseAdvertise.IsApproved = false;
         purchaseAdvertise.IsVisible  = false;
         purchaseAdvertise.ManagerID  = userID;
         PurchaseAdvertiseRepository.Update(purchaseAdvertise);
         Save();
     }
 }
 public void AccepMultiAdvertise(List <int> listAccept, string userID)
 {
     foreach (var item in listAccept)
     {
         int PurchaseAdsID = item;
         PurchaseAdvertise purchaseAdvertise = PurchaseAdvertiseRepository.GetByID(PurchaseAdsID);
         purchaseAdvertise.IsApproved    = true;
         purchaseAdvertise.IsVisible     = true;
         purchaseAdvertise.PurchasedDate = DateTime.Now;
         purchaseAdvertise.EndDate       = DateTime.Now.AddDays(30);
         purchaseAdvertise.ManagerID     = userID;
         PurchaseAdvertiseRepository.Update(purchaseAdvertise);
         Save();
     }
 }
        public bool CreateAdvertiseRequest(string userID, int advertiseID, string imageUrl)
        {
            try {
                CompanyInfo       companyInfo       = CompanyInfoRepository.GetByID(userID);
                PurchaseAdvertise purchaseAdvertise = new PurchaseAdvertise();
                purchaseAdvertise.AdvertiseID   = advertiseID;
                purchaseAdvertise.LogoUrl       = imageUrl;
                purchaseAdvertise.RecuiterID    = userID;
                purchaseAdvertise.PurchasedDate = DateTime.Now;
                purchaseAdvertise.EndDate       = DateTime.Now.AddDays(30);
                purchaseAdvertise.IsVisible     = false;
                purchaseAdvertise.IsApproved    = null;
                purchaseAdvertise.LinkUrl       = "";

                PurchaseAdvertiseRepository.Insert(purchaseAdvertise);
                Save();
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
        public bool CreateAdvertiseRequest(string userID, int advertiseID, string imageUrl)
        {
            try {
                CompanyInfo companyInfo = CompanyInfoRepository.GetByID(userID);
                PurchaseAdvertise purchaseAdvertise = new PurchaseAdvertise();
                purchaseAdvertise.AdvertiseID = advertiseID;
                purchaseAdvertise.LogoUrl = imageUrl;
                purchaseAdvertise.RecuiterID = userID;
                purchaseAdvertise.PurchasedDate = DateTime.Now;
                purchaseAdvertise.EndDate = DateTime.Now.AddDays(30);
                purchaseAdvertise.IsVisible = false;
                purchaseAdvertise.IsApproved = null;
                purchaseAdvertise.LinkUrl = "";

                PurchaseAdvertiseRepository.Insert(purchaseAdvertise);
                Save();
                return true;
            }
            catch (Exception e)
            {
                return false;
            }
        }