Esempio n. 1
0
        private int CancelSecurities(int submitId, int commandId, List <EntrustSecurity> entrustedSecuItems)
        {
            //set the status as EntrustStatus.CancelToDB in database
            int ret = _entrustCombineBLL.UpdateSecurityEntrustStatus(entrustedSecuItems, EntrustStatus.CancelToDB);

            if (ret <= 0)
            {
                return(ret);
            }

            int result      = 0;
            var bllResponse = _ufxWithdrawSyncBLL.Withdraw(submitId, commandId, entrustedSecuItems);

            if (BLLResponse.Success(bllResponse))
            {
                result = 1;
                ret    = _entrustCombineBLL.UpdateSecurityEntrustStatus(entrustedSecuItems, EntrustStatus.CancelSuccess);
            }
            else
            {
                ret = _entrustCombineBLL.UpdateSecurityEntrustStatus(entrustedSecuItems, EntrustStatus.CancelFail);
            }

            return(result);
        }
Esempio n. 2
0
        //private void CancelRedo(int submitId, List<CancelRedoItem> cancelRedoItems)
        //{
        //    //var submitId = cancelRedoItems.Select(p => p.SubmitId).Single();
        //    //if (submitId <= 0)
        //    //{
        //    //    //TODO: fail to get the submitId
        //    //    return;
        //    //}
        //    //set the cancel status
        //    //int ret = _entrustBLL.Cancel(cancelRedoItems);

        //    //Call the UFX to cancel

        //    //Update the EntrustCommand
        //    //_entrustBLL.Submit(

        //    //ret = _entrustBLL.CancelSuccess(cancelRedoItems);
        //}


        //TODO: validate before submit
        private string Submit(int commandId, List <CancelRedoItem> cancelRedoItems, CallerCallback callback)
        {
            EntrustCommand cmdItem = new EntrustCommand
            {
                CommandId = commandId,
                Copies    = 0,
            };

            string msg      = string.Empty;
            var    response = _entrustBLL.SubmitOne(cmdItem, cancelRedoItems, callback);

            if (!BLLResponse.Success(response))
            {
                int submitId = cancelRedoItems.Select(p => p.SubmitId).Distinct().Single();

                string format = ConfigManager.Instance.GetLabelConfig().GetLabelText(msgEntrustCancelResubmitFail);
                msg = string.Format(format, submitId, response.Message);
            }

            return(msg);
        }