Example #1
0
        public Oos DoGetOOS(int oosId, Identification identification)
        {
            logger.Log(LogLevel.Trace, AppLib.GetCaller(logger));

            using (SampleDAO dao = new SampleDAO()) {
                return dao.GetOOS(oosId, identification);
            }
        }
Example #2
0
        public Oos GetOosData(string token, object recordId)
        {
            Oos result = new Oos();
            User user = new User();
            int userId = 0;
            this.Token = token;

            if (AppLib.DesignMode)
            {
                return new Oos();
            }
            else
            {
                try
                {
                    using (SystemDAO systemDao = new SystemDAO())
                    {
                        userId = systemDao.GetToken(new Guid(this.Token));
                    }
                    if (userId > 0)
                    {
                        using (UserDAO userDao = new UserDAO())
                        {
                            user = userDao.GetUser(userId);
                        }
                        using (SampleDAO ordersDao = new SampleDAO())
                        {
                            result = ordersDao.GetOOS(Convert.ToInt32(recordId), new Identification() { Token = new Guid(this.Token), UserId = (int)user.UserId });
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return result;
        }