private void makhoTE_EditValueChanged(object sender, EventArgs e) { if (Gridview.LocateByValue("Ma_Kho", makhoTE.Text) < 0) { ewErrorProvider1.SetError(makhoTE, "", ErrorType.Information); } else { if (isAdd) { ewErrorProvider1.SetError(makhoTE, "Giá trị này đã có trong Danh Mục Bảng Giá", ErrorType.Information); } else { if (makhoTE.EditValue.ToString() == makhoTE.Tag.ToString()) { ewErrorProvider1.SetError(makhoTE, "", ErrorType.Information); } else { ewErrorProvider1.SetError(makhoTE, "Giá trị này đã có trong Danh Mục Bảng Giá", ErrorType.Information); } } } }
private void madtTE_EditValueChanged(object sender, EventArgs e) { if (string.IsNullOrEmpty(madtTE.Text.ToString())) { ewErrorProvider1.SetError(madtTE, "Mã đối tượng không bỏ trống", ErrorType.Information); } else { if (Gridview.LocateByValue("Ma_Dt", madtTE.EditValue) < 0) { ewErrorProvider1.SetError(madtTE, "", ErrorType.Information); } else { if (isAdd) { ewErrorProvider1.SetError(madtTE, "Giá trị này đã có trong Danh Mục Đối Tượng", ErrorType.Information); } else { if (madtTE.EditValue.ToString() == madtTE.Tag.ToString()) { ewErrorProvider1.SetError(madtTE, "", ErrorType.Information); } else { ewErrorProvider1.SetError(madtTE, "Giá trị này đã có trong Danh Mục Đối Tượng", ErrorType.Information); } } } } }
private void mavtLUE_EditValueChanged(object sender, EventArgs e) { DataRowView s = (DataRowView)mavtLUE.GetSelectedDataRow(); vtLB.Text = s["Ma_Vt"].ToString(); if (Gridview.LocateByValue("Ma_Vt", mavtLUE.EditValue) < 0) { ewErrorProvider1.SetError(mavtLUE, "", ErrorType.Information); } else { if (isAdd) { ewErrorProvider1.SetError(mavtLUE, "Giá trị này đã có trong Danh Mục Bảng Giá", ErrorType.Information); } else { if (mavtLUE.EditValue.ToString() == mavtLUE.Tag.ToString()) { ewErrorProvider1.SetError(mavtLUE, "", ErrorType.Information); } else { ewErrorProvider1.SetError(mavtLUE, "Giá trị này đã có trong Danh Mục Bảng Giá", ErrorType.Information); } } } }