示例#1
0
        private void LoadTextNull()
        {
            try
            {
                TEN_TDVHTextEdit.EditValue   = String.Empty;
                TEN_TDVH_ATextEdit.EditValue = String.Empty;
                TEN_TDVH_HTextEdit.EditValue = String.Empty;

                TEN_TDVHTextEdit.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_TDVH",
                                                                (AddEdit ? "-1" : Id.ToString()), "TRINH_DO_VAN_HOA", "TEN_TDVH", TEN_TDVHTextEdit.EditValue.ToString(),
                                                                "", "", "", ""));
                if (iKiem > 0)
                {
                    XtraMessageBox.Show(Commons.Modules.ObjLanguages.GetLanguage(this.Name, "msgTEN_TDVHNayDaTonTai"));
                    TEN_TDVHTextEdit.Focus();
                    return(true);
                }

                iKiem = 0;

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

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