예제 #1
0
 protected void rblenabled_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         tmrRefresh.Enabled = Convert.ToBoolean(rblenabled.SelectedValue);
         SettingMgmt.saveSetting("RefreshEnabled-" + Request.RawUrl.Replace("/", "").Replace(".aspx", ""), rblenabled.SelectedValue);
     }
     catch (Exception ex)
     {
         throw; //EventLog.WriteEntry("WinkAtHome.Master.rblenabled_SelectedIndexChanged", ex.Message, EventLogEntryType.Error);
     }
 }
예제 #2
0
 protected void tbTimer_TextChanged(object sender, EventArgs e)
 {
     try
     {
         tmrRefresh.Interval = Convert.ToInt32(tbTimer.Text) * 60000;
         SettingMgmt.saveSetting("RefreshTimer-" + Request.RawUrl.Replace("/", "").Replace(".aspx", ""), tbTimer.Text);
     }
     catch (Exception ex)
     {
         throw; //EventLog.WriteEntry("WinkAtHome.Master.tbTimer_TextChanged", ex.Message, EventLogEntryType.Error);
     }
 }
예제 #3
0
        protected void ibExpand_Click(object sender, EventArgs e)
        {
            try
            {
                string cmdArg = string.Empty;
                if (sender is ImageButton)
                {
                    ImageButton btn = (ImageButton)sender;
                    cmdArg = btn.CommandArgument;
                }
                else if (sender is Button)
                {
                    Button btn = (Button)sender;
                    cmdArg = btn.CommandArgument;
                }
                else if (sender is LinkButton)
                {
                    LinkButton btn = (LinkButton)sender;
                    cmdArg = btn.CommandArgument;
                }

                if (cmdArg == "hide")
                {
                    tblCollapsed.Visible = true;
                    tblExpand.Visible    = false;
                    SettingMgmt.saveSetting("Menu-Default-State", "hide");
                }
                else
                {
                    tblCollapsed.Visible = false;
                    tblExpand.Visible    = true;
                    SettingMgmt.saveSetting("Menu-Default-State", "show");
                }

                cellMenu.BackColor = tblExpand.Visible ? System.Drawing.ColorTranslator.FromHtml("#eeeeee") : System.Drawing.ColorTranslator.FromHtml("#22b9ec");

                Response.Redirect(Request.RawUrl);
            }
            catch (Exception ex)
            {
                throw; //EventLog.WriteEntry("WinkAtHome.Master.ibExpand_Click", ex.Message, EventLogEntryType.Error);
            }
        }
예제 #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataListItem item in dlRequiredSettings.Items)
                {
                    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                    {
                        Label       lbl = (Label)item.FindControl("lblKey");
                        TextBox     tb  = (TextBox)item.FindControl("tbValue");
                        HiddenField hf  = (HiddenField)item.FindControl("hfValue");

                        if (tb.Text != hf.Value)
                        {
                            SettingMgmt.saveSetting(lbl.Text, tb.Text);
                        }
                    }
                }
                foreach (DataListItem item in dlAdditionalSettings.Items)
                {
                    if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
                    {
                        Label       lbl = (Label)item.FindControl("lblKey");
                        TextBox     tb  = (TextBox)item.FindControl("tbValue");
                        HiddenField hf  = (HiddenField)item.FindControl("hfValue");

                        if (tb.Text != hf.Value)
                        {
                            SettingMgmt.saveSetting(lbl.Text, tb.Text);
                        }
                    }
                }

                BindData();
            }
            catch (Exception ex)
            {
                throw; //EventLog.WriteEntry("WinkAtHome.Settings.btnSave_Click", ex.Message, EventLogEntryType.Error);
            }
        }