コード例 #1
0
        protected void OnSaveParamAddEditUrl(Object Sender, EventArgs args)
        {
            //try {

            RedirectInfoParam rp = new RedirectInfoParam()
            {
                ModuleId    = ModuleId,
                Param       = tbParamRed_Name.Text,
                ParamType   = (RedirectInfoParam.eParamType)Enum.Parse(typeof(RedirectInfoParam.eParamType), ddParamType.SelectedValue, false),
                Operation   = (RedirectInfoParam.eOperation)Enum.Parse(typeof(RedirectInfoParam.eOperation), ddParamOp.SelectedValue, false),
                Value       = tbParamRed_Value.Text,
                RedirectUrl = cbParamRed_KeepOnPage.Checked ? null : tbParamRed_Url.Text,
                LogoutUser  = cbParamRed_Logout.Checked
            };

            if (rp.Operation == RedirectInfoParam.eOperation.Exists || rp.Operation == RedirectInfoParam.eOperation.NotExists)
            {
                rp.Value = ""; // unary operation
            }

            rp.Save();
            BindData();

            //} catch (Exception) {
            //    lblMsg.Visible = true;
            //    lblMsg.InnerHtml = "Error saving redirect!";
            //    lblMsg.Style["background-color"] = "#FF9999";
            //    Page.ClientScript.RegisterStartupScript(GetType(), "timeoutSuccessMsg", "<script type='text/javascript'>setTimeout(function() { document.getElementById('" + lblMsg.ClientID + "').style.display = 'none'; }, 6000);</script>");
            //}
        }
コード例 #2
0
        protected void OnRowCmdParams(Object Sender, GridViewCommandEventArgs args)
        {
            RedirectController redirCtrl = new RedirectController();

            switch (args.CommandName)
            {
            case "del":
                redirCtrl.RemoveRedirectParam(Convert.ToInt32(args.CommandArgument));
                break;

            case "priority_up":
                RedirectInfoParam rinc = redirCtrl.GetRedirectParamById(Convert.ToInt32(args.CommandArgument));
                rinc.RedirectPriority++;
                rinc.Save();
                break;

            case "priority_down":
                RedirectInfoParam rdec = redirCtrl.GetRedirectParamById(Convert.ToInt32(args.CommandArgument));
                rdec.RedirectPriority--;
                rdec.Save();
                break;
            }

            BindData();
        }
コード例 #3
0
 public void UpdateRedirectParam(int moduleId, string paramName, RedirectInfoParam.eParamType paramType, RedirectInfoParam.eOperation operation, string value, string url, int priority, bool logoutUser)
 {
     DataProvider.Instance().UpdateRedirectParam(moduleId, paramName, (int)paramType, (int)operation, value, url, priority, logoutUser);
 }
コード例 #4
0
        protected void OnSaveParamAddEditUrl(Object Sender, EventArgs args)
        {
            //try {

            RedirectInfoParam rp = new RedirectInfoParam() {
                ModuleId = ModuleId,
                Param = tbParamRed_Name.Text,
                ParamType = (RedirectInfoParam.eParamType)Enum.Parse(typeof(RedirectInfoParam.eParamType), ddParamType.SelectedValue, false),
                Operation = (RedirectInfoParam.eOperation)Enum.Parse(typeof(RedirectInfoParam.eOperation), ddParamOp.SelectedValue, false),
                Value = tbParamRed_Value.Text,
                RedirectUrl = cbParamRed_KeepOnPage.Checked ? null : tbParamRed_Url.Text,
                LogoutUser = cbParamRed_Logout.Checked
            };

            if (rp.Operation == RedirectInfoParam.eOperation.Exists || rp.Operation == RedirectInfoParam.eOperation.NotExists) {
                rp.Value = ""; // unary operation
            }

            rp.Save();
            BindData();

            //} catch (Exception) {
            //    lblMsg.Visible = true;
            //    lblMsg.InnerHtml = "Error saving redirect!";
            //    lblMsg.Style["background-color"] = "#FF9999";
            //    Page.ClientScript.RegisterStartupScript(GetType(), "timeoutSuccessMsg", "<script type='text/javascript'>setTimeout(function() { document.getElementById('" + lblMsg.ClientID + "').style.display = 'none'; }, 6000);</script>");
            //}
        }