server Error in '/' Application. Input string was not in a correct format.
我在本地测试是正确的,放到服务器中执行出错,字符串格式哪里错了呢,
private string SaveAnswerPageInfo(Yasn.Wap.Models.PersonalInfoModel model, bool isUpdate)
{
string Msg = ""; //字符串,将答题信息放到该字段中
try
{
Hashtable firstInfo = new Hashtable();
firstInfo = (Hashtable)Session["step1"];
Yasn.Model.WXMember WXModel = new Yasn.Model.WXMember(); //实例化微信成员类
WXModel.WXNo = model.WeiXinOpenId; //微信编码
WXModel.CreateDate = DateTime.Now; //创建日期
string vxmid = Yasn.Logic.EduAccessoryWXMember.AddMemberNew(WXModel, ZhanhuiNo); //得到最大的编号
int vxmenberid = Convert.ToInt32(vxmid);
Utils.WriteLog("进入数据保存方法");
string imageUrl = CreateCode_Choose(WXModel.MemberNo.ToString()); //生成二维码
Model.ZhanHuiGuanLianModel ZHGLModel = new Model.ZhanHuiGuanLianModel(); //实例化展会关联类
string phonevalue = "";
string UserNamevalue = "";
string companyvalue = "";
string UserPositionvalue = "";
string UserEmailvalue = "";
foreach (System.Collections.DictionaryEntry de in firstInfo)
{
if (de.Key.ToString() == "Phone")
{
phonevalue = de.Value.ToString();//得到值
break;//退出foreach遍历
}
}
foreach (System.Collections.DictionaryEntry de in firstInfo)
{
if (de.Key.ToString() == "UserName")
{
UserNamevalue = de.Value.ToString();//得到值
break;//退出foreach遍历
}
}
foreach (System.Collections.DictionaryEntry de in firstInfo)
{
if (de.Key.ToString() == "company")
{
companyvalue = de.Value.ToString();//得到值
break;//退出foreach遍历
}
}
foreach (System.Collections.DictionaryEntry de in firstInfo)
{
if (de.Key.ToString() == "UserPosition")
{
UserPositionvalue = de.Value.ToString();//得到值
break;//退出foreach遍历
}
}
foreach (System.Collections.DictionaryEntry de in firstInfo)
{
if (de.Key.ToString() == "UserEmail")
{
UserEmailvalue = de.Value.ToString();//得到值
break;//退出foreach遍历
}
}
ZHGLModel.zhanhuiid = ZhanhuiNo; //展会编码
ZHGLModel.vxmenberid = vxmenberid; //微信用户id
ZHGLModel.createtime = DateTime.Now;
ZHGLModel.phone = phonevalue;
ZHGLModel.name = UserNamevalue;
ZHGLModel.cjiname = companyvalue;
ZHGLModel.job = UserPositionvalue;
ZHGLModel.email = UserEmailvalue;
ZHGLModel.cardimageurl = imageUrl;
ZHGLModel.card = WXModel.MemberNo.ToString();
ZHGLModel.gift = Convert.ToInt32(model.MyGift);
string joinPur = string.Empty; //参加目的
string educatTrends = string.Empty; //教育趋势
string enjoyProduct = string.Empty; //感兴趣的产品或领域
if (!string.IsNullOrEmpty(model.JoinPurpose1))
{
joinPur = model.JoinPurpose1.Trim().TrimEnd(',');
}
else
{
joinPur = "";
}
if (!string.IsNullOrEmpty(model.EducationalTrends1))
{
educatTrends = model.EducationalTrends1.Trim().TrimEnd(',');
}
else
{
educatTrends = "";
}
if (!string.IsNullOrEmpty(model.EnjoyProduct1))
{
enjoyProduct = model.EnjoyProduct1.Trim().TrimEnd(',');
}
else
{
enjoyProduct = "";
}
Msg = "教育展答题情况 单位性质【" + model.UnitProperty1 + "】 职务:【" + model.UnitJob1 + "】 采购环节身份:【" + model.PurchaseIdentity1 + "】 教育趋势:【" + educatTrends + "】 感兴趣的产品或领域:【" + enjoyProduct + "】 教育投资:【" + model.EducationalInvestment1 + "】";
ZHGLModel.AnswerInfo = Msg;
ZHGLModel.IsZS = 0;
ZHGLModel.YXZhanhui = "";
ZHGLModel.Telephone = model.Telephone;
string result = string.Empty;
if (isUpdate == true)
{
result = Yasn.Logic.EduAccessoryWXMember.UpdateZhanHuiGuanLian(ZHGLModel);
}
else
{
result = Yasn.Logic.EduAccessoryWXMember.AddZhanHuiGuanLian(ZHGLModel);
}
if (result != "")
{
string strpwdvalid = ConfigurationManager.AppSettings["smsSuccessCode"].Trim();
SendSMS.SendSingleSMS(model.UserMobile, string.Format(strpwdvalid, WXModel.MemberNo.ToString()), string.Empty, MessageChannel.JiaoYuSucess);
}
}
catch (Exception ex) {
Utils.WriteLog(ex.ToString());
}
return result;
}