Beispiel #1
0
 public ICollection<Email> GetAllEmail(Email email)
 {
     ICollection<Email> eCol = null;
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             eCol = session.CreateCriteria(typeof(Email)).List<Email>();
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
     return eCol;
 }
Beispiel #2
0
 public void Delete(Email email)
 {
     try
     {
         using (NHibernate.ISession session = SessionFactory.GetNewSession())
         {
             using (NHibernate.ITransaction transaction = session.BeginTransaction())
             {
                 session.Delete(email.UserName);
                 transaction.Commit();
             }
         }
     }
     catch (Exception ex)
     {
         GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
     }
 }
Beispiel #3
0
        private void GetAllEmails()
        {
            try
            {
                dtEmailAccount = new DataTable();
                Email objEmail = new Email();
                ICollection<Email> lstEmail = objEmailRepository.GetAllEmail(objEmail);

                dtEmailAccount = CreateEmailTable();

                foreach (Email item in lstEmail)
                {
                    DataRow newRow = dtEmailAccount.NewRow();
                    try
                    {
                        string Username = item.UserName;
                        string PassWord = item.Password;
                        string ISUsed = item.IsUsed;

                        if (ISUsed == "0")
                        {
                            ISUsed = "Not Used";
                        }
                        else if (ISUsed == "1")
                        {
                            ISUsed = "Used";
                        }
                        else
                        {
                            ISUsed = "Other Issue";
                        }

                        newRow["Username"] = Username;
                        newRow["Password"] = PassWord;
                        newRow["IsUsed"] = ISUsed;

                        dtEmailAccount.Rows.Add(newRow);

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

                try
                {
                    //grvEmails_EmailCreator_AccountDetails.DataSource = null;
                   // grvEmails_EmailCreator_AccountDetails.DataSource = dtEmailAccount;

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

        }
Beispiel #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);
            }
        }