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); }
public bool UpdateUrl(Common.TrafficRelay trafficRelay) { return(ExecuteSPCommand("UpdateUrl", "@Guid", trafficRelay.TrafficRelayGuid, "@Title", trafficRelay.Title, "@Url", trafficRelay.Url, "@TryCount", trafficRelay.TryCount, "@IsActive", trafficRelay.IsActive)); }
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)); }
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; } }
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"); } }
public static bool UpdateUrl(Common.TrafficRelay trafficRelay) { Business.TrafficRelay trafficRelayController = new Business.TrafficRelay(); return(trafficRelayController.UpdateUrl(trafficRelay)); }