public void EmailBankCoreMethod(string pUsername, string pPassword) { UserName = pUsername; PassWord = pPassword; if (!Login(pUsername, pPassword)) { Status = false; return; } else { Status = true; } iCustomer = SBS.CommonUtils.FacadeFactory.CustomerManager("", LoggedInUserInfo.UserIdentity.ToString(), (short)SBS.CommonUtils.ConstantData.AppUC.Email_SubSystem, LoggedInUserInfo.TicketStr); iWithdrawals = SBS.CommonUtils.FacadeFactory.WithdrawalsSettlementManager("", LoggedInUserInfo.UserIdentity.ToString(), (short)SBS.CommonUtils.ConstantData.AppUC.Email_SubSystem, LoggedInUserInfo.TicketStr); }
void EmailReciveChecker(object State) { try { Console.WriteLine("emailCheckOn : " + EmailBankCore.ClockServer()); TestForm.messageBody[] eBankMessage = new TestForm.messageBody[TestForm.messageBodyList.Count]; TestForm.messageBodyList.CopyTo(eBankMessage); if (!TestForm.EmailReciveCheckerISbusy && !TestForm.EmailAddCheckerISbusy) { TestForm.EmailReciveCheckerISbusy = true; foreach (TestForm.messageBody MessageRecived in eBankMessage) { Console.WriteLine("New Message Recived From : " + MessageRecived.MailSender); EmailsenderClass mail = new EmailsenderClass(); mail.UserName = "******"[email protected]\"<" + ConfigurationManager.AppSettings["EmailAddress"].ToString() + ">"; mail.Password = ConfigurationManager.AppSettings["EmailPassword"].ToString(); //______________________________________________________________________________ long CustomerID = CustomerIDMining(MessageRecived.DepositeNubmer); if (CustomerID == 0) { PageCreator PC = new PageCreator(); //"*****@*****.**" string Page = PC.PageBuilder(); MailInformation Mailinfo = new MailInformation { CustomerEmailAddress = MessageRecived.MailSender, CustomerID = CustomerID, EmailText = Page, MailProperties = mail, Subject = "Error", EmailType = "2", DepositeNumber = MessageRecived.DepositeNubmer }; CreateEmailThread(Mailinfo); } else { SBS.DataModel.CustomerModel CustomerInfo; int ii = 0; while (true) { try { CustomerInfo = iCustomer.SelectOneWithOutDeepLoad(CustomerID); break; } catch (Exception ex) { ii++; if (ii > 10) { return; } if (Login(UserName, PassWord)) { iCustomer = SBS.CommonUtils.FacadeFactory.CustomerManager("", LoggedInUserInfo.UserIdentity.ToString(), (short)SBS.CommonUtils.ConstantData.AppUC.Email_SubSystem, LoggedInUserInfo.TicketStr); iWithdrawals = SBS.CommonUtils.FacadeFactory.WithdrawalsSettlementManager("", LoggedInUserInfo.UserIdentity.ToString(), (short)SBS.CommonUtils.ConstantData.AppUC.Email_SubSystem, LoggedInUserInfo.TicketStr); } } } //CustomerInfo.Email = "*****@*****.**"; //CustomerInfo.Email = "*****@*****.**"; //CustomerInfo.Email = "*****@*****.**"; //______________________________________________________________________________ if (!string.IsNullOrEmpty(CustomerInfo.Email)) { PageCreator PC = new PageCreator(); //"*****@*****.**" UserInformation UserInf = new UserInformation { PreName = "", Name = CustomerInfo.DisplayName, ActionType = "گردش سپرده", DepositNubmer = MessageRecived.DepositeNubmer, Amount = CustomerInfo.Amount.ToString(), Comment = CustomerInfo.Comment, Date = FarsiDateServer(), RemainAmount = CustomerInfo.RemainAmount.ToString(), Time = ClockServer(), IsTransaction = false, }; if (MessageRecived.TransactionCountRequested <= 200) { UserInf.TransactionCountRequested = MessageRecived.TransactionCountRequested; } else { UserInf.TransactionCountRequested = 200; } if (MessageRecived.Blocked) { string Page = PC.PageBuilder(UserInf); MailInformation Mailinfo = new MailInformation { CustomerEmailAddress = CustomerInfo.Email, CustomerID = CustomerID, EmailText = Page, MailProperties = mail, Subject = "بیش از حد مجاز", EmailType = "2", DepositeNumber = MessageRecived.DepositeNubmer }; CreateEmailThread(Mailinfo); } else { List <ReportDetails> LRep = ReportDetailsBuilder(MessageRecived.DepositeNubmer, MessageRecived.TransactionCountRequested); UserInf.RealTransactionCount = short.Parse(LRep.Count.ToString()); string Page = PC.PageBuilder(UserInf, LRep); MailInformation Mailinfo = new MailInformation { CustomerEmailAddress = CustomerInfo.Email, CustomerID = CustomerID, EmailText = Page, MailProperties = mail, Subject = "گردش سپرده", EmailType = "2", DepositeNumber = MessageRecived.DepositeNubmer }; CreateEmailThread(Mailinfo); } } } while (true) { if (!TestForm.EmailAddCheckerISbusy) { TestForm.EmailAddCheckerISbusy = true; TestForm.messageBodyList.Remove(MessageRecived); TestForm.EmailAddCheckerISbusy = false; break; } } } TestForm.EmailReciveCheckerISbusy = false; } } catch (Exception ex) { LogRegister("EmailReciveChecker", ex.Message); } }