예제 #1
0
        public void UpdateMethodOK()
        {
            var AllClaims  = new clsClaimCollection();
            var TestItem   = new clsClaim();
            var PrimaryKey = 0;

            TestItem.ClaimStatus = true;
            TestItem.ClaimAmnt   = 295255.18M;
            TestItem.ClaimDate   = DateTime.Now.Date;
            TestItem.ClaimID     = 1;
            TestItem.ClaimReason = "sem";
            TestItem.CustomerID  = 8194;
            TestItem.StaffID     = 16;
            AllClaims.ThisClaim  = TestItem;
            PrimaryKey           = AllClaims.Add();
            TestItem.ClaimID     = PrimaryKey;
            TestItem.ClaimStatus = false;
            TestItem.ClaimAmnt   = 125.12M;
            TestItem.ClaimDate   = DateTime.Now.Date;
            TestItem.ClaimID     = 95;
            TestItem.ClaimReason = "Lorem Ipsum";
            TestItem.CustomerID  = 34;
            TestItem.StaffID     = 81;
            AllClaims.ThisClaim  = TestItem;
            AllClaims.Update();
            AllClaims.ThisClaim.Find(PrimaryKey);
            Assert.AreEqual(AllClaims.ThisClaim, TestItem);
        }
예제 #2
0
        public void ReportByClaimReasonNoneFound()
        {
            var FilteredClaims = new clsClaimCollection();

            FilteredClaims.ReportByClaimReason("xxxxxxxxx");
            Assert.AreEqual(0, FilteredClaims.Count);
        }
예제 #3
0
        public void ReportByClaimReasonMethodOK()
        {
            var AllClaims      = new clsClaimCollection();
            var FilteredClaims = new clsClaimCollection();

            FilteredClaims.ReportByClaimReason("");
            Assert.AreEqual(AllClaims.Count, FilteredClaims.Count);
        }
예제 #4
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        var ClaimList = new clsClaimCollection();

        ClaimList.ThisClaim.Find(ClaimID);
        ClaimList.Delete();
        Response.Redirect("ClaimList.aspx");
    }
예제 #5
0
    private void DisplayClaims()
    {
        var Claims = new clsClaimCollection();

        lstClaimList.DataSource     = Claims.ClaimList;
        lstClaimList.DataValueField = "ClaimID";
        lstClaimList.DataTextField  = "ClaimReason";
        lstClaimList.DataBind();
    }
예제 #6
0
    protected void btnApply_Click(object sender, EventArgs e)
    {
        var Claims = new clsClaimCollection();

        Claims.ReportByClaimReason(txtClaimReason.Text);
        lstClaimList.DataSource     = Claims.ClaimList;
        lstClaimList.DataValueField = "ClaimID";
        lstClaimList.DataTextField  = "ClaimReason";
        lstClaimList.DataBind();
    }
예제 #7
0
    protected void DisplayClaim()
    {
        var ClaimList = new clsClaimCollection();

        ClaimList.ThisClaim.Find(ClaimID);
        txtClaimID.Text     = Convert.ToString(ClaimList.ThisClaim.ClaimID);
        txtCustomerID.Text  = Convert.ToString(ClaimList.ThisClaim.CustomerID);
        txtStaffID.Text     = Convert.ToString(ClaimList.ThisClaim.StaffID);
        txtClaimDate.Text   = Convert.ToString(ClaimList.ThisClaim.ClaimDate);
        txtClaimAmnt.Text   = Convert.ToString(ClaimList.ThisClaim.ClaimAmnt);
        txtClaimStatus.Text = Convert.ToString(ClaimList.ThisClaim.ClaimStatus);
        txtClaimReason.Text = Convert.ToString(ClaimList.ThisClaim.ClaimReason);
    }
예제 #8
0
        public void ThisClaimPropertyOK()
        {
            var AllClaims = new clsClaimCollection();
            var TestClaim = new clsClaim();

            TestClaim.ClaimAmnt   = 295255.18M;
            TestClaim.ClaimDate   = DateTime.Now.Date;
            TestClaim.ClaimID     = 1;
            TestClaim.ClaimReason = "sem";
            TestClaim.CustomerID  = 8194;
            TestClaim.StaffID     = 32;
            AllClaims.ThisClaim   = TestClaim;
            Assert.AreEqual(AllClaims.ThisClaim, TestClaim);
        }
