我使用以下代码使用system.net.mail发送Outlook约会 代码完美无缺,我可以接受预约。但问题是我无法弄清楚如何分配约会开始日期或结束日期
Private Sub txtbxBarcode_TextChanged(sender As Object, e As EventArgs) Handles txtbxBarcode.TextChanged
GetProductInfo()
End Sub
Private Sub GetProductInfo()
Dim discountAmount As Double
Dim medicineName, unit As String
Try
SQL = "SELECT product_code, Medicine_name, Unit, Description, Price, medicineID FROM medicine_info WHERE barcode = '" & txtbxBarcode.Text & "'"
ConnDB()
cmd = New MySqlCommand(SQL, conn)
dr = cmd.ExecuteReader
If dr.Read = True Then
txtbxItemCode.Text = dr("product_code")
unit = dr("Unit")
medicineName = dr("Medicine_name")
txtbxItemDesc.Text = dr("Description")
'Validate Discount
If isDiscount = True Then
discountAmount = Val(dr("Price")) * (Val(discountPercent) / 100)
txtbxPrice.Text = Format(Val(dr("Price")) - discountAmount, "#,##0.00")
Else
txtbxPrice.Text = Format(dr("Price"), "#,##0.00")
discountAmount = 0
End If
'Validate Quantity
If isQuantity = True Then
txtbxQuantity.Text = noOfItems
Else
txtbxQuantity.Text = 1
End If
txtbxTotal.Text = Format(Val(txtbxPrice.Text.Replace(",", "")) * Val(txtbxQuantity.Text), "#,##0.00")
'Adding Item to Gridview to Display
dgv.Rows.Add(dr("medicineID"), dr("product_code"), dr("Medicine_name"), dr("Unit"), dr("Description"), txtbxPrice.Text, txtbxQuantity.Text, txtbxTotal.Text, Format(discountAmount * Val(txtbxQuantity.Text), "#,##0.00"))
'Get Basket Info
BasketInformation()
'Clear Barcode text field
txtbxBarcode.Clear()
'Set Discount to Zero
discountPercent = 0
isDiscount = False
'Set Quantity to False
isQuantity = False
noOfItems = 1
End If
Catch ex As Exception
MsgBox(ex.ToString)
Finally
cmd.Dispose()
conn.Close()
End Try
End Sub
1)我如何设置UTC,就像我现在分配当前日期一样,它总是+8。我可以在不使用UTC的情况下提供日期时间。 2)我如何在代码中指定日期时间。因为现在它使用DateTime.Now然后工作。但手动分配不工作
完整的代码如下
'Str.AppendLine(String.Format("DTSTART:{0:yyyyMMddTHHmmssZ}", DateTime.Now))
Str.AppendLine(String.Format("DTSTAMP:{0:yyyyMMddTHHmmssZ}", DateTime.UtcNow))
Str.AppendLine(String.Format("DTEND:{0:yyyyMMddTHHmmssZ}", DateTime.Now.AddHours(3)))