protected void Button2_Click(object sender, EventArgs e) { SmsServer.Model.SmsSpgate model = new SmsServer.Model.SmsSpgate(); model.GateNumber = "old text "; //TestTest(ref model); TestTestEx(model); Response.Write(model.GateNumber); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(string strJson, out string strout) { SmsServer.Model.SmsSpgate model = (SmsServer.Model.SmsSpgate)JavaScriptConvert.DeserializeObject(strJson, typeof(SmsServer.Model.SmsSpgate)); if (dal.ExistsExEx(model)) { strout = "通道号或通道名已存在"; return(false); } strout = "添加通道失败"; //把参数字段匹配好 UpdateSendParams(model); return(dal.Add(model)); }
/// <summary> /// 更新通道的参数字符串 /// </summary> /// <param name="model"></param> private void UpdateSendParams(SmsServer.Model.SmsSpgate model) { StringBuilder objBuilder = new StringBuilder(); objBuilder.Append(model.UseridParamString + "=" + model.UserID + "&"); objBuilder.Append(model.PwdParamString + "=" + model.UserPwd + "&"); objBuilder.Append(model.MobileParamString + "={0}&"); objBuilder.Append(model.MsgParamString + "={1}&"); objBuilder.Append(model.PhoneNumParamString + "={2}&"); objBuilder.Append(model.SubportParamString + "={3}&"); objBuilder.Append(model.GateNoParamString + "={4}"); model.SendParams = objBuilder.ToString(); // model.UseridParamString = ""; // model.PwdParamString = ""; // model.UserID = ""; // model.UserPwd = ""; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(string strJson, out string strout) { SmsServer.Model.SmsSpgate model = (SmsServer.Model.SmsSpgate)JavaScriptConvert.DeserializeObject(strJson, typeof(SmsServer.Model.SmsSpgate)); if (dal.ExistsEx(model)) { strout = "通道名已经存在"; return(false); } strout = "更新通道失败"; //把参数字段匹配好 UpdateSendParams(model); bool bRet = dal.Update(model); if (bRet) { DataCache.DeleteCacheSpgate(model.GateNumber); } //清除缓存 return(bRet); }
private void TestTestEx(SmsServer.Model.SmsSpgate model) { model.GateNumber = "AAAAAAAAAA"; }
private void TestTest(ref SmsServer.Model.SmsSpgate model) { //model = new SmsServer.BLL.SmsSpgate().GetModelByCache("106570003"); }