-- 作者:yd-jch
-- 发布时间:2019/7/31 12:11:00
--
这是新增行命令:
If QQClient.Ready = False Then MessageBox.Show("QQClient处于离线状态,无法继续当前操作!" & vbcrlf & "你可以采用【切换用户】的方法重新登录QQClient!" & vbcrlf & "若登录不成功,请稍后重试或联系管理员!","QQClient异常!",MessageBoxButtons.OK,MessageBoxIcon.Information) Return Else Dim qqm As String = mcdm Dim rt As String = QQClient.SendWait(":f" & qqm & "f:") Dim id As Integer If rt > " " Then If Integer.TryParse(rt,id) Then \'----执行代码开始 Dim mlbm As String = qqm & Format(id,"00") Dim r As Row = Tables("ML04_资源目录").AddNew() r("行层级") = "目录明细" r("资源类别") = zynb r("一级代码") = yjdm r("一级名称") = yjmc r("二级代码") = ejdm r("二级名称") = ejmc r("名称代码") = mcdm r("资源名称") = mcmc r("目录编码") = mlbm Else MessageBox.Show("服务器返回错误信息:" & rt,"服务器提示!",MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End If Else MessageBox.Show("服务器无响应,无法继续当前操作!" & vbcrlf & "你可以采用【切换用户】的方法重新登录QQClient!" & vbcrlf & "若登录不成功,请稍后重试或联系管理员!"," QQClient异常!",MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End If End If
以下是保存新增行命令:
Dim dat As DataTable = DataTables("ML04_资源目录") Dim trv As WinForm.TreeView = e.Form.Controls("1010-目录树资源目录") Dim nd As WinForm.TreeNode = trv.SelectedNode Dim r As Row = Tables("ML04_资源目录").Current
Dim kj4212 As WinForm.NumericComboBox = e.Form.Controls("4212-螺栓长度") If r.IsNull("适配螺栓") = True Then MessageBox.Show("尚未选择【适配螺栓】!","数据不全!",MessageBoxButtons.OK,MessageBoxIcon.Information) Else Dim spls As String = r("适配螺栓") If kj4212.Value Is Nothing Then MessageBox.Show("尚未录入【螺栓长度】!","数据不全!",MessageBoxButtons.OK,MessageBoxIcon.Information) Else Dim zd As Double = kj4212.Value If r.IsNull("理论重量") = True Then MessageBox.Show("尚未录入【理论重量】!","数据不全!",MessageBoxButtons.OK,MessageBoxIcon.Information) Else If MessageBox.Show("是否确定保存新增的数据?","请确认!",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then Dim ggxh As String = spls & "×" & zd r("规格型号") = ggxh r.Save() Dim zynb As String = r("资源类别") Dim yjfn As String = r("一级分类") Dim ejfn As String = r("二级分类") Dim zymc As String = r("名称组合名") nd = trv.Nodes(zynb).Nodes(yjfn).Nodes(ejfn).Nodes(zymc) nd = nd.Nodes.Add(ggxh) trv.SelectedNode = nd e.Form.Controls("1000-主操作面板").Enabled = True e.Form.Controls("4200-新增网架螺栓面板").Visible = False End If End If End If End If
|