private void LoadTextNull() { try { TEN_TT_HTTextEdit.EditValue = String.Empty; TEN_TT_HT_ATextEdit.EditValue = String.Empty; TEN_TT_HT_HTextEdit.EditValue = String.Empty; TEN_TT_HTTextEdit.Focus(); } catch { } }
private bool bKiemTrung() { try { DataTable dtTmp = new DataTable(); Int16 iKiem = 0; iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HT", (bAddEditTTHT ? "-1" : iIdTTHT.ToString()), "TINH_TRANG_HT", "TEN_TT_HT", TEN_TT_HTTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HTNayDaTonTai")); TEN_TT_HTTextEdit.Focus(); return(true); } iKiem = 0; if (!string.IsNullOrEmpty(TEN_TT_HT_ATextEdit.EditValue.ToString())) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HT", (bAddEditTTHT ? "-1" : iIdTTHT.ToString()), "TINH_TRANG_HT", "TEN_TT_HT_A", TEN_TT_HT_ATextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HT_ANayDaTonTai")); TEN_TT_HT_ATextEdit.Focus(); return(true); } } iKiem = 0; if (!string.IsNullOrEmpty(TEN_TT_HT_HTextEdit.EditValue.ToString())) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_TT_HT", (bAddEditTTHT ? "-1" : iIdTTHT.ToString()), "TINH_TRANG_HT", "TEN_TT_HT_H", TEN_TT_HT_HTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TT_HT_HNayDaTonTai")); TEN_TT_HT_HTextEdit.Focus(); return(true); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message.ToString()); return(true); } return(false); }