Beispiel #1
0
    public string MoveFrame(string pageId, string frameId, string pageType, int height, string ctrl)
    {
        string crlHash = Generic.GetHash(Generic.GetWebConfigValue("WebServiceKey"));

        if (ctrl != crlHash) return string.Empty;

        db_config_frame dcf = null;

        try
        {
            int fid = Convert.ToInt32(frameId);
            int pid = Convert.ToInt32(pageId);

            dcf = new db_config_frame(pid);
            dcf.Open();

            int y = dcf.Get(fid).Y;

            List<Frame> frames = (from f in dcf.AllFrames
                                    where f.Y >= y
                                    select f).ToList();

            foreach (Frame f in frames)
            {
                f.Y = f.Y + height;
            }

            dcf.Commit();

            return "Frame moved";
        }
        catch (Exception ex)
        {
            return ex.Message;
        }
        finally
        {
            if (dcf != null)
                dcf.Close();
        }
    }
Beispiel #2
0
    public string GetFrame(string frameId, string ctrl)
    {
        JavaScriptSerializer js = new JavaScriptSerializer();

        string crlHash = Generic.GetHash(Generic.GetWebConfigValue("WebServiceKey"));

        if (ctrl != crlHash) return string.Empty;

        db_config_frame dcf = null;

        try
        {
            int id = Convert.ToInt32(frameId);

            dcf = new db_config_frame(id, false);
            dcf.Open();

            Frame f = dcf.Get(id);

            return js.Serialize(new Dictionary<string, object>
                                                {
                                                    {"ID", f.ID},
                                                    {"PageId", f.IDPage},
                                                    {"Title", f.Title},
                                                    {"X", f.X},
                                                    {"Y", f.Y},
                                                    {"Width", f.Width},
                                                    {"Height", f.Height},
                                                    {"FrameType", f.FrameType},
                                                    {"Scroll", f.Scroll},
                                                    {"Options", f.Options},
                                                    {"IsActive", f.IsActive},
                                                    {"ScheduleInterval", f.ScheduleInterval},
                                                });
        }
        catch (Exception ex)
        {
            loging.Error("BackOffice Frames Webservice", "Get Frame", ex.Message, _logRecord);
        }
        finally
        {
            if (dcf != null)
                dcf.Close();
        }

        return js.Serialize("");
    }
Beispiel #3
0
    /************************ Configurations ************************/
    private void LoadFrame(string id)
    {
        try
        {
            int fId = Convert.ToInt32(id);

            db_config_frame dcf = new db_config_frame(fId, false);
            dcf.Open();

            Frame f = dcf.Get(fId);

            f_id.Value = f.ID.ToString(CultureInfo.InvariantCulture);
            f_title.Value = f.Title;
            f_x.Value = f.X.ToString(CultureInfo.InvariantCulture);
            f_y.Value = f.Y.ToString(CultureInfo.InvariantCulture);
            f_width.Value = f.Width.ToString(CultureInfo.InvariantCulture);
            f_height.Value = f.Height.ToString(CultureInfo.InvariantCulture);
            f_options.InnerHtml = f.Options;

            BuildIsActive(f.IsActive);
            BuildScrollBar(f.Scroll);
            BuildPageSelector(f.IDPage);
            BuildFrameType(f.FrameType);
            BuildScheduleInterval(f.ScheduleInterval);

            LoadFrameTypeToOpTextArea(f.FrameType);
        }
        catch (Exception ex)
        {
            Generic.JavaScriptInjector("alert('" + ex.Message + "');");
        }
    }