예제 #9
0
        public void ListAndCountOK()
        {
            var AllClaims = new clsClaimCollection();
            var TestList  = new List <clsClaim>();
            var TestItem  = new clsClaim();

            TestItem.ClaimStatus = true;
            TestItem.ClaimAmnt   = 295255.18M;
            TestItem.ClaimDate   = DateTime.Now.Date;
            TestItem.ClaimID     = 1;
            TestItem.ClaimReason = "sem";
            TestItem.CustomerID  = 8194;
            TestItem.StaffID     = 16;
            TestList.Add(TestItem);
            AllClaims.ClaimList = TestList;
            Assert.AreEqual(AllClaims.Count, TestList.Count);
        }
예제 #10
0
    protected void btnOk_Click(object sender, EventArgs e)
    {
        var AClaim      = new clsClaim();
        var ClaimReason = txtClaimReason.Text;
        var ClaimDate   = txtClaimDate.Text;
        var ClaimAmnt   = txtClaimAmnt.Text;
        var CustomerID  = txtCustomerID.Text;
        var StaffID     = txtStaffID.Text;
        var ClaimStatus = txtClaimStatus.Text;
        var error       = "";

        error = AClaim.Valid(StaffID, CustomerID, ClaimDate, ClaimAmnt, ClaimReason, ClaimStatus);

        if (error == "")
        {
            AClaim.ClaimID     = ClaimID;
            AClaim.ClaimReason = ClaimReason;
            AClaim.ClaimDate   = Convert.ToDateTime(ClaimDate);
            AClaim.CustomerID  = Convert.ToInt32(CustomerID);
            AClaim.ClaimAmnt   = Convert.ToDecimal(ClaimAmnt);
            AClaim.ClaimStatus = Convert.ToBoolean(ClaimStatus);
            AClaim.StaffID     = Convert.ToInt32(StaffID);

            var ClaimList = new clsClaimCollection();

            if (ClaimID == -1)
            {
                ClaimList.ThisClaim = AClaim;
                ClaimList.Add();
            }
            else
            {
                ClaimList.ThisClaim.Find(ClaimID);
                ClaimList.ThisClaim = AClaim;
                ClaimList.Update();
            }

            Response.Redirect("ClaimList.aspx");
        }
        else
        {
            lblError.Text = error;
        }
    }
예제 #11
0
        public void DeleteMethodOK()
        {
            var AllClaims  = new clsClaimCollection();
            var TestItem   = new clsClaim();
            var PrimaryKey = 0;

            TestItem.ClaimStatus = true;
            TestItem.ClaimAmnt   = 295255.18M;
            TestItem.ClaimDate   = DateTime.Now.Date;
            TestItem.ClaimID     = 1;
            TestItem.ClaimReason = "sem";
            TestItem.CustomerID  = 8194;
            TestItem.StaffID     = 16;
            AllClaims.ThisClaim  = TestItem;
            PrimaryKey           = AllClaims.Add();
            TestItem.ClaimID     = PrimaryKey;
            AllClaims.ThisClaim.Find(PrimaryKey);
            AllClaims.Delete();
            var found = AllClaims.ThisClaim.Find(PrimaryKey);

            Assert.IsFalse(found);
        }
예제 #12
0
        public void ReportByClaimReasonDataFound()
        {
            var FilteredClaims = new clsClaimCollection();
            var OK             = true;

            FilteredClaims.ReportByClaimReason("sem. Pellentesque ut ipsum");
            if (FilteredClaims.Count == 2)
            {
                if (FilteredClaims.ClaimList[0].ClaimID != 2)
                {
                    OK = false;
                }
                if (FilteredClaims.ClaimList[1].ClaimID != 11)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
예제 #13
0
        public void InstanceOK()
        {
            var AllClaims = new clsClaimCollection();

            Assert.IsNotNull(AllClaims);
        }