public void AddMethodOK()
        {
            //create the instance of the class we want to create
            clsPaymentCollection AllPayments = new clsPaymentCollection();
            //create some test data to assign to the property
            clsPayment TestItem = new clsPayment();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set the properties of the test object
            TestItem.PaymentId     = 1;
            TestItem.PayeeName     = "Jack Daniel";
            TestItem.Amount        = 8888.88m;
            TestItem.CardNumber    = "555555555555555";
            TestItem.Method        = "MasterCard";
            TestItem.DatePurchased = DateTime.Now.Date;
            TestItem.Email         = "*****@*****.**";
            //set ThisPayment to the test data
            AllPayments.ThisPayment = TestItem;
            //add the record
            PrimaryKey = AllPayments.Add();
            //set the primary key to the test data
            TestItem.PaymentId = PrimaryKey;
            //assign the data to the property
            AllPayments.ThisPayment = TestItem;
            //test to see that the two values are the same
            Assert.AreEqual(AllPayments.ThisPayment, TestItem);
        }
        public void DeleteMethodOK()
        {
            //create the instance of the class we want to create
            clsPaymentCollection AllPayments = new clsPaymentCollection();
            //create some test data to assign to the property
            clsPayment TestItem = new clsPayment();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set the properties of the test object
            TestItem.PaymentId     = 7;
            TestItem.PayeeName     = "Samsung OLED TV";
            TestItem.Amount        = 3999.99m;
            TestItem.CardNumber    = "111111111111111";
            TestItem.Method        = "Debit";
            TestItem.DatePurchased = DateTime.Now.Date;
            TestItem.Email         = "*****@*****.**";
            //set ThisPayment to the test data
            AllPayments.ThisPayment = TestItem;
            //add the record
            PrimaryKey = AllPayments.Add();
            //set the primary key to the test data
            TestItem.PaymentId = PrimaryKey;
            //find the record
            AllPayments.ThisPayment.Find(PrimaryKey);
            //delete the record
            AllPayments.Delete();
            //now find the record
            Boolean Found = AllPayments.ThisPayment.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Esempio n. 3
0
        public override DataSet Approve(object objEntityp)
        {
            clsPayment objEntity = (clsPayment)(objEntityp);

            EntityProcesses objProcess = base.getProcessObject(objEntity.UserId.ToString(), EntityType.PAYMENT, objEntity.Status, objEntity.PaymentNo, "1");

            try
            {
                base.BeginTransaction();
                if (base.StartProcess(objProcess))
                {
                    DataSet ds = ApproveReceipt(objEntity);
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0] != null && ds.Tables[0].Rows[0]["Result"] != null)
                    {
                        objProcess.EntityCurrentStatus = objEntity.Status;
                        objProcess.EntityID            = ds.Tables[0].Rows[0]["Result"].ToString();
                    }
                    base.CommitProcess(objProcess);
                    base.CommitTransaction();
                    return(ds);
                }
                else
                {
                    // base.RollbackProcess(objProcess, EntityType.RECEIPT.ToString());
                    throw (new Exception("Receipt Can not be approved. Error: Process is not eligible on this entity status."));
                }
            }
            catch (Exception ex)
            {
                base.RollbackProcess(objProcess, EntityType.RECEIPT.ToString());
                throw (new Exception("Receipt Can not be approved. Error: " + ex.Message));
            }
        }
        public void PaymentListOK()
        {
            //create an istance of the class we want to create
            clsPaymentCollection AllPayments = new clsPaymentCollection();
            //create some test data to assign to the property
            //in this case the data needs to be a list of objects
            List <clsPayment> TestList = new List <clsPayment>();
            //add an item to the list
            //create the item of test data
            clsPayment TestItem = new clsPayment();

            //set its properties
            TestItem.Active      = true;
            TestItem.PaymentNo   = 111344455;
            TestItem.FirstName   = "Ben";
            TestItem.Surname     = "Stark";
            TestItem.CarID       = "C12321";
            TestItem.EmployeeID  = "EM13243";
            TestItem.Description = "MOT";
            TestItem.DateTime    = DateTime.Now.Date;
            TestItem.Cost        = 50.00;
            //add the item to the test List
            TestList.Add(TestItem);
            //assign the data to the property
            AllPayments.PaymentList = TestList;
            //test the see that the two values are the same
            Assert.AreEqual(AllPayments.PaymentList, TestList);
        }
Esempio n. 5
0
 public PaymentController()
 {
     glog.Debug("PaymentController: Entry");
     _clsGlobal  = new clsGlobal();
     _clsPayment = new clsPayment();
     glog.Debug("PaymentController: Exit");
 }
Esempio n. 6
0
        public void InstanceOK()
        {
            //create an instance of the class
            clsPayment APayment = new clsPayment();

            Assert.IsNotNull(APayment);
        }
