⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fmbaseform.cs

📁 一个通讯录源码,用C#写的.挺不错的,大家可以参考看一下.
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AddressList.Utils;
using System.Data.Common;

namespace AddressList.Forms
{
    public partial class fmBaseForm : Form
    {

        public fmBaseForm()
        {
            InitializeComponent();
        }

        public DbConnection Connection
        {
            get
            {
                return (DbConnection)DBConn.Connection;
            }
        }

        public DbCommand DBCommand(string sqlString)
        {
            return (DbCommand)DBConn.DBCommand(sqlString);
        }

        public DBAccess DBConn
        {
            get
            {
                return ClientInfoObject.DBConn;
            }
        }

        public LoginInfo CurrentLoginInfo
        {
            get
            {
                return ClientInfoObject.CurrentLoginInfo;
            }
        }

        public UserInfo CurrentUserInfo
        {
            get
            {
                return ClientInfoObject.CurrentUserInfo;
            }
        }

        public static string QuoteStr(string value)
        {
            return ClientFuncion.QuoteStr(value);
        }

        public static string GetMaxNo(string tableName, string noFieldName, string subStr)
        {
            return ClientInfoObject.DBConn.GetMaxNo(tableName, noFieldName, subStr);
        }

        public static int GetMaxID(string tableName, string keyFieldName, string condition)
        {
            return ClientInfoObject.DBConn.GetMaxID(tableName, keyFieldName, condition);
        }

        public bool ValueExists(int keyValue, string tableName, string fieldName, string keyFieldName, string value)
        {
            return ClientInfoObject.DBConn.ValueExists(keyValue, tableName, fieldName, keyFieldName, value);
        }

        public static void ShowErrorMsg(string message)
        {
            ClientFuncion.ShowErrorMsg(message);
        }

        /// <summary>
        /// 检查Edit控件录入的内空是否为空
        /// </summary>
        /// <param name="textBox">Edit控件</param>
        /// <param name="textName">控件对应的名称</param>
        /// <param name="isShowError">是否显示错误</param>
        /// <returns></returns>
        public bool EditIsBlank(Control textBox, string textName, bool isShowError)
        {
            if (textBox.Text.Trim().Length == 0)
            {
                if (textBox.CanFocus) textBox.Focus();
                if (isShowError)
                {
                    const string sTextBlank = "[{0}]不能为空,请确认";
                    ShowErrorMsg(string.Format(sTextBlank, textName));
                }
                return true;
            }
            else
                return false;
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -