protected void btnSubmit_Click(object sender, EventArgs e) { SMSModel.GatewayConfiguration config = new SMSModel.GatewayConfiguration(); config.Operators = new List <string>(); foreach (ListItem li in cb_operators.Items) { if (li.Selected == true) { config.Operators.Add(li.Value); } } if (config.Operators.Count == 0) { Message.Alert(this, "请选择运营商", "null"); return; } config.HandlingAbility = int.Parse(txt_handlity.Text); config.Gateway = txt_gateway.Text; SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddGatewayConfig(config); if (r.Success) { Message.Success(this, "添加成功", "null"); } else { Message.Alert(this, r.Message, "null"); } }
void load() { string gateway = Request.QueryString["gateway"]; SMSModel.RPCResult <SMSModel.GatewayConfiguration> r = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfig(gateway); if (r.Success) { SMSModel.GatewayConfiguration config = r.Value; if (config != null) { lbl_gateway.Text = config.Gateway; foreach (var v in config.Operators) { if (cb_operators.Items.FindByValue(v) != null) { cb_operators.Items.FindByValue(v).Selected = true; } } txt_handlity.Text = config.HandlingAbility.ToString(); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { string gateway = Request.QueryString["gateway"]; SMSModel.RPCResult <SMSModel.GatewayConfiguration> rpc = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfig(gateway); if (rpc.Success) { SMSModel.GatewayConfiguration config = rpc.Value; config.Operators.Clear(); foreach (ListItem li in cb_operators.Items) { if (li.Selected == true) { config.Operators.Add(li.Value); } } if (config.Operators.Count == 0) { Message.Alert(this, "请选择运营商", "null"); return; } config.HandlingAbility = int.Parse(txt_handlity.Text); SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().UpdateGatewayConfig(config); if (r.Success) { Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, r.Message, "null"); } } else { Message.Alert(this, rpc.Message, "null"); } }