Exemple #1
0
        /*----------------------------------------------------------------------------
        *       %%Function: UpdateScanDate
        *       %%Qualified: UniversalUpc.UpcInvCore.UpdateScanDate
        *       %%Contact: rlittle
        *
        *   Get scan information for this scan code (this works for any item type)
        *  ----------------------------------------------------------------------------*/
        public async Task <bool> UpdateScanDate(string sScanCode, string sTitle)
        {
            EnsureServiceConnection();
            USR usr = await m_api.UpdateUpcLastScanDate(sScanCode, sTitle);

            return(usr.Result);
        }
Exemple #2
0
        /*----------------------------------------------------------------------------
        *       %%Function: CreateBook
        *       %%Qualified: UniversalUpc.UpcInvCore.CreateBook
        *       %%Contact: rlittle
        *
        *   Create a Book with the given scan code and title.
        *  ----------------------------------------------------------------------------*/
        public async Task <bool> CreateBook(string sScanCode, string sTitle, string sLocation, Guid crids)
        {
            EnsureServiceConnection();
            USR usr;

            try
            {
                usr = await m_api.CreateBook(sScanCode, sTitle, sLocation);
            }
            catch (Exception exc)
            {
                usr = USR.Failed(exc);
            }

            if (usr.Result)
            {
                m_lp.LogEvent(crids, EventType.Verbose, "Successfully added title for {0}", sScanCode);
            }
            else
            {
                m_lp.LogEvent(crids, EventType.Error, "Failed to add title for {0}", sScanCode);
            }

            return(usr.Result);
        }
Exemple #3
0
        public static USR Failed(Exception e)
        {
            USR sr = new USR();

            sr.Result        = false;
            sr.Reason        = e.Message;
            sr.CorrelationID = Guid.Empty;
            return(sr);
        }
Exemple #4
0
        public static USR FailedCorrelate(Exception e, Guid crids)
        {
            USR sr = new USR();

            sr.Result        = false;
            sr.Reason        = e.Message;
            sr.CorrelationID = crids;
            return(sr);
        }
Exemple #5
0
        public static USR Success()
        {
            USR sr = new USR();

            sr.Result        = true;
            sr.Reason        = null;
            sr.CorrelationID = Guid.Empty;

            return(sr);
        }
Exemple #6
0
        public static USR FromSRCorrelate(TCore.SR sr, Guid crids)
        {
            USR usr = new USR();

            usr.Result        = sr.Result;
            usr.Reason        = sr.Reason;
            usr.CorrelationID = crids;

            return(usr);
        }
Exemple #7
0
        public static USR FromSR(TCore.SR sr)
        {
            USR usr = new USR();

            usr.Result        = sr.Result;
            usr.Reason        = sr.Reason;
            usr.CorrelationID = sr.CorrelationID;

            return(usr);
        }
Exemple #8
0
        public static USR_DiagnosticResult FromTCSR(USR usr)
        {
            USR_DiagnosticResult usrd = new USR_DiagnosticResult();

            usrd.Reason        = usr.Reason;
            usrd.Result        = usr.Result;
            usrd.CorrelationID = usr.CorrelationID;

            return(usrd);
        }
Exemple #9
0
        public static USR_BookInfoList FromTCSR(USR usr)
        {
            USR_BookInfoList usrs = new USR_BookInfoList();

            usrs.Reason        = usr.Reason;
            usrs.Result        = usr.Result;
            usrs.CorrelationID = usr.CorrelationID;

            return(usrs);
        }
Exemple #10
0
        public static USR_DvdInfoEx FromTCSR(USR usr)
        {
            USR_DvdInfoEx usrs = new USR_DvdInfoEx();

            usrs.Reason        = usr.Reason;
            usrs.Result        = usr.Result;
            usrs.CorrelationID = usr.CorrelationID;

            return(usrs);
        }
Exemple #11
0
        public static USR_String FromTCSR(USR usr)
        {
            USR_String usrs = new USR_String();

            usrs.Reason        = usr.Reason;
            usrs.Result        = usr.Result;
            usrs.CorrelationID = usr.CorrelationID;

            return(usrs);
        }
Exemple #12
0
        public static USR ToTcsr(TUSR <T> sr)
        {
            USR usr = new USR();

            usr.Reason        = sr.Reason;
            usr.Result        = sr.Result;
            usr.CorrelationID = sr.CorrelationID;

            return(usr);
        }
Exemple #13
0
        public static USR FailedCorrelate(string sReason, Guid crids)
        {
            USR sr = new USR();

            sr.Result        = false;
            sr.Reason        = sReason;
            sr.CorrelationID = crids;

            return(sr);
        }
Exemple #14
0
        public static USR Failed(string sReason)
        {
            USR sr = new USR();

            sr.Result        = false;
            sr.Reason        = sReason;
            sr.CorrelationID = Guid.Empty;

            return(sr);
        }
Exemple #15
0
        public static USR_WineInfo FromTCSR(USR usr)
        {
            USR_WineInfo usrw = new USR_WineInfo();

            usrw.Reason        = usr.Reason;
            usrw.Result        = usr.Result;
            usrw.CorrelationID = usr.CorrelationID;

            return(usrw);
        }
Exemple #16
0
        public static USR SuccessCorrelate(Guid crids)
        {
            USR sr = new USR();

            sr.Result        = true;
            sr.Reason        = null;
            sr.CorrelationID = crids;

            return(sr);
        }
Exemple #17
0
        /*----------------------------------------------------------------------------
        *       %%Function: CreateBook
        *       %%Qualified: UniversalUpc.UpcInvCore.CreateBook
        *       %%Contact: rlittle
        *
        *   Create a Book with the given scan code and title.
        *  ----------------------------------------------------------------------------*/
        public async Task <bool> UpdateBookScan(string sScanCode, string sTitle, string sLocation, Guid crids)
        {
            EnsureServiceConnection();
            USR usr = await m_api.UpdateBookScan(sScanCode, sTitle, sLocation);

            if (usr.Result)
            {
                m_lp.LogEvent(crids, EventType.Verbose, "Successfully update title for {0}", sScanCode);
            }
            else
            {
                m_lp.LogEvent(crids, EventType.Error, "Failed to update title for {0}", sScanCode);
            }

            return(usr.Result);
        }
Exemple #18
0
        /*----------------------------------------------------------------------------
        *       %%Function: CreateDvd
        *       %%Qualified: UniversalUpc.UpcInvCore.CreateDvd
        *       %%Contact: rlittle
        *
        *   Create a DVD with the given scan code and title.
        *  ----------------------------------------------------------------------------*/
        public async Task <bool> CreateDvd(string sScanCode, string sTitle, Guid crids)
        {
            EnsureServiceConnection();
            USR usr = await m_api.CreateDvd(sScanCode, sTitle);

            if (usr.Result)
            {
                m_lp.LogEvent(crids, EventType.Verbose, "Successfully added title for {0}", sScanCode);
            }
            else
            {
                m_lp.LogEvent(crids, EventType.Error, "Failed to add title for {0}", sScanCode);
            }

            return(usr.Result);
        }