예제 #1
0
 private void LoadTextNull()
 {
     try
     {
         TEN_LHDLDTextEdit.EditValue   = String.Empty;
         TEN_LHDLD_ATextEdit.EditValue = String.Empty;
         TEN_LHDLD_HTextEdit.EditValue = String.Empty;
         SO_THANGTextEdit.EditValue    = 0;
         TEN_LHDLDTextEdit.Focus();
     }
     catch { }
 }
예제 #2
0
        private bool bKiemTrung()
        {
            try
            {
                DataTable dtTmp = new DataTable();
                Int16     iKiem = 0;

                iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LHDLD",
                                                                (bAddEditLHD ? "-1" : iIdLHD.ToString()), "LOAI_HDLD", "TEN_LHDLD", TEN_LHDLDTextEdit.EditValue.ToString(),
                                                                "", "", "", ""));
                if (iKiem > 0)
                {
                    XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LHDLDNayDaTonTai"));
                    TEN_LHDLDTextEdit.Focus();
                    return(true);
                }

                iKiem = 0;
                if (!string.IsNullOrEmpty(TEN_LHDLD_ATextEdit.Text.ToString()))
                {
                    iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LHDLD",
                                                                    (bAddEditLHD ? "-1" : iIdLHD.ToString()), "LOAI_HDLD", "TEN_LHDLD_A", TEN_LHDLD_ATextEdit.EditValue.ToString(),
                                                                    "", "", "", ""));
                    if (iKiem > 0)
                    {
                        XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LHDLD_ANayDaTonTai"));
                        TEN_LHDLD_ATextEdit.Focus();
                        return(true);
                    }
                }

                iKiem = 0;
                if (!string.IsNullOrEmpty(TEN_LHDLD_HTextEdit.Text.ToString()))
                {
                    iKiem = Convert.ToInt16(SqlHelper.ExecuteScalar(Commons.IConnections.CNStr, "spCheckData", "ID_LHDLD",
                                                                    (bAddEditLHD ? "-1" : iIdLHD.ToString()), "LOAI_HDLD", "TEN_LHDLD_H", TEN_LHDLD_HTextEdit.EditValue.ToString(),
                                                                    "", "", "", ""));
                    if (iKiem > 0)
                    {
                        XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_LHDLD_HNayDaTonTai"));
                        TEN_LHDLD_HTextEdit.Focus();
                        return(true);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message.ToString());
                return(true);
            }
            return(false);
        }