Пример #1
0
        public SelectOperator()
        {
            InitializeComponent();

            IOperatorDao    opDao = GlobalData.getIDao <IOperatorDao>();
            List <Operator> lop   = opDao.GetAll();

            foreach (Operator op in lop)
            {
                this.listBox1.Items.Add(op);
            }

            if (lop.Count == 0)
            {
                MessageBox.Show("先に[機能]→[オペレーターIDを管理]で設定を済ませてください");
            }
        }
Пример #2
0
        private void RefreshShowing()
        {
            this.dataGridView1.Enabled = false;
            this.dataGridView1.Rows.Clear();

            IOperatorDao opDao = GlobalData.getIDao <IOperatorDao>();

            this.oplist = opDao.GetAll();

            foreach (Operator op in this.oplist)
            {
                DataGridViewRow row = this.dataGridView1.Rows[this.dataGridView1.Rows.Add()];
                this.setRowValue(row, op);
            }

            dataGridView1.Sort(dataGridView1.Columns[ColumnName.operatorId], ListSortDirection.Ascending);

            this.dataGridView1.Enabled = true;
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            uint opid;

            if (uint.TryParse(this.textBox1.Text, out opid))
            {
                IOperatorDao    opDao = GlobalData.getIDao <IOperatorDao>();
                List <Operator> lop   = opDao.GetById(opid);
                if (lop.Count == 1)
                {
                    this.retop = lop[0];

                    this.DialogResult = DialogResult.OK;
                    this.Close();
                    return;
                }
            }

            this.textBox1.BackColor = Color.LightPink;
            this.textBox1.Focus();
            this.textBox1.SelectAll();
        }
Пример #4
0
        private void DoKansaItem(Item it)
        {
            this.curItem = it;

            this.textBox_ban.Text = it.item_id.ToString();

            this.textBox_name.BackColor = SystemColors.Control;
            this.textBox_name.Text      = it.item_name;
            this.textBox_teika.Text     = it.item_tagprice.ToString("#,##0");
            this.textBox_nebiki.Text    = it.item_return /*FIXME*/ ? "×" : "○";

            if (it.item_sellprice.HasValue)
            {
                if (it.item_sellprice.Value == it.item_tagprice)
                {
                    this.textBox_baika.Text = "-- " + it.item_sellprice.Value.ToString();
                }
                else
                {
                    this.textBox_baika.Text = it.item_sellprice.Value.ToString();
                }

                if (it.item_sell__Operator != null)
                {
                    this.textBox_sellop.Text = it.item_sell__Operator.operator_name;
                }
                else
                {
                    this.textBox_sellop.Text = "不明";
                }

                this.textBox_selltime.Text = Globals.getTimeString(it.item_selltime);

                this.button_mibai.Enabled    = true;
                this.button_teisei.Enabled   = true;
                this.textBox_baika.BackColor = SystemColors.Control;


                if (it.item_kansa_end.HasValue)
                {
                    //監査済み
                    this.label_error.Text    = "監査対象ではありません。本日の販売ではない可能性が。";
                    this.label_error.Visible = true;
                }
                else
                {
                    if (this.GetKansaFlag(it).HasValue)
                    {
                        IOperatorDao    opDao = GlobalData.getIDao <IOperatorDao>();
                        List <Operator> lop   = opDao.GetById(this.GetKansaFlag(it).Value);

                        if (lop.Count() == 0)
                        {
                            this.label_error.Text = "だれかが既に監査したようです";
                        }
                        else
                        {
                            this.label_error.Text = lop[0].operator_name + " が既に監査しています";
                        }

                        this.label_error.Visible = true;
                    }
                    else
                    {
                        System.Threading.Thread t = new System.Threading.Thread(
                            delegate(object item)
                        {
                            Item itemmm = (Item)item;
                            this.SetKansaFlag(itemmm, this.nowOperator.operator_id);

                            IItemDao idao = GlobalData.getIDao <IItemDao>();
                            idao.Update(itemmm);
                        }
                            );

                        t.IsBackground = true;
                        t.Start(it);

                        this.label_error.Text = "監査しました。次の品番を入力してね";

                        this.RefreshRemain();
                    }
                }
            }
            else
            {
                this.button_teisei.Enabled   = true;
                this.button_mibai.Enabled    = false;
                this.textBox_baika.Text      = "未売却";
                this.textBox_baika.BackColor = Color.LightPink;
                this.textBox_sellop.Text     = null;
                this.textBox_selltime.Text   = null;

                this.label_error.Text    = "未売却の商品は監査できません";
                this.label_error.Visible = true;
            }

            this.textBox_ban.Focus();
            this.textBox_ban.SelectAll();
        }