Beispiel #1
0
        public void ComplaintDescriptionPropertyOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //create some test data to assign to the property
            string TestData = "Phone screen damaged during shipping";

            //assign the data to the property
            AComplaint.ComplaintDescription = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AComplaint.ComplaintDescription, TestData);
        }
Beispiel #2
0
        public void AddressNoPropertyOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //create some test data to assign to the property
            string TestData = "Rutvik";

            //assign the data to the property
            AComplaint.CustomerFullName = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AComplaint.CustomerFullName, TestData);
        }
Beispiel #3
0
        public void ComplaintsIDPropertyOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //create some test data to assign to the property
            Int32 TestData = 2;

            //assign the data to the property
            AComplaint.ComplaintsID = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AComplaint.ComplaintsID, TestData);
        }
Beispiel #4
0
        public void ActivePropertyOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //create some test data to assign to the property
            Boolean issueSolved = true;

            //assign the data to the property
            AComplaint.IssueSolved = issueSolved;
            //test to see that the two values are the same
            Assert.AreEqual(AComplaint.IssueSolved, issueSolved);
        }
Beispiel #5
0
        public void ComplaintDatePropertyOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //create some test data to assign to the property
            DateTime TestData = DateTime.Now.Date;

            //assign the data to the property
            AComplaint.ComplaintDate = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AComplaint.ComplaintDate, TestData);
        }
Beispiel #6
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 ComplaintID = 1;

            //invoke the method
            Found = AComplaint.Find(ComplaintID);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        clsComplaint AComplaint = new clsComplaint();

        AComplaint = (clsComplaint)Session["AComplaint"];
        Response.Write(AComplaint.ComplaintsID);


        Response.Write(AComplaint.CustomerID);
        Response.Write(AComplaint.CustomerFullName);
        Response.Write(AComplaint.ComplaintDate);
        Response.Write(AComplaint.ComplaintDescription);
        Response.Write(AComplaint.IssueSolved);
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        clsComplaint AComplaint = new clsComplaint();

        AComplaint.ComplaintsID = Convert.ToInt32(txtComplaintsID.Text);

        AComplaint.CustomerID = Convert.ToInt32(txtCustomerID.Text);

        AComplaint.CustomerFullName = txtCustomerFullName.Text;

        AComplaint.ComplaintDate = Convert.ToDateTime(txtComplaintDate.Text);

        AComplaint.ComplaintDescription = txtComplaintDescription.Text;

        AComplaint.IssueSolved = Convert.ToBoolean(chkIssueSolved.Text);
        Session["AComplaint"]  = AComplaint;
        Response.Redirect("ComplaintsViewer.aspx");
    }
Beispiel #9
0
        public void TestActiveFound()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 IssueSolved = 21;

            //invoke the method
            Found = AComplaint.Find(IssueSolved);
            //check the property
            if (AComplaint.IssueSolved != true)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Beispiel #10
0
        public void TestComplaintDateFound()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 ComplaintDate = 21;

            //invoke the method
            Found = AComplaint.Find(ComplaintDate);
            //check the address no
            if (AComplaint.ComplaintDate != Convert.ToDateTime("16/09/2015"))
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Beispiel #11
0
        public void TestComplaintDescriptionFound()
        {
            //create an instance of the class we want to create
            clsComplaint AComplaint = new clsComplaint();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 ComplaintIDs = 21;

            //invoke the method
            Found = AComplaint.Find(ComplaintIDs);
            //check the address no
            if (AComplaint.ComplaintDescription != "Damaged")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Beispiel #12
0
        public void InstanceOK()
        {
            clsComplaint AComplaint = new clsComplaint();

            Assert.IsNotNull(AComplaint);
        }
Beispiel #13
0
        public ActionResult Complaint(clsComplaint oTbl)
        {
            string sLine = "";
            var    sMsg  = new { Message = "Successfully Saved ...", MsgID = 1, ComplaintNo = "0" };

            try
            {
                string       CompNo  = DateTime.Now.Date.Date.ToString("yy") + DateTime.Now.Date.Date.ToString("MM") + DateTime.Now.Date.Date.ToString("dd");
                int          iCustID = 0;
                tblComplaint oComp   = new tblComplaint();

                oComp.CustID = oTbl.CustID;
                if (oTbl.IsNewCust == 1)
                {
                    iCustID = Convert.ToInt32(oSubmit.GetSingleData("Select isnull(max(studCode)+1,1) from studdet where studType = 68", "0", true));
                    studdet Cust = new studdet();
                    Cust.studType = 68;
                    Cust.studCode = iCustID;
                    Cust.studName = oTbl.studName;
                    Cust.studadd1 = oTbl.studadd1;
                    Cust.studadd2 = oTbl.studadd2;
                    Cust.studcity = oTbl.studcity;
                    Cust.studstat = oTbl.studstat;
                    Cust.studphon = oTbl.studphon;

                    db.studdets.InsertOnSubmit(Cust);
                    db.SubmitChanges();

                    oComp.CustID = iCustID;
                }

                sLine = "1";

                oComp.CompNo = CompNo + GetNo(oSubmit.GetSingleData("Select isnull(max(CompID)+1,1) from tblComplaint", "0", true).ToString());
                //oComp.CompDt = oSubmit.GetDateFormat(oTbl.CompDt.ToString());
                sLine           = "2";
                oComp.CreatedOn = DateTime.Now;
                oComp.StatusID  = 1;
                oComp.UserID    = SessionMaster.UserID;
                sLine           = "3";
                if (oTbl.sTentetiveTm != null && oTbl.sTentetiveTm.ToString() != "")
                {
                    oComp.TentetiveTm = oSubmit.GetDate(oTbl.sTentetiveTm.ToString());
                }

                sLine  = "4";
                sLine += oTbl.CompDt.ToString();

                oComp.CompDt   = oSubmit.GetDate(oTbl.sCompDt.ToString());
                sLine          = "5";
                oComp.DealerID = oTbl.DealerID;

                oComp.CustNM      = oTbl.CustNM;
                oComp.ModelNo     = oTbl.ModelNo;
                oComp.SrvType     = oTbl.SrvType;
                oComp.EmpID       = oTbl.EmpID;
                oComp.ItemID      = oTbl.ItemID;
                oComp.InvNo       = oTbl.InvNo;
                oComp.Charge      = oTbl.Charge;
                oComp.Remark_Cust = oTbl.Remark_Cust;
                oComp.Remark_Mgr  = oTbl.Remark_Eng; //Remark_Eng to Remark_Mgr 181101

                oComp.cmIsRead   = 1;                //181027
                oComp.cmIsPaid   = oTbl.IsPaid;      //181027
                oComp.cmSrvcMode = oTbl.IsSrvcMode;  //181027
                oComp.cmCategory = oTbl.Category;    //181027

                db.tblComplaints.InsertOnSubmit(oComp);
                db.SubmitChanges();

                CompNo = CompNo + GetNo(oSubmit.GetSingleData("Select isnull(max(CompID)+1,1) from tblComplaint", "0", true).ToString());

                sMsg = new { Message = "Complaint Successfully Registered . Your Complaint No Is " + CompNo + " .", MsgID = 1, ComplaintNo = CompNo };
            }
            catch (Exception ex)
            {
                sMsg = new { Message = sLine + "#" + ex.Message, MsgID = 2, ComplaintNo = "0" };
            }

            return(Json(sMsg, JsonRequestBehavior.AllowGet));
        }