コード例 #1
0
        public void EmpireMarketSegmentRequest()
        {
            ErrorMessage = "";

            //string output = "";
            ObjectParameter tranDt = new ObjectParameter("TranDT", typeof(DateTime));
            ObjectParameter res    = new ObjectParameter("Result", typeof(int));

            try
            {
                _context.usp_QT_EmpireMarketSegment_Request(OperatorCode, Segment, Note, tranDt, res);
                //var collection = _context.usp_QT_EmpireMarketSegment_Request(OperatorCode, Segment, Note, tranDt, res);
                //foreach (var item in collection) output = item.ToString(); // output can be a returned value or an error message

                //if ((int)res.Value == 0) // Object parameters are not populated until after the result set is read
                //{
                //    OperatorName = output;
                //    return;
                //}
                //ErrorMessage = output;
            }
            catch (Exception ex)
            {
                ErrorMessage = (ex.InnerException != null) ? "Request failed. " + ex.InnerException.Message : "Request failed. " + ex.Message;
            }
        }