Esempio n. 7
0
    public clsPayment GetData(string paymentcode)
    {
        clsPayment objpayment;

        myDB       = new DBHelper();
        objpayment = new clsPayment();
        sSQL       = objpayment.DispDataCode(paymentcode);
        SqlDataReader sDr = myDB.GetFromReader(sSQL);

        sDr.Read();
        if (sDr.HasRows)
        {
            objpayment.PaymentDate   = Convert.ToDateTime(sDr["PaymentDate"].ToString());
            objpayment.CustCode      = Convert.ToInt32(sDr["CustCode"].ToString());
            objpayment.Amount        = Convert.ToDecimal(sDr["Amount"].ToString());
            objpayment.ReferenceNo   = sDr["ReferenceNo"].ToString();
            objpayment.ReferenceDate = Convert.ToDateTime(sDr["ReferenceDate"].ToString());
            objpayment.Mode          = sDr["Mode"].ToString();
            objpayment.BankName      = sDr["BankName"].ToString();
            objpayment.ChequeNo      = Convert.ToInt32(sDr["ChequeNo"].ToString());
            objpayment.ChequeDate    = Convert.ToDateTime(sDr["ChequeDate"].ToString());
            objpayment.Username      = sDr["Username"].ToString();
        }
        return(objpayment);
    }
Esempio n. 8
0
        public void AmountPropertyOK()
        {
            clsPayment APayment = new clsPayment();
            decimal    Amount   = 5.99m;

            APayment.Amount = Amount;
            Assert.AreEqual(Amount, APayment.Amount);
        }
Esempio n. 9
0
        public void CardNumberPropertyOK()
        {
            clsPayment APayment   = new clsPayment();
            string     CardNumber = "4856123648597412";

            APayment.CardNumber = CardNumber;
            Assert.AreEqual(CardNumber, APayment.CardNumber);
        }
Esempio n. 10
0
        public void ValidMethodOK()
        {
            clsPayment APayment = new clsPayment();
            string     Error    = "";

            Error = APayment.Valid(PayeeName, Method, Amount, CardNumber, DatePurchased, Email);
            Assert.AreEqual(Error, "");
        }
Esempio n. 11
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsPayment APayment = new clsPayment();

            //test to see that it exists
            Assert.IsNotNull(APayment);
        }
Esempio n. 12
0
        public void MethodPropertyOK()
        {
            clsPayment APayment = new clsPayment();
            string     Method   = "Visa Debit";

            APayment.Method = Method;
            Assert.AreEqual(Method, APayment.Method);
        }
Esempio n. 13
0
        public void DatePurchasedPropertyOK()
        {
            clsPayment APayment      = new clsPayment();
            DateTime   DatePurchased = DateTime.Now.Date;

            APayment.DatePurchased = DatePurchased;
            Assert.AreEqual(DatePurchased, APayment.DatePurchased);
        }
Esempio n. 14
0
        public void PayeeNamePropertyOK()
        {
            clsPayment APayment  = new clsPayment();
            string     PayeeName = "Cadbury";

            APayment.PayeeName = PayeeName;
            Assert.AreEqual(PayeeName, APayment.PayeeName);
        }
Esempio n. 15
0
        public void NameMinMinusOne()
        {
            clsPayment APayment  = new clsPayment();
            string     Error     = "";
            string     PayeeName = "";

            Error = APayment.Valid(PayeeName, Method, Amount, CardNumber, DatePurchased, Email);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 16
0
        public void NameExtremeMax()
        {
            clsPayment APayment  = new clsPayment();
            string     Error     = "";
            string     PayeeName = "";

            PayeeName = PayeeName.PadRight(500, 'a');
            Error     = APayment.Valid(PayeeName, Method, Amount, CardNumber, DatePurchased, Email);
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 17
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            clsPayment APayment = new clsPayment();

            APayment.PaymentId = -1;
            PaymentAddForm PA = new PaymentAddForm();

            this.Hide();
            PA.ShowDialog();
        }
Esempio n. 18
0
        public void CostPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment AnPayment = new clsPayment();
            //create some test data to assign to the property
            Double TestData = 3.00;

            //asign the data to the property
            AnPayment.Cost = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnPayment.Cost, TestData);
        }
Esempio n. 19
0
        public void EmployeeIDPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment AnPayment = new clsPayment();
            //create some test data to assign to the property
            string TestData = "E12334534";

            //assign the data to the property
            AnPayment.EmployeeID = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnPayment.EmployeeID, TestData);
        }
Esempio n. 20
0
        public void EmailPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment APayment = new clsPayment();
            //create some test data to assign to the property
            string Email = "*****@*****.**";

            //assign the data to the property
            APayment.Email = Email;
            //test to see that the two values are the same
            Assert.AreEqual(APayment.Email, Email);
        }
Esempio n. 21
0
        public void DateTimePropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment AnPayment = new clsPayment();
            //create some test data to assign to the property
            DateTime TestData = Convert.ToDateTime("22/02/2016");

            //assign the data to the property
            AnPayment.DateTime = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnPayment.DateTime, TestData);
        }
Esempio n. 22
0
        public void FirstNamePropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment AnPayment = new clsPayment();
            //create some test data to assign to the property
            string TestData = "John";

            //assign the data to the property
            AnPayment.FirstName = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnPayment.FirstName, TestData);
        }
