⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmcustomerorder.frm

📁 用vb写的饮食管理系统功能全面
💻 FRM
📖 第 1 页 / 共 2 页
字号:
        Do While Not EF.EOF()
           Grid1.Row = HH
           Grid1.Col = 0
           Grid1.CellAlignment = 4
        If Not IsNull(EF.Fields(0).Value) Then
           Grid1.Text = EF.Fields(0).Value
        End If
           Grid1.Row = HH
           Grid1.Col = 1
           Grid1.CellAlignment = 4
        If Not IsNull(EF.Fields(4).Value) Then
           Grid1.Text = EF.Fields(4).Value
         If CBranch = True Then
          If Trim(Grid1.Text) <> MargeRowBN Then
             tmpBN = Trim(Grid1.Text)
                If CMerge = False Then
                   Grid1.MergeCells = 0
                   Grid1.MergeCol(1) = False
                   Grid1.MergeRow(HH - 1) = False
                   Grid1.MergeRow(HH) = False
                End If
                For x = 1 To 9
                  Grid1.Col = x
                  If CMerge = False Then
                     Grid1.CellBackColor = &H80C0FF
                  Else
                     Grid1.CellBackColor = RGB(0, 0, 0)
                  End If
                Next
          ElseIf CMerge = True Then
              Grid1.MergeCells = 3
              Grid1.MergeCol(1) = True
              Grid1.MergeRow(HH - 1) = True
              Grid1.MergeRow(HH) = True
           Else
              Grid1.MergeCells = 0
              Grid1.MergeCol(1) = False
              Grid1.MergeRow(HH - 1) = False
              Grid1.MergeRow(HH) = False
          End If
              MargeRowBN = tmpBN
          Else
              Grid1.MergeCol(1) = False
         End If
        End If
           Grid1.Col = 2
           Grid1.CellAlignment = 4
        If Not IsNull(EF.Fields(5).Value) Then
           Grid1.Text = EF.Fields(5).Value
            If CStyle = True Then
              If Trim(Grid1.Text) <> MargeRow Then
                 tmpBN = Trim(Grid1.Text)
                 If CMerge = False Then
                   Grid1.MergeCells = 0
                   Grid1.MergeCol(2) = False
                   Grid1.MergeRow(HH - 1) = False
                   Grid1.MergeRow(HH) = False
                End If
                For x = 1 To 9
                    Grid1.Col = x
                 If CMerge = False Then
                    Grid1.CellBackColor = &H80C0FF
                 Else
                    Grid1.CellBackColor = RGB(0, 0, 0)
                 End If
                Next
            ElseIf CMerge = True Then
              Grid1.MergeCells = 3
              Grid1.MergeCol(2) = True
              Grid1.MergeRow(HH - 1) = True
              Grid1.MergeRow(HH) = True
              Else
              Grid1.MergeCells = flexMergeRestrictAll
           End If
              MargeRow = tmpBN
          Else
              Grid1.MergeCol(2) = False
         End If
        End If
           Grid1.Col = 3
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields(1).Value) Then
           Grid1.Text = EF.Fields(1).Value
        End If
           Grid1.Col = 4
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields(2).Value) Then
           Grid1.Text = EF.Fields(2).Value '"^ .. |^ 物品类别 |^ 物品名称 |^ 单位 |^ 物品代码 |^ 单价 |^ 数量 |^ 金额 |^ 购物日期 "
        End If
           Grid1.Col = 5
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields(3).Value) Then
           Grid1.Text = EF.Fields(3).Value
        End If
           Grid1.Col = 6
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields("消费总额").Value) Then
           Grid1.Text = EF.Fields("消费总额").Value
        End If
           Grid1.Col = 7
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields("付款方式").Value) Then
           Grid1.Text = EF.Fields("付款方式").Value
        End If
           Grid1.Col = 8
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields("上台时间").Value) Then
           Grid1.Text = EF.Fields("上台时间").Value
        End If
           Grid1.Col = 9
           Grid1.CellAlignment = 1
        If Not IsNull(EF.Fields("下台时间").Value) Then
           Grid1.Text = EF.Fields("下台时间").Value
        End If
           
          EF.MoveNext
          HH = HH + 1
        Loop
        EF.Close
        DB.Close
           Grid1.Row = HH + 1
        For x = 1 To 9
            Grid1.Col = x
            Grid1.CellForeColor = RGB(255, 0, 0)
        Next
        '定义合计
        Dim SumQTY As Long
            Grid1.Col = 5
        For x = 1 To HH - 1
            Grid1.Row = x
            SumQTY = SumQTY + Val(Grid1.Text)
        Next
            Grid1.Col = 1
            Grid1.Row = HH + 1
            Grid1.CellAlignment = 4
            Grid1.CellFontBold = True
            Grid1.CellFontSize = 10
            Grid1.Text = "合  计"
            Grid1.Col = 5
            Grid1.CellAlignment = 1
            Grid1.CellFontBold = True
            Grid1.CellFontSize = 10
            Grid1.Text = SumQTY
            SumQTY = 0
            Grid1.Col = 5   '合计第六行
        For x = 1 To HH - 1
            Grid1.Row = x
            SumQTY = SumQTY + Val(Grid1.Text)
        Next
            Grid1.Col = 5  '写入
            Grid1.Row = HH + 1
            Grid1.CellAlignment = 1
            Grid1.CellFontBold = True
            Grid1.CellFontSize = 10
            Grid1.Text = Format(SumQTY, "Currency")
            SumQTY = 0
            Grid1.Col = 6   '合计第六行
            x = 1
        For x = 1 To HH - 1
            Grid1.Row = x
            SumQTY = SumQTY + Val(Grid1.Text)
        Next
            Grid1.Col = 6  '写入
            Grid1.Row = HH + 1
            Grid1.CellAlignment = 1
            Grid1.CellFontBold = True
            Grid1.CellFontSize = 10
            Grid1.Text = Format(SumQTY, "Currency")
            SumQTY = 0
        '定义合计结束
        
 Grid1.Col = 1
 Grid1.Row = 20
 Grid1.ColSel = 9
 Grid1.Visible = True
 Me.MousePointer = 0
 
