新增用户保存失败:提示并发错误
作者:C/S框架网  发布日期:2016/10/25 11:07:58
  新增用户保存失败:提示并发错误


解决方案:

1. tb_MyUser 表 Model 的Account字段要设置为主键!
2. 替换frmUser.DoSave方法



C# Code:

[ORM_FieldAttribute(SqlDbType.NVarChar, 30, false, true, true, false, false)]
public static string Account = "Account";




C# Code:

public override void DoSave(IButtonInfo sender)
{
   try
   {
      UpdateLastControl();
      
      _BLL.DataBinderRow.EndEdit();
      
      if (!ValidatingData(_BLL.DataBinderRow)) return;
      
      if (UpdateType.Add == _UpdateType)
      _BLL.DataBinderRow[tb_MyUser.Password] = CEncoder.Encode(txtPassword2.Text);
      
      bool ret = _BLL.Update(_UpdateType);//提交数据
      if (ret)
      {
         UpdateSummaryRow(_BLL.DataBinderRow); //刷新表格内的数据.
         base.DoSave(sender);
         Msg.ShowInformation("保存成功!");
      }
      else
      Msg.Warning("保存失败!");
   }
   catch (Exception ex)
   {
      Msg.ShowException(ex);
   }
}

//来源:C/S框架网(www.csframework.com) QQ:1980854898




贴图图片



C/S框架网|原创精神.创造价值.打造精品


扫一扫加作者微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务


上一篇 下一篇