Esempio n. 23
0
        public void EmailPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment APayment = new clsPayment();
            //create data
            string TestData = "Email";

            //assign the data to the property
            APayment.Email = TestData;
            //test to see that the two values are eqaul
            Assert.AreEqual(APayment.Email, TestData);
        }
Esempio n. 24
0
        public void ExpiryDatePropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment APayment = new clsPayment();
            //create data
            DateTime TestData = DateTime.Now.Date;

            //assign data to property
            APayment.ExpiryDate = TestData;
            //test to see if the two are equal
            Assert.AreEqual(APayment.ExpiryDate, TestData);
        }
Esempio n. 25
0
        public void DescriptionPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment AnPayment = new clsPayment();
            //create some test data to assign to the property
            string TestData = "Car MOT";

            //assign the data to the property
            AnPayment.Description = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnPayment.Description, TestData);
        }
Esempio n. 26
0
        public void CVVNoPropertyOK()
        {
            //create an instance of the class we want to create
            clsPayment APayment = new clsPayment();
            //test to see it exists
            Int32 TestData = 1;

            //assign data to property
            APayment.CVVNo = TestData;
            //test to see the two values are equal
            Assert.AreEqual(APayment.CVVNo, TestData);
        }
Esempio n. 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        objpayment = new clsPayment();
        sCOM       = new Common();
        if (!Page.IsPostBack)
        {
            sSQL = objpayment.DispDataAll();


            //To Fill Gridview
            sCOM.setGridView(GridView1, sSQL);
        }
    }
Esempio n. 28
0
 public void UpdateData(clsPayment objpayment, string paymentcode)
 {
     cmd  = new SqlCommand();
     myDB = new DBHelper();
     sSQL = "UPDATE Payment set PaymentDate=@PaymentDate,CustCode=@CustCode,Amount=@Amount,ReferenceNo=@ReferenceNo,ReferenceDate=@ReferenceDate,Mode=@Mode,BankName=@BankName,ChequeNo=@ChequeNo,ChequeDate=@ChequeDate,Username=@Username where PaymentCode=" + paymentcode;
     cmd.Parameters.AddWithValue("@PaymentDate", objpayment.PaymentDate);
     cmd.Parameters.AddWithValue("@CustCode", objpayment.CustCode);
     cmd.Parameters.AddWithValue("@Amount", objpayment.Amount);
     cmd.Parameters.AddWithValue("@ReferenceNo", objpayment.ReferenceNo);
     cmd.Parameters.AddWithValue("@ReferenceDate", objpayment.ReferenceDate);
     cmd.Parameters.AddWithValue("@Mode", objpayment.Mode);
     cmd.Parameters.AddWithValue("@BankName", objpayment.BankName);
     cmd.Parameters.AddWithValue("@ChequeNo", objpayment.ChequeNo);
     cmd.Parameters.AddWithValue("@ChequeDate", objpayment.ChequeDate);
     cmd.Parameters.AddWithValue("@Username", objpayment.Username);
     myDB.Execute(sSQL, cmd);
 }
Esempio n. 29
0
    public void InsertData(clsPayment objpayment)
    {
        cmd  = new SqlCommand();
        myDB = new DBHelper();
        sSQL = "INSERT into Payment(PaymentDate,CustCode,Amount,ReferenceNo,ReferenceDate,Mode,BankName,ChequeNo,ChequeDate,Username)values (@PaymentDate,@CustCode,@Amount,@ReferenceNo,@ReferenceDate,@Mode,@BankName,@ChequeNo,@ChequeDate,@Username)";
        cmd.Parameters.AddWithValue("@PaymentDate", objpayment.PaymentDate);
        cmd.Parameters.AddWithValue("@CustCode", objpayment.CustCode);
        cmd.Parameters.AddWithValue("@Amount", objpayment.Amount);
        cmd.Parameters.AddWithValue("@ReferenceNo", objpayment.ReferenceNo);
        cmd.Parameters.AddWithValue("@ReferenceDate", objpayment.ReferenceDate);
        cmd.Parameters.AddWithValue("@Mode", objpayment.Mode);
        cmd.Parameters.AddWithValue("@BankName", objpayment.BankName);
        cmd.Parameters.AddWithValue("@ChequeNo", objpayment.ChequeNo);
        cmd.Parameters.AddWithValue("@ChequeDate", objpayment.ChequeDate);
        cmd.Parameters.AddWithValue("@Username", objpayment.Username);


        myDB.Execute(sSQL, cmd);
    }
Esempio n. 30
0
        private DataSet ApproveReceipt(clsPayment objEntity)
        {
            // implement the logic here
            clsACCommon objAccountBAL = new clsACCommon();
            DataSet     dsApprove     = new DataSet();

            if (ProcessMasterInfo.EntityStatus == RECEIPT_STATUS_APPROVED)
            {
                if (objEntity.PaymentNo != "")
                {
                    DataTable dt = objAccountBAL.AddUpdatePayment(objEntity, objEntity.AuditLogHeader, true, true);
                    dsApprove.Tables.Add(dt);
                }
            }
            //else
            //    dsApprove = objClientBI.SaveUnApprovedInfo(objClient);
            objAccountBAL = null;
            return(dsApprove);
        }