/// <summary>
        /// manage's customed portlet adjustment
        /// </summary>
        /// <param name="column_ID">portlet column id</param>
        /// <param name="portlet_ID">portlet id</param>
        /// <param name="row_No">row no in particular portlet column</param>
        /// <param name="is_Drop">change in portlet category show 1 else 0</param>
        public ActionResult PortletsStatusManager(string portlet_ID, bool is_Active)
        {
            // invalid portlet id
            if (portlet_ID == null)
            {
                return(View("ErrorPortalItem"));
            }

            #region declaration
            int _portlet_ID = Convert.ToInt32(portlet_ID.ToString().Replace("portlet", ""));

            WebApplication.Models.ds _ds = (WebApplication.Models.ds)Session["data"];

            string    filter = " portlet_ID = " + _portlet_ID.ToString();
            DataRow[] rows   = _ds.Portlet_User.Select(filter);
            #endregion

            #region portlet placement
            if (rows.Length == 1)
            {
                rows[0]["Is_Active"] = is_Active;
            }

            _ds.AcceptChanges();
            Session["data"] = _ds;
            #endregion

            return(View("ErrorPortalItem"));
        }
        /// <summary>
        /// manage's customed portlet adjustment
        /// </summary>
        /// <param name="column_ID">portlet column id</param>
        /// <param name="portlet_ID">portlet id</param>
        /// <param name="row_No">row no in particular portlet column</param>
        /// <param name="is_Drop">change in portlet category show 1 else 0</param>
        public ActionResult PortletsPlacementManager(string column_ID, string portlet_ID, int?row_No, int?is_Drop)
        {
            // invalid portlet id
            if (column_ID == null || portlet_ID == null || row_No == null || is_Drop == null)
            {
                return(View("ErrorPortalItem"));
            }

            #region declaration
            int _portlet_ID = Convert.ToInt32(portlet_ID.ToString().Replace("portlet", ""));
            int category_ID = Convert.ToInt32(column_ID.Replace("portletColumn", "").Substring(1));
            int column_No   = Convert.ToInt32(column_ID.Replace("portletColumn", "").Substring(0, 1));

            WebApplication.Models.ds _ds = (WebApplication.Models.ds)Session["data"];

            string    filter = " portlet_ID = " + _portlet_ID.ToString();
            DataRow[] rows   = _ds.Portlet_User.Select(filter);
            #endregion

            #region portlet placement
            if (rows.Length == 1)
            {
                rows[0]["Category_ID"]  = category_ID;
                rows[0]["Column_No"]    = column_No;
                rows[0]["Row_Sequence"] = Convert.ToInt32(row_No);

                filter = " portlet_ID = " + _portlet_ID.ToString() + " and category_ID =" + category_ID.ToString() +
                         " and column_No = " + column_No.ToString() + " and Row_Sequence > " + row_No.ToString();
                DataRow[] tempRows = _ds.Portlet_User.Select(filter);

                if (is_Drop == 0)
                {
                    int subsequent_Row_No = Convert.ToInt32(row_No) + 1;
                    foreach (DataRow row in tempRows)
                    {
                        row["Row_No"] = subsequent_Row_No;
                        subsequent_Row_No++;
                    }
                }
                else
                {
                    rows[0]["Row_Sequence"] = tempRows.Length + 1;
                }
            }

            _ds.AcceptChanges();
            Session["data"] = _ds;
            #endregion

            return(View("ErrorPortalItem"));
        }
Esempio n. 3
0
        public void Session_OnStart()
        {
            WebApplication.Models.ds _dsSession     = new WebApplication.Models.ds();
            WebApplication.Models.ds _dsApplication = (WebApplication.Models.ds)Application["data"];
            _dsSession.EnforceConstraints = false;

            System.Data.DataRow[] rows = _dsApplication.Portlet.Select();
            System.Data.DataRow   rowTemp;
            foreach (System.Data.DataRow row in  rows)
            {
                rowTemp = _dsSession.Portlet_User.NewRow();
                rowTemp["Category_ID"]      = row["Category_ID"];
                rowTemp["User_ID"]          = Session.Count + 1;
                rowTemp["Portlet_ID"]       = row["Portlet_ID"];
                rowTemp["Column_No"]        = row["Column_No"];
                rowTemp["Row_Sequence"]     = row["Row_Sequence"];
                rowTemp["Title"]            = row["Title"];
                rowTemp["Is_Image_Allowed"] = row["Is_Image_Allowed"];
                rowTemp["Is_Active"]        = true;
                _dsSession.Portlet_User.Rows.Add(rowTemp);
            }

            Session["data"] = _dsSession;
        }