Esempio n. 1
0
 public static frmPos CreateForm()
 {
     //判断是否存在该窗体,或时候该字窗体是否被释放过,如果不存在该窗体,则 new 一个字窗体
     if (_instance == null || _instance.IsDisposed)
     {
         _instance = new frmPos();
     }
     return(_instance);
 }
Esempio n. 2
0
        private void btnBegin_Click(object sender, EventArgs e)
        {
            try
            {
                _service.BeginWork(ContextService.CurrentAccount, ContextService.StoreId, ContextService.PosId);
                //收银前台
                frmPos posForm = frmPos.CreateForm();
                posForm.Show();

                var mainForm = frmMain.CreateForm();
                mainForm.Hide();

                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Esempio n. 3
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            //收银台
            // 检查当前班次收银员账户是否一致
            var worker = _workService.GetWorking(ContextService.StoreId, _setting.PosId);

            if (worker == null)
            {
                ShowWorkForm();
                MessageBox.Show("请先上班再开始销售", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (worker.CreatedBy != ContextService.CurrentAccount.Id)
            {
                ShowWorkForm();
                MessageBox.Show("请先交接班再开始销售", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            frmPos posForm = frmPos.CreateForm();

            posForm.Show();
            this.Hide();
        }
Esempio n. 4
0
        public void ShowPosForm()
        {
            frmPos posForm = frmPos.CreateForm();

            posForm.Show();
        }