本文整理汇总了C#中Open_Miracle.DateValidation.DateValidationFunctionMFDEXPD方法的典型用法代码示例。如果您正苦于以下问题:C# DateValidation.DateValidationFunctionMFDEXPD方法的具体用法?C# DateValidation.DateValidationFunctionMFDEXPD怎么用?C# DateValidation.DateValidationFunctionMFDEXPD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Open_Miracle.DateValidation
的用法示例。
在下文中一共展示了DateValidation.DateValidationFunctionMFDEXPD方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dgvProductCreation_CellValueChanged
/// <summary>
/// work on dgvProductCreation CellValueChanged event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dgvProductCreation_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
try
{
CheckInvalidEntries(e);
if (e.RowIndex > -1 && e.ColumnIndex > -1)
{
if (dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtqty"].Value != null && dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtqty"].Value.ToString() != "")
{
if (dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtrate"].Value != null && dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtrate"].Value.ToString() != "")
{
int inDecimalPlace = PublicVariables._inNoOfDecimalPlaces;
decimal decQuantity = Convert.ToDecimal(dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtqty"].Value.ToString());
decimal decRate = Convert.ToDecimal(dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtrate"].Value.ToString());
decimal decTotal = Math.Round(decQuantity * decRate, inDecimalPlace);
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtamount"].Value = decTotal;
}
else
{
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtamount"].Value = 0;
}
}
TextBox txtMFD = new TextBox();
TextBox txtEXPD = new TextBox();
if ((dgvProductCreation.Columns[e.ColumnIndex].Name == "dgvtxManfDate" || dgvProductCreation.Columns[e.ColumnIndex].Name == "dgvtxtExpDate") && (cmbAllowBatch.SelectedIndex == 1))
{
DateValidation objDateValidation = new DateValidation();
TextBox txt = new TextBox();
if (dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value != null)
{
txt.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value.ToString();
bool isDate = objDateValidation.DateValidationFunctionMFDEXPD(txt);
if (isDate)
{
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value = txt.Text;
txtMFD.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value.ToString();
}
else
{
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value = string.Empty;
txtMFD.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxManfDate"].Value.ToString();
}
}
if (dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value != null)
{
txt.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value.ToString();
bool isDate = objDateValidation.DateValidationFunctionMFDEXPD(txt);
if (isDate)
{
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value = txt.Text;
txtEXPD.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value.ToString();
}
else
{
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value = string.Empty;
txtEXPD.Text = dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value.ToString();
}
}
if (txtEXPD.Text != String.Empty && txtMFD.Text != string.Empty)
{
if (Convert.ToDateTime(txtEXPD.Text) < Convert.ToDateTime(txtMFD.Text))
{
MessageBox.Show("EXPD should be greater than or equal to MFD", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
dgvProductCreation.Rows[e.RowIndex].Cells["dgvtxtExpDate"].Value = string.Empty;
}
}
}
for (int inI = 0; inI < dgvProductCreation.RowCount - 1; inI++)
{
if (inI == 0)
{
dgvProductCreation.Rows[inI].Cells["dgvtxtrate"].ReadOnly = false;
dgvProductCreation.Rows[inI].Cells["dgvtxtunit"].Value = strUnitNameForGrid;
}
else
{
dgvProductCreation.Rows[inI].Cells["dgvtxtrate"].Value = dgvProductCreation.Rows[0].Cells["dgvtxtrate"].Value;
dgvProductCreation.Rows[inI].Cells["dgvtxtrate"].ReadOnly = true;
dgvProductCreation.Rows[inI].Cells["dgvtxtunit"].Value = strUnitNameForGrid;
}
}
}
//.........这里部分代码省略.........