예제 #1
0
        public int Basket(Param p)
        {
            bool success  = false;
            int  clientID = 0;

            DataAccess.DataAccess da = new DataAccess.DataAccess();
            if (!da.authenticateUser(p))
            {
                CustomException ce = new CustomException();
                ce.o_statusCode    = 1;
                ce.o_statusMessage = "User is not authorised to access the service";
                ce.Title           = "Unauthroised Access Denied";
                throw new FaultException <CustomException>(ce, "Reason : Unauthorised Access");
            }
            else
            {
                string o_statusMessage = "";
                int    o_status        = -1;
                clientID = da.Basket(p, out o_status, out o_statusMessage, 1);
                if (o_status != 0)
                {
                    success  = false;
                    clientID = 0;
                    CustomException ce = new CustomException();
                    ce.o_statusCode    = o_status;
                    ce.o_statusMessage = o_statusMessage;
                    ce.Title           = "Exception Occured in Updating/Inserting the Basket";
                    throw new FaultException <CustomException>(ce, "Reason : Error Occured");
                }
            }
            return(clientID);
        }