Exemplo n.º 1
0
    /// <summary>
    /// Load available options from loaded frame type
    /// </summary>
    private void LoadFrameTypeToOpTextArea(string ftype)
    {
        db_config_options dco = null;

        try
        {
            dco = new db_config_options("frame", ftype);
            dco.Open();

            Options op = dco.Get(ftype);

            aval_type_op.InnerHtml = op.Options1;
        }
        catch (Exception ex)
        {
            throw new Exception("error: build default frame type (" + ftype + "): " + ex.Message);
        }
        finally
        {
            if (dco != null)
                dco.Close();
        }
    }
Exemplo n.º 2
0
    public string GetAvailableOption(string objType, string name, string ctrl)
    {
        string crlHash = Generic.GetHash(Generic.GetWebConfigValue("WebServiceKey"));

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

        db_config_options dco = null;

        try
        {
            dco = new db_config_options(objType, name);
            dco.Open();

            Options option = dco.Get(name);

            return option.Options1;
        }
        catch (Exception ex)
        {
            return ex.Message;
        }
        finally
        {
            if (dco != null)
                dco.Close();
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// build the schedule interval select box
    /// </summary>
    private void BuildScheduleInterval(int? interval)
    {
        db_config_options dco = null;

        f_schedule_interval.Items.Clear();

        try
        {
            dco = new db_config_options("backoffice", "frame_options");
            dco.Open();

            Options op = dco.Get("frame_options");

            OptionItems oi = new OptionItems(op.Options1);

            List<string> scheduleList = oi.GetList("schedule_interval");

            for (int i = 0; i < scheduleList.Count; i++)
            {
                string[] schedule = scheduleList[i].Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries);

                f_schedule_interval.Items.Add(new ListItem(
                                                            schedule[1],
                                                            schedule[0]
                                                            ));

                try
                {
                    if (Convert.ToInt32(schedule[0]) == interval)
                        f_schedule_interval.SelectedIndex = i;
                } catch {}
            }
        }
        catch (Exception ex)
        {
            throw new Exception("error: build frame type " + ex.Message);
        }
        finally
        {
            if (dco != null)
                dco.Close();
        }
    }