private void LoadTextNull() { try { TEN_LD_TVTextEdit.EditValue = String.Empty; TEN_LD_TV_ATextEdit.EditValue = String.Empty; TEN_LD_TV_HTextEdit.EditValue = String.Empty; HE_SOTextEdit.EditValue = 0; TEN_LD_TVTextEdit.Focus(); } catch { } }
private bool bKiemTrung() { try { DataTable dtTmp = new DataTable(); Int16 iKiem = 0; iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LD_TV", (AddEdit ? "-1" : Id.ToString()), "LY_DO_THOI_VIEC", "TEN_LD_TV", TEN_LD_TVTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LD_TVNayDaTonTai")); TEN_LD_TVTextEdit.Focus(); return(true); } iKiem = 0; if (!string.IsNullOrEmpty(TEN_LD_TV_ATextEdit.Text)) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LD_TV", (AddEdit ? "-1" : Id.ToString()), "LY_DO_THOI_VIEC", "TEN_LD_TV_A", TEN_LD_TV_ATextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LD_TV_ANayDaTonTai")); TEN_LD_TV_ATextEdit.Focus(); return(true); } } iKiem = 0; if (!string.IsNullOrEmpty(TEN_LD_TV_HTextEdit.Text)) { iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LD_TV", (AddEdit ? "-1" : Id.ToString()), "LY_DO_THOI_VIEC", "TEN_LD_TV_H", TEN_LD_TV_HTextEdit.EditValue.ToString(), "", "", "", "")); if (iKiem > 0) { XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LD_TV_HNayDaTonTai")); TEN_LD_TV_HTextEdit.Focus(); return(true); } } } catch (Exception ex) { XtraMessageBox.Show(ex.Message.ToString()); return(true); } return(false); }