Foxtable(狐表)用户栏目专家坐堂 → 请教自定义登录窗口代码问题


  共有1612人关注过本帖平板打印复制链接

主题:请教自定义登录窗口代码问题

帅哥哟,离线,有人找我吗?
13315253800
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:543 积分:3942 威望:0 精华:0 注册:2018/1/3 16:03:00
请教自定义登录窗口代码问题  发帖心情 Post By:2023/5/8 10:06:00 [只看该作者]

蓝老师,我想借助狐友分享的销售开piao系统,改成新建账套的功能,这一步实现了,但用自定义登录窗口登录时总提示错误:

.NET Framework 版本:4.0.30319.36543

Foxtable 版本:2022.7.3.1

错误所在事件:

详细错误信息:

This row has been removed from a table and does not have any data.  BeginEdit() will allow creation of new data in this row.

自定义登录窗口的“确定”按钮代码是:

Dim tx1 As WinForm.ComboBox = e.Form.Controls("ComboBox1")

Dim user As String = tx1.text

Dim sss As String = e.Form.Controls("ComboBox2").text 'sss项目文件名

 

Dim tx2 As WinForm.TextBox = e.Form.Controls("TextBox2")

Dim pows As String = tx2.text

Dim dl As WinForm.Button = e.Form.Controls("Button1")

Dim dt As DataTable = DataTables("用户表")

Dim dr As DataRow

If user = "" Then

    MessageBox.show("请输入用户名称!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)

    Return

Else

    dr = dt.find("用户名称='" & user & "'")

    If dr IsNot Nothing Then

        If pows = dr("密码") Then

            PopMessage("登陆成功", "提示", PopIconEnum.Infomation, 1)

            dr("登陆时间") = Date.Now

            dr("登陆账套") = sss 'sss项目文件名

            dr.Save()

            usna = user

            syscmd.project.open(ProjectFile, sss)'打开项目,ProjectFile返回已经打开的项目文件名

            e.Form.close

            'syscmd.project.Exit(True)

            Return

        Else

            MessageBox.show("密码错误", "提示")

            Return

        End If

    Else

        MessageBox.show("用户不存在!", "提示")

        Return


 回到顶部