private void LoadTextNull() { try { TEN_TT_HDTextEdit.EditValue = String.Empty; TEN_TT_HD_ATextEdit.EditValue = String.Empty; TEN_TT_HD_HTextEdit.EditValue = String.Empty; TEN_TT_HDTextEdit.Focus(); } catch { } }
private bool bKiemTrung() { try { DataTable dtTmp = new DataTable(); Int16 iKiem = 0; iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HD", (AddEdit ? "-1" : Id.ToString()), "TINH_TRANG_HD", "TEN_TT_HD", TEN_TT_HDTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HDNayDaTonTai")); TEN_TT_HDTextEdit.Focus(); return(true); } iKiem = 0; if (!string.IsNullOrEmpty(TEN_TT_HD_ATextEdit.EditValue.ToString())) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HD", (AddEdit ? "-1" : Id.ToString()), "TINH_TRANG_HD", "TEN_TT_HD_A", TEN_TT_HD_ATextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HD_ANayDaTonTai")); TEN_TT_HD_ATextEdit.Focus(); return(true); } } iKiem = 0; if (!string.IsNullOrEmpty(TEN_TT_HD_HTextEdit.EditValue.ToString())) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HD", (AddEdit ? "-1" : Id.ToString()), "TINH_TRANG_HT", "TEN_TT_HD_H", TEN_TT_HD_HTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HD_HNayDaTonTai")); TEN_TT_HD_HTextEdit.Focus(); return(true); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message.ToString()); return(true); } return(false); }