示例#1
0
        private void frmAtm_Load(object sender, EventArgs e)
        {
            this.Height = 244;
            this.Width  = 593;

            clsAccount ac = new clsAccount("AC11", "Checkin", 2, 11, 2000, "active", 20000);

            MessageBox.Show(ac.Consult());


            /**
             * clsTime Rv = new clsTime();
             * Rv.Hour = 12;
             * Rv.Minute = 30;
             * Rv.Second = 20;
             * MessageBox.Show(Rv.ToUniversal());
             * MessageBox.Show(Rv.ToStandard());
             *
             * Rv.Hour = 18;
             * Rv.Minute = 30;
             * Rv.Second = 20;
             * MessageBox.Show(Rv.ToStandard());
             * MessageBox.Show(Rv.ToUniversal());
             *
             * Rv.Hour = 9;
             * Rv.Minute = 30;
             * Rv.Second = 20;
             * MessageBox.Show(Rv.ToStandard());
             */
        }
        public void DeleteMethodOK()

        {
            clsAccountCollection allAccount = new clsAccountCollection();

            clsAccount TestItem = new clsAccount();

            Int32 PrimaryKey = 0;

            TestItem.NewsLetterSub = true;
            TestItem.JoinDate      = Convert.ToDateTime("2011-01-01");
            TestItem.CustFName     = "Jim";
            TestItem.CustSName     = "Johnson";
            TestItem.CustAddress   = "NN39GA";
            TestItem.CustPhone     = 0791231231;
            TestItem.CustID        = 2;

            allAccount.ThisAccount = TestItem;

            PrimaryKey = allAccount.Add();

            TestItem.CustID = PrimaryKey;

            allAccount.ThisAccount.Find(PrimaryKey);

            allAccount.Delete();

            Boolean Found = allAccount.ThisAccount.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
 public Int64 CheckUserName(string username)
 {
     try
     {
         clsAccount obj = new clsAccount();
         SqlCommand com = new SqlCommand("iBet_tblAccounts_CheckUserName", conn.GetConn());
         com.CommandType = System.Data.CommandType.StoredProcedure;
         com.Parameters.AddWithValue("@UserName", username);
         conn.OpenConn();
         SqlDataReader dr = com.ExecuteReader();
         if (dr.Read())
         {
             if (dr["ID"] != DBNull.Value)
             {
                 return(Convert.ToInt64(dr["ID"]));
             }
             else
             {
                 return(0);
             }
         }
         else
         {
             return(0);
         }
     }
     catch (Exception)
     {
         throw;
     }
     finally { conn.CloseConn(); }
 }
示例#4
0
        public void AccountJoinDate()
        {
            clsAccount Account  = new clsAccount();
            DateTime   TestData = DateTime.Now.Date;

            Account.JoinDate = TestData;
            Assert.AreEqual(Account.JoinDate, TestData);
        }
示例#5
0
        public void CustSNameOK()
        {
            clsAccount aAccount = new clsAccount();
            string     TestData = CustSName;

            aAccount.CustSName = TestData;
            Assert.AreEqual(aAccount.CustSName, TestData);
        }
示例#6
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsAccount AnAccount = new clsAccount();

            //test to see that it exists
            Assert.IsNotNull(AnAccount);
        }
示例#7
0
        public void AccountCustPhone()
        {
            clsAccount Account  = new clsAccount();
            int        TestData = 01234567899;

            Account.CustPhone = TestData;
            Assert.AreEqual(Account.CustPhone, TestData);
        }
示例#8
0
        public void AccountCustSName()
        {
            clsAccount Account  = new clsAccount();
            String     TestData = "aaa";

            Account.CustSName = TestData;
            Assert.AreEqual(Account.CustSName, TestData);
        }
示例#9
0
        public void CustID()
        {
            clsAccount Account  = new clsAccount();
            int        TestData = 1;

            Account.CustID = TestData;
            Assert.AreEqual(Account.CustID, TestData);
        }
示例#10
0
        public void NewsLetterSubOK()
        {
            clsAccount Account  = new clsAccount();
            Boolean    TestData = true;

            Account.NewsLetterSub = TestData;
            Assert.AreEqual(Account.NewsLetterSub, TestData);
        }
