Exemple #1
0
 public bool IsLikeByPostExist(Domain.Myfashion.Domain.FbPageLiker _FbPageLiker)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             //Proceed action to get Archive messages
             // And return list of archive messages.
             List <Domain.Myfashion.Domain.FbPageLiker> alst = session.CreateQuery("from FbPageLiker where UserId = :userid and PostId=:postid")
                                                               .SetParameter("postid", _FbPageLiker.PostId)
                                                               .SetParameter("userid", _FbPageLiker.UserId)
                                                               .SetParameter("fromid", _FbPageLiker.FromId)
                                                               .List <Domain.Myfashion.Domain.FbPageLiker>()
                                                               .ToList <Domain.Myfashion.Domain.FbPageLiker>();
             if (alst.Count > 0)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         } //End using transaction
     }     //Using using session
 }
 public bool AddLikeDetails(string Jdata)
 {
     try
     {
         Domain.Myfashion.Domain.FbPageLiker _FbPageLiker = (Domain.Myfashion.Domain.FbPageLiker) new JavaScriptSerializer().Deserialize(Jdata, typeof(Domain.Myfashion.Domain.FbPageLiker));
         objFbPageLikerRepository.addFbPageLiker(_FbPageLiker);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #3
0
 /// <addFbPageLiker>
 /// Add new FbPageLiker
 /// </summary>
 /// <param name="fbmsg">Set Values in a FbPageLiker Class Property and Pass the same Object of FbPageLiker Class.(Domain.FbPageLiker)</param>
 public void addFbPageLiker(Domain.Myfashion.Domain.FbPageLiker _FbPageLiker)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             //Proceed action, to save data.
             session.Save(_FbPageLiker);
             transaction.Commit();
         } //End Transaction
     }     //End session
 }
 public bool IsLikeExist(string Jdata)
 {
     Domain.Myfashion.Domain.FbPageLiker _FbPageLiker = (Domain.Myfashion.Domain.FbPageLiker) new JavaScriptSerializer().Deserialize(Jdata, typeof(Domain.Myfashion.Domain.FbPageLiker));
     return(objFbPageLikerRepository.IsLikeByPostExist(_FbPageLiker));
 }