コード例 #1
0
 /// <summary>
 /// 关闭当前窗体,显示主窗体
 /// </summary>
 private void showMainFrm()
 {
     // 售货员
     if (user.Level == 1)
     {
         frmPaymentTermial fpt = new frmPaymentTermial(user, supermarket);
         fpt.Show();
     }
     // 超市管理员
     else if (user.Level == 2)
     {
         frmMerchandiseManagement fmm = new frmMerchandiseManagement(user, supermarket);
         fmm.Show();
     }
     else if (user.Level == 0)
     {
         frmAuthorityManagement fam = new frmAuthorityManagement(user, supermarket);
         fam.Show();
     }
     this.Hide();
 }
コード例 #2
0
 /// <summary>
 /// 菜单项点击事件
 /// 根据菜单项的标题标签名称打开不同的窗体
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void menuItem_Click(object sender, EventArgs e)
 {
     Label menuItem = (Label)sender;
     if (menuItem.Text == labelTitle.Text)
     {
         return;
     }
     switch (menuItem.Text)
     {
         case Model.frmSetting.paymentTitle: frmPaymentTermial fpt = new frmPaymentTermial(user, supermarket);
             fpt.Show(); break;
         case Model.frmSetting.classTitle: frmClassSetting fcs = new frmClassSetting(user, supermarket);
             fcs.Show(); break;
         case Model.frmSetting.itemTitle: frmMerchandiseManagement fmm = new frmMerchandiseManagement(user, supermarket);
             fmm.Show(); break;
         case Model.frmSetting.authorityTitle: frmAuthorityManagement fam = new frmAuthorityManagement(user, supermarket);
             fam.Show(); break;
         case Model.frmSetting.changePasswordTitle: frmChangePassword fcp = new frmChangePassword(user);
             fcp.Owner = this;
             fcp.ShowDialog();
             break;
         case Model.frmSetting.checkPurchaseLog: frmCheckpurchaseLog fpc = new frmCheckpurchaseLog(user, supermarket);
             fpc.Show(); break;
         default: break;
     }
     if (menuItem.Text != frmSetting.changePasswordTitle)
     {
         this.Hide();
     }
 }