Пример #1
0
        private void toolStripMenuItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;

            // 选中当前Item,如果已经选中则返回
            if (item.Checked)
            {
                return;
            }
            else
            {
                item.Checked = true;
            }

            // 取消选中的上一个Item并储存当前选中的Item
            SelectItem.Checked = false;

            // 储存当前选中的Item
            SelectItem = item;

            // 将用户设置的皮肤保存至配置文件中
            CashBookConfig.UpdateAppConfig("Skin", item.Tag.ToString());

            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormCashBookMenu));
            switch (item.Tag.ToString())
            {
            case "DefaultSkin":                     // 默认皮肤
                this.BackPalace = global::CashBook.Properties.Resources.DefaultSkin;
                break;

            case "PurpleSkin":                     // 炫彩紫色
                this.BackPalace = global::CashBook.Properties.Resources.PurpleSkin;
                break;

            case "LilySkin":                     // 悠然百合
                this.BackPalace = global::CashBook.Properties.Resources.LilySkin;
                break;

            case "GreenSkin":                     // 绿化环保
                this.BackPalace = global::CashBook.Properties.Resources.GreenSkin;
                break;

            case "LogCharm":                     // 原木韵味
                this.BackPalace = global::CashBook.Properties.Resources.LogCharm;
                break;

            case "SpringFestival":                     // 恭贺新春
                this.BackPalace = global::CashBook.Properties.Resources.SpringFestival;
                break;
            }
        }
Пример #2
0
        public FormCashBookMenu()
        {
            InitializeComponent();
            objConn.CreateSqliteDBFile();               // 创建数据库文件
            objConn.ConnectionToSqliteDB();             // 连接数据库
            sql_getUID = string.Format("select uid from t_users where acc='{0}'", frm.GetAccount());
            objConn.SelectDataFromSqlite(sql_getUID, UID, 1);
            TableCashBookInfo          = string.Format("t_cashbook_info_{0}", UID[0]);
            sql_create_t_cashbook_info = string.Format("CREATE TABLE {0} (ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,UID INTEGER NOT NULL,DateTime TEXT(20) NOT NULL,TallyType TEXT(50) NOT NULL,BudgetType TEXT(50) NOT NULL,Amount INTEGER NOT NULL,InOutProject TEXT(50) NOT NULL,Income DOUBLE NOT NULL DEFAULT 0.00,PayOut DOUBLE NOT NULL DEFAULT 0.00,Total DOUBLE NOT NULL DEFAULT 0.00,PayMode TEXT(20) NOT NULL,RecordUser TEXT(20) NOT NULL,Remark TEXT)", TableCashBookInfo);
            // 建用户数据表t_cashbook_info
            objConn.CreateTableToSqlite(TableCashBookInfo, sql_create_t_cashbook_info);

            SetWindowsFormTitle();              // 设置窗体标题
            // 将用书设置的皮肤保存至配置文件中
            string skinName = CashBookConfig.GetAppConfig("Skin");

            if (string.IsNullOrEmpty(skinName))
            {
                CashBookConfig.UpdateAppConfig("Skin", "DefaultSkin");
            }
            SetStyles();
        }