【问题标题】:How to move Timestamp from One Button Click to another如何将时间戳从一个按钮单击移动到另一个
【发布时间】:2020-03-04 07:40:51
【问题描述】:

目前对于我们的公司管理系统,当在批量生产之前对“MarketTrial”进行时间戳标记时存在错误。

在“MarketTrial 详细信息”下,用户可以在通过“插入”链接按钮提交报名表之前编辑尺寸、套装、部分。 I would also like to add that when a size is selected this also automatically edits the 'end date'

一旦选择了“插入”链接按钮,该日期就会在“市场试用详细信息”下加盖时间戳,但我的意图是,在市场试用详细信息和其他数据之后选择“提交批量”之前,此日期不应加盖时间戳输入字段在整个表单中完成。

下面是“插入”链接按钮的代码

Protected Sub Insert_Click(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim strEDate As String
    With odMarketTrial

        .InsertParameters("Row").DefaultValue = CType(gvmtrial.FooterRow.FindControl("lblRowInsert"), Label).Text
        .InsertParameters("Size").DefaultValue = CType(gvmtrial.FooterRow.FindControl("txtSizeEditF"), TextBox).Text
        .InsertParameters("Sets").DefaultValue = CType(gvmtrial.FooterRow.FindControl("ddSetsInsert"), DropDownList).SelectedValue
        .InsertParameters("Sections").DefaultValue = CType(gvmtrial.FooterRow.FindControl("ddSectionsInsert"), DropDownList).SelectedValue
        .InsertParameters("Type").DefaultValue = CType(gvmtrial.FooterRow.FindControl("ddType"), DropDownList).SelectedValue

        .InsertParameters("EndDate").DefaultValue = CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text 

        strEDate = CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text
        If strEDate = "" Or Not IsDate(strEDate ) Or (DateTime.Compare(Now, strEDate ) > 0) Then
            'If CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text = "" Then
            lblRequestedDateError.Visible = True
            lblRequestedDateError.ForeColor = Drawing.Color.Red
            'ElseIf isValidDate(CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text) Then
        Else
            lblendDateError.Visible = False
            lblendDateError.ForeColor = Drawing.Color.Red
        End If

        If lblDRFStatus.Text = "" Then
            .InsertParameters("LBSStatus").DefaultValue = "0 -"
        Else
            .InsertParameters("LBSStatus").DefaultValue = lblLBSStatus.Text
        End If
        .Insert()
    End With

    Session.Add("Redirect", "LBS")
    LBS_Action()

End Sub


所以我想知道如何将“EndDate”的数据输入从“插入”转移到“提交质量”,因为到目前为止,我的主要障碍是一旦单击“插入”,数据将不会提交为'txtEndDateInsert' 中没有日期

【问题讨论】:

    标签: asp.net vb.net datetime


    【解决方案1】:

    你可以试试:

    .InsertParameters("EndDate").DefaultValue = If(string.IsNullorEmpty(CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text), DateString, CType(gvmtrial.FooterRow.FindControl("txtEndDateInsert"), TextBox).Text)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-14
      • 2022-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-18
      • 1970-01-01
      相关资源
      最近更新 更多