Exemple #1
0
        public static void deleteData()
        {
            //sendSMS.SendSPAM("0909070481", "test gui tin nhan cash 1");

            IRepository<VFS_CheckSMSSent> repoVFS_CheckSMSSent = new VFS_CheckSMSSentRepository();
            VFS_CheckSMSSent VFS_CheckSMSSent = new VFS_CheckSMSSent();

            // xóa tin nhan da gui cho ngay moi
            repoVFS_CheckSMSSent.Delete(VFS_CheckSMSSent); // delete all data in VFS_CheckSMSSent

        }
Exemple #2
0
        static bool checkSendSMS(int id)
        {
            bool resual = false;
            IRepository<VFS_CheckSMSSent> repoVFS_CheckSMSSent = new VFS_CheckSMSSentRepository();
            VFS_CheckSMSSent listcheck = repoVFS_CheckSMSSent.GetById(id);

            if (listcheck == null)
            {
                resual = true;
                VFS_CheckSMSSent item = new VFS_CheckSMSSent();
                item.Id = id;
                repoVFS_CheckSMSSent.Save(item);
            }

            return resual;
        }
Exemple #3
0
        public static void syncSentCash(SendSMS sendSMS)
        {
                      
            //sendSMS.SendSPAM("0909070481", "test gui tin nhan cash 1");

            IRepository<VFS_CheckSMSSent> repoVFS_CheckSMSSent = new VFS_CheckSMSSentRepository();
            VFS_CheckSMSSent VFS_CheckSMSSent = new VFS_CheckSMSSent();
            

            VFS_TransactionDayRepository repoVFS_VFS_TransactionDay = new VFS_TransactionDayRepository();
            IList<VFS_TransactionDay> listVFS_VFS_TransactionDay =  repoVFS_VFS_TransactionDay.listTransactionDayFromSP();

          
            if (listVFS_VFS_TransactionDay == null) // nếu bút toán ngoại bảng ngày hiện tại không có dữ liệu, tức là đã tạo ngày mới
                                                    // và lúc này xóa đi dữ liệu cho việc gửi tin
            {
                // xóa tin nhan da gui cho ngay moi
                repoVFS_CheckSMSSent.Delete(VFS_CheckSMSSent); // delete all data in VFS_CheckSMSSent
                LogFile("Delete for new day", FileOutPut);
                return;
            }
            foreach (var item in listVFS_VFS_TransactionDay)
            {
                if (item.CorAccount.Substring(0, 3) == "112") // nop rut tien tai khoan 112
                {
                    if (item.Debit == "C")
                    {                        
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                                //send sms 
                                sendSMS.SendSPAM(numbermobile, "Nop tien: " + string.Format("{0,0:N0}", item.CreditAmount) + " vao tai khoan " + item.AccountId);
                            }
                            LogFile(numbermobile + "----- Begin Sending SMS -----" + "Nop tien: " + string.Format("{0,0:N0}", item.CreditAmount) + " vao tai khoan " + item.AccountId, FileOutPut);
                        }
                    }
                    else
                    {
                        //send sms rut 112
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                                //send sms 
                                sendSMS.SendSPAM(numbermobile, "Rut tien: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId);
                       
                            }
                            LogFile(numbermobile + "----- Begin Sending SMS -----" + "Rut tien: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId, FileOutPut);
                        }
                    }
                }

                // nop rut qua trung gian

                if (item.CorAccount == "3388110005") // rut qua Trading Online
                {
                    //send sms rut 112
                    if (checkSendSMS(item.Id))
                    {
                        string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                        if (numbermobile.Length <= 11)
                        {
                            //send sms
                            sendSMS.SendSPAM(numbermobile, "Rut tien qua Trading Online: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId);
                        }
                        LogFile(numbermobile + "----- Begin Sending SMS -----" + "Rut tien qua Trading Online: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId, FileOutPut);
                    }
                }

                if (item.CorAccount == "1362110002" || item.CorAccount == "3362110002") // KH nop o HCM <=> HN
                {
                    if (item.Debit == "D")
                    {
                        //send sms nop 112
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                                //send sms     
                                sendSMS.SendSPAM(numbermobile, "KH rut: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId);
                            }
                            LogFile(numbermobile + "----- Begin Sending SMS -----" + "KH rut: " + string.Format("{0,0:N0}", item.DebitAmount) + " tu tai khoan " + item.AccountId, FileOutPut);
                        }
                    }
                    else
                    {
                        //send sms nop 112
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                                //send sms   
                                sendSMS.SendSPAM(numbermobile, "KH nop: " + string.Format("{0,0:N0}", item.CreditAmount) + " vao tai khoan " + item.AccountId);
                            }
                            LogFile(numbermobile + "----- Begin Sending SMS -----" + "KH nop: " + string.Format("{0,0:N0}", item.CreditAmount) + " vao tai khoan " + item.AccountId, FileOutPut);
                        }
                    }
                }
                
                // chuyen khoan qua lai tai khoan Cash <=> margin

                if (item.CorAccount.Substring(0, 3) == "094" && (item.CorAccount.Substring(4, 6) != item.AccountId.Substring(4, 6))) // nop rut tien tai khoan 112
                {
                    if (item.Debit == "D")
                    {
                        //send sms rut 112
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                                //send sms   
                                sendSMS.SendSPAM(numbermobile, "Da chuyen so tien: " + string.Format("{0,0:N0}", item.DebitAmount) + " cho tai khoan " + item.CorAccount);
                            }
                            LogFile(numbermobile + "----- Begin Sending SMS -----" + "Da chuyen so tien: " + string.Format("{0,0:N0}", item.DebitAmount) + " cho tai khoan " + item.CorAccount, FileOutPut);
                        }
                    }
                    else
                    {
                        //send sms nop 112
                        if (checkSendSMS(item.Id))
                        {
                            string numbermobile = getMobileCustomer(item.AccountId.Replace("K", "C"));
                            if (numbermobile.Length <= 11)
                            {
                              
                                //send sms   
                                sendSMS.SendSPAM(numbermobile, "Nhan tien tu tai khoan: " + item.CorAccount + " so tien: " + string.Format("{0,0:N0}", item.CreditAmount));
                            }
                            LogFile(getMobileCustomer(item.AccountId.Replace("K", "C")) + "----- Begin Sending SMS -----" + "Nhan tien tu tai khoan: " + item.CorAccount + " so tien:" + string.Format("{0,0:N0}", item.CreditAmount), FileOutPut);
                        }
                    }
                }
            }
        }