コード例 #1
0
        public JBISpecificResponse GetSpecificJBI(int idJBI)
        {
            JBISpecificResponse response = new JBISpecificResponse();

            try
            {
                JBI one = _context.JBIs.Where((x) => x.Moneln == idJBI).FirstOrDefault();

                if (one != null)
                {
                    response.JBI   = ConvertJBI(one);
                    response.rc    = 0;
                    response.title = "Get one JBI success";
                }
                else
                {
                    response.rc    = 1;
                    response.title = "Id is not found";
                }
            }
            catch (Exception ex)
            {
                var message = ex.Message;
                response.desc = ex.Message;
            }

            return(response);
        }
コード例 #2
0
ファイル: JBIManager.cs プロジェクト: shaykeshok/PR-CRM
        public JBISpecificResponse GetSpecificJBI(int idJBI)
        {
            JBISpecificResponse response = new JBISpecificResponse();

            using (DalJBI context = new DalJBI())
            {
                response = context.GetSpecificJBI(idJBI);
            }


            return(response);
        }
コード例 #3
0
ファイル: JBIController.cs プロジェクト: shaykeshok/PR-CRM
        // GET: api/JBI/5
        public JBISpecificResponse GetSpecificJBI(int idJBI)
        {
            JBISpecificResponse response = new JBISpecificResponse();

            try
            {
                using (var manager = new JBIManager())
                {
                    response = manager.GetSpecificJBI(idJBI);
                }
            }
            catch (Exception ex)
            {
                //-----------------------------------------------------------------------------adderror to db---------------------------------------------------------------------------------------------
                response.title = "Error in GetSpecificJBI function";
                response.body  = ex.Message;
                response.rc    = 99;
            }
            return(response);
        }