Ejemplo n.º 1
0
 private void LoadTextNull()
 {
     try
     {
         TEN_QHTextEdit.EditValue   = String.Empty;
         TEN_QH_ATextEdit.EditValue = String.Empty;
         TEN_QH_HTextEdit.EditValue = String.Empty;
         TEN_QHTextEdit.Focus();
     }
     catch { }
 }
Ejemplo n.º 2
0
        private bool bKiemTrung()
        {
            try
            {
                DataTable dtTmp = new DataTable();
                Int16     iKiem = 0;

                iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_QH",
                                                                (AddEdit ? "-1" : Id.ToString()), "QUAN_HE_GD", "TEN_QH", TEN_QHTextEdit.EditValue.ToString(),
                                                                "", "", "", ""));
                if (iKiem > 0)
                {
                    XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_QHNayDaTonTai"));
                    TEN_QHTextEdit.Focus();
                    return(true);
                }

                iKiem = 0;

                if (!string.IsNullOrEmpty(TEN_QH_ATextEdit.Text))
                {
                    iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_QH",
                                                                    (AddEdit ? "-1" : Id.ToString()), "QUAN_HE_GD", "TEN_QH_A", TEN_QH_ATextEdit.EditValue.ToString(),
                                                                    "", "", "", ""));
                    if (iKiem > 0)
                    {
                        XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_QH_ANayDaTonTai"));
                        TEN_QH_ATextEdit.Focus();
                        return(true);
                    }
                }

                iKiem = 0;
                if (!string.IsNullOrEmpty(TEN_QH_HTextEdit.Text))
                {
                    iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_QH",
                                                                    (AddEdit ? "-1" : Id.ToString()), "QUAN_HE_GD", "TEN_QH_H", TEN_QH_HTextEdit.EditValue.ToString(),
                                                                    "", "", "", ""));
                    if (iKiem > 0)
                    {
                        XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_QH_HNayDaTonTai"));
                        TEN_QH_HTextEdit.Focus();
                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message.ToString());
                return(true);
            }
            return(false);
        }