void bttnUpdate_Click(object sender, EventArgs e) { AdviceInfo a = helper.GetAdvice(AdviceID); a.MyQueryPwd = txtPwd.Text.Trim(); helper.UpdateAdvice(a); Alert2("修改成功"); }
public override bool Update(We7.Model.Core.PanelContext data) { IAdviceHelper helper = AdviceFactory.Create(); string id = GetValue <string>(data, "ID"); AdviceInfo advice = helper.GetAdvice(id); if (advice == null) { Insert(data); } else { advice.Title = GetValue <string>(data, "Title"); advice.UserID = GetValue <string>(data, "UserID"); advice.Content = GetValue <string>(data, "Content"); advice.Name = GetValue <string>(data, "Name"); advice.Email = GetValue <string>(data, "Email"); advice.Address = GetValue <string>(data, "Address"); advice.Phone = GetValue <string>(data, "Phone"); advice.Fax = GetValue <string>(data, "Fax"); advice.Public = GetValue <int>(data, "Public"); int isshow; Int32.TryParse(GetValue <string>(data, "IsShow"), out isshow); advice.IsShow = isshow; advice.Display1 = GetValue <string>(data, "Display1"); advice.Display2 = GetValue <string>(data, "Display2"); advice.Display3 = GetValue <string>(data, "Display3"); //下面是添加模型信息 string config, schema; advice.ModelXml = GetModelDataXml(data, advice.ModelXml, out schema, out config);//获取模型数据 advice.ModelConfig = config; advice.ModelName = data.ModelName; advice.ModelSchema = schema; advice.TypeID = data.Objects["AdviceTypeID"] as string; helper.UpdateAdvice(advice); SetValue(data, "ID", advice.ID); } return(true); }