End Sub



Private Sub Form_Unload(Cancel As Integer)
    
  Set frmCustomerOrder = Nothing
 
  SCondStr = ""
  
End Sub

Private Sub Grid1_DblClick()

  If Grid1.Text = "合  计" Or Grid1.Text = "" Then
    mnuDetail.Enabled = False
  ElseIf MnuDisplayStoreMerge.Checked = False Then
     mnuDetail.Enabled = True
    Else
     mnuDetail.Enabled = False
  End If
  
 '显示详细列表
  mnuDetail_Click
  
End Sub

Private Sub Grid1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

  If Button = 2 Then
     PopupMenu MnuStoreDisplay
  End If
  
End Sub


Private Sub mnuDetail_Click()

   If Grid1.Text = "" Then
      Exit Sub
   End If
   
   'On Error Resume Next
   
   If frmQueryOrder.Visible Then
      Unload frmQueryOrder
   End If
      frmQueryOrder.Show
   
End Sub

Private Sub MnuDisplayAllStore_Click()
      
    SCondStr = ""
    Call QuerySell(True, False, MnuDisplayStoreMerge.Checked)
    
End Sub



Private Sub MnuDisplayStoreMerge_Click()

  If MnuDisplayStoreMerge.Checked = True Then
     MnuDisplayStoreMerge.Checked = False
    Else
     MnuDisplayStoreMerge.Checked = True
  End If
  
    '保存设置
    SaveSetting App.EXEName, "MainOption", "库存合并归类的列", MnuDisplayStoreMerge.Checked
    '刷新格式
    Call QuerySell(optBranch, optStyle, MnuDisplayStoreMerge.Checked)

End Sub

Private Sub MnuPrint_Click()

 cmdPrinter.Value = True
 
End Sub

Private Sub MnuReturn_Click()
 
 Unload Me
 
End Sub

Private Sub MnuSearch_Click()

End Sub

Private Sub MnuStoreDisplay_Click()

  If Grid1.Text = "合  计" Or Grid1.Text = "" Then
    mnuDetail.Enabled = False
  ElseIf MnuDisplayStoreMerge.Checked = False Then
     mnuDetail.Enabled = True
    Else
     mnuDetail.Enabled = False
  End If
  
End Sub

Private Sub MnuStoreNameSort_Click()

  optBranch.Value = True
  
End Sub

Private Sub MnuProductNameSort_Click()

  optStyle.Value = True
  
End Sub

Private Sub MnuStorePrint_Click()

  cmdPrinter.Value = True
  
End Sub

Private Sub MnuStoreSearch_Click()

  cmdSearch.Value = True
  
End Sub

Private Sub optBranch_Click()

  '与菜单同步
  Call SortMethod(optBranch.Value, optStyle.Value)
  
  If optBranch.Value = True Then
      Call QuerySell(True, False, MnuDisplayStoreMerge.Checked)
  End If
  
End Sub

Private Sub optStyle_Click()

  '与菜单同步
  Call SortMethod(optBranch.Value, optStyle.Value)
  
  If optStyle.Value = True Then
      Call QuerySell(False, True, MnuDisplayStoreMerge.Checked)
  End If
  
End Sub

Private Sub SortMethod(SB As Boolean, ss As Boolean)

  If SB = True Then
     MnuStoreNameSort.Checked = True
     MnuProductNameSort.Checked = False
     Exit Sub
  End If
  
  If ss = True Then
     MnuStoreNameSort.Checked = False
     MnuProductNameSort.Checked = True
     Exit Sub
  End If
  
  End Sub



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -