/// <summary>
        /// retrun Grid window Model json object against window Id
        /// </summary>
        /// <param name="windowNo">window number</param>
        /// <param name="AD_Window_ID">window Id</param>
        /// <returns>grid window json result</returns>
        public JsonResult GetGridWindow(int windowNo, int AD_Window_ID)
        {
            GridWindow wVo       = null;
            string     retJSON   = "";
            string     retError  = null;
            string     windowCtx = "";

            if (Session["ctx"] != null)
            {
                Ctx          lctx = Session["ctx"] as Ctx;
                Ctx          ctx  = new Ctx(lctx.GetMap());
                GridWindowVO vo   = AEnv.GetMWindowVO(ctx, windowNo, AD_Window_ID, 0);
                if (vo != null)
                {
                    wVo     = new GridWindow(vo);
                    retJSON = JsonConvert.SerializeObject(wVo, Formatting.None);
                }
                else
                {
                    retError = "AccessTableNoView";
                }
                windowCtx = JsonConvert.SerializeObject(ctx.GetMap(windowNo));
            }
            else
            {
                retError = "SessionExpired";
            }
            return(Json(new { result = retJSON, error = retError, wCtx = windowCtx }, JsonRequestBehavior.AllowGet));
        }
        }       //	get

        /// <summary>
        ///Constructor
        /// </summary>
        /// <param name="vo"></param>
        public GridWindow(GridWindowVO vo)
        {
            _vo = vo;
            if (LoadTabData())
            {
                //enableEvents();
            }
        }       //	MWindow
Ejemplo n.º 3
0
        /// <summary>
        /// Get and create Window Model Value Object
        /// @ejb.interface-method view-type="both"
        /// </summary>
        /// <param name="ctx">Environment Properties</param>
        /// <param name="WindowNo">number of this window</param>
        /// <param name="AD_Window_ID">the internal number of the window, if not 0, AD_Menu_ID is ignored</param>
        /// <param name="AD_Menu_ID">ine internal menu number, used when AD_Window_ID is 0</param>
        /// <returns>initialized Window Model</returns>
        public GridWindowVO GetWindowVO(Ctx ctx, int WindowNo, int AD_Window_ID, int AD_Menu_ID)
        {
            log.Info("getWindowVO[" + _no + "] Window=" + AD_Window_ID);
            //	log.Fine(ctx);
            GridWindowVO vo = GridWindowVO.Create(ctx, WindowNo, AD_Window_ID, AD_Menu_ID);

            _windowCount++;
            return(vo);
        }
        /// <summary>
        ///  Get Grid Window
        /// </summary>
        /// <param name="ctx"></param>
        /// <param name="WindowNo"></param>
        /// <param name="AD_Window_ID"></param>
        /// <returns></returns>
        public static GridWindow Get(Context ctx, int windowNo, int AD_Window_ID)
        {
            log.Config("Window=" + windowNo + ", AD_Window_ID=" + AD_Window_ID);
            GridWindowVO mWindowVO = GridWindowVO.Create(ctx, windowNo, AD_Window_ID);

            if (mWindowVO == null)
            {
                return(null);
            }
            return(new GridWindow(mWindowVO));
        }       //	get
Ejemplo n.º 5
0
        /// <summary>
        /// Get Window Model object from cache
        /// </summary>
        /// <param name="WindowNo">window Number </param>
        /// <param name="AD_Window_ID">window id </param>
        /// <param name="AD_Menu_ID"> menu id </param>
        /// <returns>return windowVo if found</returns>
        public static GridWindowVO GetMWindowVO(Ctx ctx, int windowNo, int AD_Window_ID, int AD_Menu_ID)
        {
            log.Config("Window=" + windowNo + ", AD_Window_ID=" + AD_Window_ID);
            GridWindowVO mWindowVO = null;
            string       format    = string.Format("{0}{1}{2}{3}", AD_Window_ID, ctx.GetAD_Client_ID(), ctx.GetAD_Role_ID(), ctx.GetAD_Language()); //JID_1238: Addedd language to reset cache

            if (AD_Window_ID != 0)                                                                                                                  // && Ini.IsCacheWindow())	//	try cache always
            {
                mWindowVO = s_windows[format];
                if (mWindowVO != null)
                {
                    mWindowVO = mWindowVO.Clone(ctx, windowNo);
                    log.Info("Cached=" + mWindowVO);
                }
            }

            //  Create Window Model on Client
            if (mWindowVO == null)
            {
                log.Config("create local");
                mWindowVO = GridWindowVO.Create(ctx, windowNo, AD_Window_ID, AD_Menu_ID);
                if (mWindowVO != null)
                {
                    s_windows[format] = mWindowVO;
                }
            }   //	from Client
            if (mWindowVO == null)
            {
                return(null);
            }

            //  Check (remote) context
            //Utility.Ctx ctx = Utility.Env.GetContext();
            if (!mWindowVO.GetCtx().Equals(ctx))
            {
            }
            return(mWindowVO);
        }   //  getWindow
Ejemplo n.º 6
0
        /// <summary>
        /// Get Window Model object from cache
        /// </summary>
        /// <param name="WindowNo">window Number </param>
        /// <param name="AD_Window_ID">window id </param>
        /// <param name="AD_Menu_ID"> menu id </param>
        /// <returns>return windowVo if found</returns>
        public static GridWindowVO GetMWindowVO(Ctx ctx, int windowNo, int AD_Window_ID, int AD_Menu_ID)
        {
            log.Config("Window=" + windowNo + ", AD_Window_ID=" + AD_Window_ID);
            GridWindowVO mWindowVO = null;

            if (AD_Window_ID != 0 && Ini.IsCacheWindow())       //	try cache
            {
                mWindowVO = s_windows[AD_Window_ID];
                if (mWindowVO != null)
                {
                    mWindowVO = mWindowVO.Clone(windowNo);
                    log.Info("Cached=" + mWindowVO);
                }
            }

            //  Create Window Model on Client
            if (mWindowVO == null)
            {
                log.Config("create local");
                mWindowVO = GridWindowVO.Create(ctx, windowNo, AD_Window_ID, AD_Menu_ID);
                if (mWindowVO != null)
                {
                    s_windows[AD_Window_ID] = mWindowVO;
                }
            }   //	from Client
            if (mWindowVO == null)
            {
                return(null);
            }

            //  Check (remote) context
            //Utility.Ctx ctx = Utility.Env.GetContext();
            if (!mWindowVO.GetCtx().Equals(ctx))
            {
            }
            return(mWindowVO);
        }   //  getWindow