示例#11
0
        public void ValidMethodOK()
        {
            clsAccount aAccount = new clsAccount();
            String     Error    = "";

            Error = aAccount.Valid(CustFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreEqual(Error, "");
        }
示例#12
0
        public void CustPhoneValidInt()
        {
            clsAccount aAccount  = new clsAccount();
            String     Error     = "";
            string     CustPhone = "this is not a phone number";

            Error = aAccount.Valid(CustFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreNotEqual(Error, "");
        }
示例#13
0
        public void FindMethodOK()
        {
            clsAccount aAccount = new clsAccount();
            Boolean    Found    = false;
            Int32      CustID   = 2;

            Found = aAccount.Find(CustID);
            Assert.IsTrue(Found);
        }
示例#14
0
        public void CustSNameMid()
        {
            clsAccount aAccount  = new clsAccount();
            string     Error     = "";
            string     CustSName = "qwertyuiopasdfg";

            Error = aAccount.Valid(CustFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreEqual(Error, "");
        }
示例#15
0
        public void CustAddressMaxPlusOne()
        {
            clsAccount aAccount    = new clsAccount();
            string     Error       = "";
            string     custAddress = "";

            Error = aAccount.Valid(CustFName, CustSName, CustPhone, custAddress, JoinDate);
            Assert.AreNotEqual(Error, "");
        }
示例#16
0
        public void CustSNameMin()
        {
            clsAccount aAccount  = new clsAccount();
            string     Error     = "";
            string     custSName = "bb";

            Error = aAccount.Valid(CustFName, custSName, CustPhone, CustAddress, JoinDate);
            Assert.AreEqual(Error, "");
        }
示例#17
0
        public void CustFNameMaxExtreme()
        {
            clsAccount aAccount  = new clsAccount();
            String     Error     = "";
            string     custFName = "";

            custFName = CustFName.PadRight(500, 'a');
            Error     = aAccount.Valid(custFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreNotEqual(Error, "");
        }
示例#18
0
        public void CustAddressExtremeMax()
        {
            clsAccount aAccount    = new clsAccount();
            string     Error       = "";
            string     custAddress = "";

            custAddress = CustAddress.PadLeft(500, 'a');
            Error       = aAccount.Valid(CustFName, CustSName, CustPhone, custAddress, JoinDate);
            Assert.AreNotEqual(Error, "");
        }
示例#19
0
        public void CustSNameMax()
        {
            clsAccount aAccount  = new clsAccount();
            string     Error     = "";
            string     CustSName = "";

            CustSName = CustSName.PadLeft(30, '*');
            Error     = aAccount.Valid(CustFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreEqual(Error, "");
        }
 /// <summary>
 /// Sửa một Account
 /// </summary>
 /// <param name="id">ID Account cần sửa</param>
 /// <param name="parentid">Parent ID</param>
 /// <param name="sgmid">SGM ID</param>
 /// <param name="masterid">Master ID</param>
 /// <param name="agentid">Agent ID</param>
 /// <param name="accountid">Account ID</param>
 /// <param name="accgrade">Accgrade</param>
 /// <param name="username">Tên đăng nhập</param>
 /// <param name="password">Mật khẩu</param>
 /// <param name="nickname">Tên nick</param>
 /// <param name="firtname">Họ</param>
 /// <param name="lastname">Tên</param>
 /// <param name="phone">Điện thoại</param>
 /// <param name="mobilephone">di động</param>
 /// <param name="maxcredit">max credit</param>
 /// <param name="fax">Fax</param>
 /// <param name="isopent">Is Opent</param>
 /// <param name="issuspended">is suspended</param>
 /// <param name="allowautopt">Allow Auto PT</param>
 /// <param name="transferconditionid">Transfer Condition ID</param>
 /// <param name="createby">Người tạo</param>
 /// <param name="createdate">Ngày tạo</param>
 /// <param name="modifyby">Người sửa</param>
 /// <param name="modifydate">Ngày sửa</param>
 /// <param name="lasttxn">Last Txn</param>
 /// <param name="passwordexpiredate">Hạn mật khẩu</param>
 /// <param name="loginip">IP login</param>
 /// <param name="logintime">Thời gian Login</param>
 /// <param name="lastloginip">IP last login</param>
 /// <param name="lastlogintime">Thời gian login lần trước</param>
 /// <param name="isoutright">is Outright</param>
 public void Update(Int64 id, Int64 parentid, Int64 sgmid, Int64 gmid, Int64 masterid, Int64 agentid, Int64 accountid, int accgrade,
                    string username, string password, string nickname, string firtname, string lastname, string phone, string mobilephone,
                    decimal maxcredit, string fax, bool isopent, bool issuspended, bool allowautopt, int transferconditionid, Int64 createby,
                    DateTime createdate, Int64 modifyby, DateTime modifydate, DateTime lasttxn, DateTime passwordexpiredate, string loginip,
                    DateTime logintime, string lastloginip, DateTime lastlogintime, bool isoutright)
 {
     try
     {
         clsAccount obj = new clsAccount();
         SqlCommand com = new SqlCommand("iBet_tblAccounts_Update", conn.GetConn());
         com.CommandType = System.Data.CommandType.StoredProcedure;
         com.Parameters.AddWithValue("@Id", id);
         com.Parameters.AddWithValue("@ParentId", parentid);
         com.Parameters.AddWithValue("@SGMId", sgmid);
         com.Parameters.AddWithValue("@GMId", gmid);
         com.Parameters.AddWithValue("@MaterId", masterid);
         com.Parameters.AddWithValue("@AgentId", agentid);
         com.Parameters.AddWithValue("@AccountId", accountid);
         com.Parameters.AddWithValue("@AccGrade", accgrade);
         com.Parameters.AddWithValue("@UserName", username);
         com.Parameters.AddWithValue("@Password", password);
         com.Parameters.AddWithValue("@NickName", nickname);
         com.Parameters.AddWithValue("@FirtName", firtname);
         com.Parameters.AddWithValue("@LastName", lastname);
         com.Parameters.AddWithValue("@Phone", phone);
         com.Parameters.AddWithValue("@MobilePhone", mobilephone);
         com.Parameters.AddWithValue("@MaxCredit", maxcredit);
         com.Parameters.AddWithValue("@Fax", fax);
         com.Parameters.AddWithValue("@IsOpen", isopent);
         com.Parameters.AddWithValue("@Issuspended", issuspended);
         com.Parameters.AddWithValue("@AllowAutoPT", allowautopt);
         com.Parameters.AddWithValue("@TransferConditionId", transferconditionid);
         com.Parameters.AddWithValue("@CreateBy", createby);
         com.Parameters.AddWithValue("@CreateDate", createdate);
         com.Parameters.AddWithValue("@ModifyBy", modifyby);
         com.Parameters.AddWithValue("@ModifyDate", modifydate);
         com.Parameters.AddWithValue("@LastTxn", lasttxn);
         com.Parameters.AddWithValue("@PasswordExpiryDate", passwordexpiredate);
         com.Parameters.AddWithValue("@LoginIP", loginip);
         com.Parameters.AddWithValue("@LoginTime", logintime);
         com.Parameters.AddWithValue("@LastLoginIP", lastloginip);
         com.Parameters.AddWithValue("@LastLoginTime", lastlogintime);
         com.Parameters.AddWithValue("@IsOutright", isoutright);
         conn.OpenConn();
         com.ExecuteNonQuery();
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         conn.CloseConn();
     }
 }
示例#21
0
        public void CountPropertyOK()
        {
            //create an instance of the class we want to create
            clsAccount AnAccount = new clsAccount();
            //create some test data to assign to the property
            string AccountHolder = "Cezary Szwalbe";

            //assign the data to the property
            AnAccount.AccountHolder = AccountHolder;
            //test to see that the values are the same
            Assert.AreEqual(AnAccount.AccountHolder, AccountHolder);
        }
示例#22
0
        public void CustPhoneMid()
        {
            clsAccount aAccount = new clsAccount();
            String     Error    = "";
            Int32      TestData;

            TestData = 50000;
            String CustPhone = TestData.ToString();

            Error = aAccount.Valid(CustFName, CustSName, CustPhone, CustAddress, JoinDate);
            Assert.AreEqual(Error, "");
        }
        public void setFinRewatds(UserControl PageSource)
        {
            Literal ltrFinRewards = (Literal)PageSource.FindControl("ltrFinRewards");

            string[] sValue = csValue(PageSource);
            try
            {
                clsCache cCache = new csCache().cCache();
                if (cCache != null)
                {
                    csGeneralsPag.Idioma(PageSource);
                    clsAccount cAccount   = new clsAccount();
                    VO_Account vo_Account = cAccount.RecuperarAccount();

                    clsCacheControl cCacheControl = new clsCacheControl();

                    //string sTipo = clsValidaciones.GetKeyOrAdd("FormaPagoVasa", "VASA");
                    string sConfirmacion = clsValidaciones.GetKeyOrAdd("VasaConfirmacion", "[1000]");
                    if (vo_Account.Confirmation.Equals(sConfirmacion))
                    {
                        ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, esperamos servirle de nuevo en un futuro cercano.";
                    }
                    else
                    {
                        ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, lo sentimos la transacción NO fué exitosa por favor comuníquese con un asesor.";
                    }
                    cCacheControl.EliminarCache(cCache.SessionID.ToString());
                }
                else
                {
                    if (!sValue[0].Equals("0"))
                    {
                        ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, esperamos servirle de nuevo en un futuro cercano.";
                    }
                    else
                    {
                        ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, lo sentimos la transacción NO fué exitosa por favor comuníquese con un asesor.";
                    }
                }
            }
            catch
            {
                if (!sValue[0].Equals("0"))
                {
                    ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, esperamos servirle de nuevo en un futuro cercano.";
                }
                else
                {
                    ltrFinRewards.Text = "Agradecemos su preferencia por haber utilizado nuestro Programa de Beneficios VISA REWARDS, lo sentimos la transacción NO fué exitosa por favor comuníquese con un asesor.";
                }
            }
        }
示例#24
0
        public void TestNewsLetterSub()
        {
            clsAccount aAccount = new clsAccount();
            Boolean    Found    = false;
            Boolean    OK       = true;
            Int32      CustID   = 2;

            Found = aAccount.Find(CustID);
            if (aAccount.NewsLetterSub != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
示例#25
0
        public void TestDataAddedFound()
        {
            clsAccount aAccount = new clsAccount();
            Boolean    Found    = false;
            Boolean    OK       = true;
            Int32      CustID   = 2;

            Found = aAccount.Find(CustID);
            if (aAccount.JoinDate != Convert.ToDateTime("2011-01-01"))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
示例#26
0
        public void TestAccountCustPhone()
        {
            clsAccount aAccount = new clsAccount();
            Boolean    Found    = false;
            Boolean    OK       = true;
            Int32      CustID   = 2;

            Found = aAccount.Find(CustID);
            if (aAccount.CustPhone != 0791231231)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
示例#27
0
        public void TestCustFNameFound()
        {
            clsAccount aAccount = new clsAccount();
            Boolean    Found    = false;
            Boolean    OK       = true;
            Int32      CustID   = 2;

            Found = aAccount.Find(CustID);
            if (aAccount.CustFName != "Jim")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
示例#28
0
        public void AccountNumberNoExtremeMin()
        {
            //create an instance of the class we want to create
            clsAccount AnAccount = new clsAccount();
            //string variable to store the error message
            string Error         = "";
            double AccountNr     = -99999999999;
            string AccountHolder = "Ceazry Szwalbe";
            string AccountBank   = "Lloyds";

            //invoke the method
            Error = AnAccount.Valid(AccountHolder, AccountBank, AccountNr);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
示例#29
0
        public void AccountHolderMinBoundary()
        {
            //create an instance of the class we want to create
            clsAccount AnAccount = new clsAccount();
            //create a string variable to store the result of the validation
            String Error = "";
            //create some test data to test the method
            double AccountNr     = 8888777766665555;
            string AccountHolder = "1234567";
            string AccountBank   = "Lloyds";

            //invoke the method
            Error = AnAccount.Valid(AccountHolder, AccountBank, AccountNr);
            //test to see that the result is OK i.e there was no error message returned
            Assert.AreEqual(Error, "");
        }
示例#30
0
        public void AccountHolderMinLessOne()
        {
            //create an instance of the class we want to create
            clsAccount AnAccount = new clsAccount();
            //create a string variable to store the result of the validation
            String Error = "";
            //create some test data to test the method
            double AccountNr     = 8888777766665555;
            string AccountHolder = "popopo";
            string AccountBank   = "Lloyds";

            //invoke the method
            Error = AnAccount.Valid(AccountHolder, AccountBank, AccountNr);
            //test to see that the result is NOT OK i.e there should be an error message
            Assert.AreNotEqual(Error, "");
        }