Esempio n. 1
0
 public void SaveLog()
 {
     if (C_LikeViewList.CompareListCreateTimeWithTimeNow())
     {
         var LstLikeView = C_LikeViewList.GetAllLikeView();
         if (LstLikeView.Count()
             != 0)
         {
             using (var _Context = new ApplicationDbContext())
             {
                 var _objEntityActivity = new RepositoryPattern <Activity>(_Context);
                 foreach (var item in LstLikeView)
                 {
                     if (item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.View) || item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.Like) || item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.Downlaod))
                     {
                         var NewItem = new Activity
                         {
                             ActionTime     = item.ActionTime,
                             DateMiladi     = item.DateMiladi,
                             DateShamsi     = item.DateShamsi,
                             ActivityTypeId = item.ActionTypeID,
                             PostId         = item.PostID,
                             Browser        = item.Browser,
                             Device         = item.Device,
                             IP_Address     = item.IP_Address,
                             HostName       = item.HostName,
                             MoreInfo       = ""
                         };
                         _objEntityActivity.Insert(NewItem);
                     }
                     else if (item.ActionTypeID == Convert.ToInt32(EnumMethod.ActionType.DisLike))
                     {
                         var CurrItemDele = _objEntityActivity.GetByPredicate(x =>
                                                                              x.PostId == item.PostID &&
                                                                              x.Browser == item.Browser &&
                                                                              x.Device == item.Device &&
                                                                              x.HostName == item.HostName &&
                                                                              x.IP_Address == item.IP_Address &&
                                                                              x.ActivityTypeId == Convert.ToInt32(EnumMethod.ActionType.Like));
                         if (CurrItemDele != null)
                         {
                             _objEntityActivity.Delete(CurrItemDele.ID);
                         }
                     }
                 }
                 _objEntityActivity.Save();
                 _objEntityActivity.Dispose();
                 C_LikeViewList.ClearLikeViewList();
             }
         }
     }
 }
Esempio n. 2
0
 public string DeleteDatabaseConnection(int id)
 {
     try
     {
         if (id == default(int))
         {
             // retirn exception
         }
         using (var dataBaseRepo = new RepositoryPattern <DatabaseConnection>())
         {
             dataBaseRepo.Delete(id);
             dataBaseRepo.Save();
         }
         return("Database Connection Deleted successfully");
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// پاک کردن تصویر یک پست - وبلاگ
 /// </summary>
 /// <param name="PostID"></param>
 /// <returns></returns>
 public bool DeleteImageOfPost(string MediaID)
 {
     if (MediaID == null || MediaID == "")
     {
         return(false);
     }
     using (var _Context = new ApplicationDbContext())
     {
         var _objEntityImage = new RepositoryPattern <Image>(_Context);
         var itemMedia       = _objEntityImage.GetByPredicate(x => x.ID == MediaID);
         if (HelpOperation.RemoveMediaFromServer(itemMedia.FilePathOnServer))
         {
             _objEntityImage.Delete(itemMedia.ID);
             _objEntityImage.Save();
             _objEntityImage.Dispose();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Esempio n. 4
0
 public void DeleteNot(Note not)
 {
     repo.Delete(not);
 }
Esempio n. 5
0
 public void OrganizeKullaniciDelete(OrganizeKullanici org)
 {
     repo1.Delete(org);
 }
        public void DeleteCustomer(string customerid)
        {
            var customer = repo.Find(x => x.CustomerID == customerid);

            repo.Delete(customer);
        }
Esempio n. 7
0
 public void DeleteLead(Lead lead)
 {
     repo.Delete(lead);
 }
Esempio n. 8
0
 public void DeleteCustomer(Customer cus)
 {
     repo.Delete(cus);
 }