Пример #1
0
        public void UpdateCaptchaSetting(faceboardpro.Domain.Captcha Captchasetting)
        {
            try
            {
                using (NHibernate.ISession session = SessionFactory.GetNewSession())
                {
                    using (NHibernate.ITransaction transaction = session.BeginTransaction())
                    {
                        var query = session.CreateQuery("Update Captcha set Username = :username,Password= :password , Status= :status where CaptchaService= :captchaservice");
                        query.SetParameter("username", Captchasetting.Username);
                        query.SetParameter("password", Captchasetting.Password);
                        query.SetParameter("status", Captchasetting.Status);
                        query.SetParameter("captchaservice", Captchasetting.CaptchaService);

                        int res = query.ExecuteUpdate();
                        transaction.Commit();
                        //return res;
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
Пример #2
0
        public ICollection <faceboardpro.Domain.Captcha> GetAllCaptchaSetting(faceboardpro.Domain.Captcha captcha)
        {
            ICollection <faceboardpro.Domain.Captcha> eCol = null;

            try
            {
                using (NHibernate.ISession session = SessionFactory.GetNewSession())
                {
                    eCol = session.CreateCriteria(typeof(faceboardpro.Domain.Captcha)).List <faceboardpro.Domain.Captcha>();
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
            return(eCol);
        }
Пример #3
0
 public void Update(faceboardpro.Domain.Captcha captcha)
 {
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             using (NHibernate.ITransaction transaction = session.BeginTransaction())
             {
                 session.Update(captcha.CaptchaService, captcha);
                 transaction.Commit();
             }
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }
Пример #4
0
        private void PageManagerQuery(DataSet ds, params string[] paramValue)
        {
            try
            {
                if (paramValue.Length > 1)
                {
                    if (paramValue[0] == "Model : FanPageStatusRepository")
                    {
                        try
                        {
                            FanPageStatus objFanPageStatus = new FanPageStatus();

                            if (paramValue[1] == "Function : DeleteUsingMainPageUrl")
                            {
                                objFanPageStatus.MainPageUrl = paramValue[2];

                                objFanPageStatusRepository.DeleteUsingMainPageUrl(objFanPageStatus);
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                    if (paramValue[0] == "Model : FanPagePostRepository")
                    {
                        try
                        {
                            FanPagePost objFanPagePost = new FanPagePost();

                            if (paramValue[1] == "Function : Insert")
                            {
                                try
                                {
                                    objFanPagePost.FriendId = paramValue[2];
                                    objFanPagePost.Status = "0";
                                    objFanPagePost.Level = "0";
                                    objFanPagePost.Date = System.DateTime.Now.ToString();
                                    objFanPagePost.MainPageUrl = paramValue[6];

                                    objFanPagePostRepository.Insert(objFanPagePost);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                            if (paramValue[1] == "Function : InsertChasngeLevel")
                            {
                                try
                                {
                                    objFanPagePost.FriendId = paramValue[2];
                                    objFanPagePost.Status = "0";
                                    objFanPagePost.Level = "1";
                                    objFanPagePost.Date = System.DateTime.Now.ToString();
                                    objFanPagePost.MainPageUrl = paramValue[6];

                                    objFanPagePostRepository.InsertChasngeLevel(objFanPagePost);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            if (paramValue[1] == "Function : UpdateStatusUsingFriendId")
                            {
                                try
                                {
                                    objFanPagePost.FriendId = paramValue[2];
                                    objFanPagePost.Status = "1";


                                    objFanPagePostRepository.UpdateStatusUsingFriendId(objFanPagePost);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }

                            if (paramValue[1] == "Function : GetFanPagePostUsingLevelStatusMainPageUrl")
                            {

                                try
                                {
                                    objFanPagePost.MainPageUrl = paramValue[2];
                                    objFanPagePost.Status = "0";
                                    objFanPagePost.Level = "0";

                                    List<FanPagePost> lstFPPost = objFanPagePostRepository.GetFanPagePostUsingLevelStatusMainPageUrl(objFanPagePost);

                                    if (lstFPPost.Count > 0)
                                    {
                                        DataTable dt = new DataTable();
                                        dt.Columns.Add("FriendId", typeof(string));

                                        foreach (FanPagePost item in lstFPPost)
                                        {
                                            try
                                            {
                                                dt.Rows.Add(item.FriendId.ToString());
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        ds.Tables.Add(dt);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }

                            }

                            if (paramValue[1] == "Function : GetFanPagePostFriendIdMainPageUrlUsingLevelStatusMainPageUrl")
                            {

                                try
                                {
                                    objFanPagePost.MainPageUrl = paramValue[2];
                                    objFanPagePost.Status = "0";
                                    objFanPagePost.Level = "1";

                                    List<FanPagePost> lstFPPost = objFanPagePostRepository.GetFanPagePostUsingLevelStatusMainPageUrl(objFanPagePost);

                                    if (lstFPPost.Count > 0)
                                    {
                                        DataTable dt = new DataTable();
                                        dt.Columns.Add("FriendId", typeof(string));
                                        dt.Columns.Add("MainPageUrl", typeof(string));

                                        foreach (FanPagePost item in lstFPPost)
                                        {
                                            try
                                            {
                                                dt.Rows.Add(item.FriendId.ToString(), item.MainPageUrl);
                                            }
                                            catch (Exception ex)
                                            {
                                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                            }
                                        }

                                        ds.Tables.Add(dt);
                                    }
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }

                    if (paramValue[0] == "Model : EmailRepository")
                    {
                        Email objemail = new Email();
                        try
                        {
                            if (paramValue[1] == "Function : InsertCreatedEmailinEmailDatatbase")
                            {
                                objemail.UserName = paramValue[2];
                                objemail.Password = paramValue[3];
                                objemail.IsUsed = "0";
                                objEmailRepository.Insert(objemail);
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }

                    if (paramValue[0] == "Model : CaptchaSetting")
                    {
                        faceboardpro.Domain.Captcha objcaptcha = new faceboardpro.Domain.Captcha();
                        try
                        {
                            if (paramValue[1] == "Function : InsertCaptchaSettinginCaptchaDatatbase")
                            {
                                objcaptcha.Username = paramValue[2];
                                objcaptcha.Password = paramValue[3];
                                objcaptcha.CaptchaService = paramValue[4];
                                objcaptcha.Status = "True";
                                objCaptchaRepositry.Insert(objcaptcha);

                                objCaptchaRepositry.UpdateCaptchaStatusForOtherService(objcaptcha);
                            }
                            if (paramValue[1] == "Function : UpdateCaptchaSettinginCaptchaDatatbase")
                            {
                                objcaptcha.Username = paramValue[2];
                                objcaptcha.Password = paramValue[3];
                                objcaptcha.CaptchaService = paramValue[4];
                                objcaptcha.Status = "True";

                                objCaptchaRepositry.UpdateCaptchaStatusForOtherService(objcaptcha);
                                objCaptchaRepositry.UpdateCaptchaSetting(objcaptcha);
                            }

                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }


                    if (paramValue[0] == "Model : FanPageDataRepository")
                    {
                        try
                        {
                            FanPageData objFanPageData = new FanPageData();

                            if (paramValue[1] == "Function : Insert")
                            {
                                try
                                {
                                    objFanPageData.Id = (paramValue[2]);
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.Name = paramValue[3];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.FirstName = paramValue[4];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.MiddleName = paramValue[5];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.LastName = paramValue[6];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.Link = paramValue[7];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.Gender = paramValue[8];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.Locale = paramValue[9];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.ProfileStatus = paramValue[10];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.Url = paramValue[11];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }
                                try
                                {
                                    objFanPageData.ShowUser = paramValue[12];
                                }
                                catch (Exception ex)
                                {
                                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                }

                                objFanPageDataRepository.Insert(objFanPageData);
                            }
                        }
                        catch (Exception ex)
                        {
                            GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }