コード例 #1
0
 public static Common.TrafficRelay LoadUrl(Guid urlGuid)
 {
     Business.TrafficRelay trafficRelayController = new Business.TrafficRelay();
     Common.TrafficRelay   trafficRelay           = new Common.TrafficRelay();
     trafficRelayController.Load(urlGuid, trafficRelay);
     return(trafficRelay);
 }
コード例 #2
0
 public bool UpdateUrl(Common.TrafficRelay trafficRelay)
 {
     return(ExecuteSPCommand("UpdateUrl",
                             "@Guid", trafficRelay.TrafficRelayGuid,
                             "@Title", trafficRelay.Title,
                             "@Url", trafficRelay.Url,
                             "@TryCount", trafficRelay.TryCount,
                             "@IsActive", trafficRelay.IsActive));
 }
コード例 #3
0
 public bool InsertUrl(Common.TrafficRelay trafficRelay)
 {
     return(ExecuteSPCommand("InsertUrl",
                             "@Guid", Guid.NewGuid(),
                             "@Title", trafficRelay.Title,
                             "@Url", trafficRelay.Url,
                             "@TryCount", trafficRelay.TryCount,
                             "@IsActive", trafficRelay.IsActive,
                             "@UserGuid", trafficRelay.UserGuid));
 }
コード例 #4
0
        private void InitializePage()
        {
            btnSave.Text   = Language.GetString(btnSave.Text);
            btnCancel.Text = Language.GetString(btnCancel.Text);

            if (ActionType == "edit")
            {
                Common.TrafficRelay trafficRelay = new Common.TrafficRelay();
                trafficRelay              = Facade.TrafficRelay.LoadUrl(UrlGuid);
                txtTitle.Text             = trafficRelay.Title;
                txtUrl.Text               = trafficRelay.Url;
                drpTryCount.SelectedValue = trafficRelay.TryCount.ToString();
                chbIsActive.Checked       = trafficRelay.IsActive;
            }
        }
コード例 #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Common.TrafficRelay trafficRelay = new Common.TrafficRelay();
            try
            {
                trafficRelay.Title      = txtTitle.Text;
                trafficRelay.Url        = txtUrl.Text;
                trafficRelay.IsActive   = chbIsActive.Checked;
                trafficRelay.TryCount   = Helper.GetInt(drpTryCount.SelectedValue);
                trafficRelay.CreateDate = DateTime.Now;
                trafficRelay.UserGuid   = UserGuid;

                if (trafficRelay.HasError)
                {
                    throw new Exception(trafficRelay.ErrorMessage);
                }

                switch (ActionType)
                {
                case "edit":
                    trafficRelay.TrafficRelayGuid = UrlGuid;
                    if (!Facade.TrafficRelay.UpdateUrl(trafficRelay))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }

                    break;

                case "insert":
                    if (!Facade.TrafficRelay.InsertUrl(trafficRelay))
                    {
                        throw new Exception(Language.GetString("ErrorRecord"));
                    }

                    break;
                }

                Response.Redirect(string.Format("/PageLoader.aspx?c={0}", Helper.Encrypt((int)Arad.SMS.Gateway.Business.UserControls.UI_TrafficRelays_TrafficRelay, Session)));
            }
            catch (Exception ex)
            {
                ShowMessageBox(ex.Message, string.Empty, "danger");
            }
        }
コード例 #6
0
 public static bool UpdateUrl(Common.TrafficRelay trafficRelay)
 {
     Business.TrafficRelay trafficRelayController = new Business.TrafficRelay();
     return(trafficRelayController.UpdateUrl(trafficRelay));
 }