Ejemplo n.º 1
0
        public void SetText(object sender, EventArgs e)
        {
            FrmEventArgs fea = e as FrmEventArgs;

            labDeskName.Text = fea.Name;
            this.ID          = fea.Temp;//把订单的id存起来
        }
Ejemplo n.º 2
0
        public void SetText(object sender, EventArgs e)
        {
            LoadCategory();

            FrmEventArgs fea = e as FrmEventArgs;

            this.Tp = fea.Temp;
            if (fea.Temp == 3)//新增
            {
                foreach (Control item in this.Controls)
                {
                    if (item is TextBox)
                    {
                        TextBox tb = item as TextBox;
                        tb.Text = "";
                    }
                }
            }
            else if (fea.Temp == 4)//修改
            {
                ProductInfo pro = fea.obj as ProductInfo;
                txtCost.Text              = pro.ProCost.ToString();
                txtName.Text              = pro.ProName;
                txtNum.Text               = pro.ProNum;
                txtPrice.Text             = pro.ProPrice.ToString();
                txtRemark.Text            = pro.Remark;
                txtSpell.Text             = pro.ProSpell;
                txtStock.Text             = pro.ProStock.ToString();
                txtUnit.Text              = pro.ProUnit.ToString();
                cmbCategory.SelectedValue = pro.CatId;

                //id存起来
                labId.Text = pro.ProId.ToString();
            }
        }
Ejemplo n.º 3
0
        public void SetText(object sender, EventArgs e)
        {
            FrmEventArgs fea = e as FrmEventArgs;

            this.Temp = fea.Temp; //标识
            LoadRoomType();       //加载房间类型
            if (fea.Temp == 3)    //新增
            {
                foreach (Control item in this.Controls)
                {
                    if (item is TextBox)
                    {
                        TextBox tb = item as TextBox;
                        tb.Text = "";
                    }
                }
            }
            else if (fea.Temp == 4) //修改
            {
                DeskInfo dk = fea.obj as DeskInfo;
                txtDeskName.Text      = dk.DeskName;
                txtDeskRegion.Text    = dk.DeskRegion;
                txtDeskRemark.Text    = dk.DeskRemark;
                labId.Text            = dk.DeskId.ToString();
                cmdRoom.SelectedValue = dk.RoomId;
            }
            //清空文本框
            //加载房间类型
        }
Ejemplo n.º 4
0
        public void SetText(object sender, EventArgs e)
        {
            //清空所有文本框的值
            foreach (var item in this.Controls)
            {
                if (item is TextBox)
                {
                    TextBox tb = item as TextBox;
                    tb.Text = "";
                }
            }
            //获取传过来的值
            FrmEventArgs fea = e as FrmEventArgs;

            this.Tp = fea.Temp;
            if (Tp == 2)
            {
                RoomInfo room = fea.obj as RoomInfo;
                labId.Text        = room.RoomId.ToString();
                txtIsDeflaut.Text = room.IsDefault.ToString();
                txtRMinMoney.Text = room.RoomMinimunConsume.ToString();
                txtRPerNum.Text   = room.RoomMaxConsumer.ToString();
                txtRName.Text     = room.RoomName;
                txtRType.Text     = room.RoomType.ToString();
            }
            //要为每个文本框赋值
            //id存起来
        }
Ejemplo n.º 5
0
        }                           //用来存储餐桌的id
        public void SetText(object sender, EventArgs e)
        {
            FrmEventArgs fea = e as FrmEventArgs;
            DeskInfo     dk  = fea.obj as DeskInfo;

            labDeskName.Text    = dk.DeskName;
            labRoomType.Text    = fea.Name;             //房间的名字
            labLittleMoney.Text = fea.Money.ToString(); //最低消费
            this.ID             = dk.DeskId;            //把餐桌的id存起来
        }
Ejemplo n.º 6
0
        private void button3_Click(object sender, EventArgs e)
        {
            //获取当前选中的选项卡
            TabPage tp = tcin.TabPages[tcin.SelectedIndex];
            //获取当前选中房间的名字
            RoomInfo     room = tp.Tag as RoomInfo;
            FrmEventArgs fea  = new FrmEventArgs();

            fea.Money = Convert.ToDecimal(room.RoomMinimunConsume); //最低消费
            fea.Name  = room.RoomName;                              //房间的名字
            //最低消费--坑
            //获取当前选项卡中的listview控件
            ListView lv = tp.Controls[0] as ListView;

            //判断是否有选中的餐桌
            if (lv.SelectedItems.Count > 0)
            {
                //获取当前选中的餐桌
                DeskInfo dk = lv.SelectedItems[0].Tag as DeskInfo;
                if (dk.DeskState == 1)
                {
                    fea.Name = dk.DeskName;//餐桌的编号
                    //订单的id,根据餐桌的id查找订单的id
                    OrderInfoBLL obll    = new OrderInfoBLL();
                    int          orderId = obll.GetOrderIdByDeskId(dk.DeskId);
                    fea.Temp = orderId;//订单的id
                    //好大的一个坑,还没传值呢
                    FrmMoney1 fam = new FrmMoney1();
                    this.evtMoney1 += new EventHandler(fam.SetText);//注册事件
                    if (this.evtMoney1 != null)
                    {
                        this.evtMoney1(this, fea);
                    }
                    fam.FormClosed += new FormClosedEventHandler(fbi_FormClosed);
                    fam.ShowDialog();
                }
                else
                {
                    MessageBox.Show("请选择开单的餐桌");
                }
            }
            else
            {
                MessageBox.Show("看准目标再下手");
            }
        }
Ejemplo n.º 7
0
        public event EventHandler evtBill;//开单的事件
        //顾客开单
        private void button1_Click(object sender, EventArgs e)
        {
            TabPage tp = tcin.TabPages[tcin.SelectedIndex];
            //获取当前选中房间的名字
            RoomInfo     room = tp.Tag as RoomInfo;
            FrmEventArgs fea  = new FrmEventArgs();

            fea.Money = Convert.ToDecimal(room.RoomMinimunConsume); //最低消费
            fea.Name  = room.RoomName;                              //房间的名字
            ListView lv = tp.Controls[0] as ListView;               //获取当前选项卡中的listview控件

            //判断是否有选中的餐桌
            if (lv.SelectedItems.Count > 0)
            {
                //获取当前选中的餐桌
                DeskInfo dk = lv.SelectedItems[0].Tag as DeskInfo;
                if (dk.DeskState == 0)
                {
                    fea.obj = dk;                                  //餐桌对象
                    FrmBilling fbi = new FrmBilling();
                    this.evtBill += new EventHandler(fbi.SetText); //注册事件
                    if (this.evtBill != null)
                    {
                        this.evtBill(this, fea);
                    }
                    fbi.FormClosed += new FormClosedEventHandler(fbi_FormClosed);
                    fbi.ShowDialog();
                }
                else
                {
                    MessageBox.Show("请选择未开单的餐桌");
                }
            }
            else
            {
                MessageBox.Show("看准目标再下手");
            }
        }
Ejemplo n.º 8
0
        //注册事件的方法
        public void SetText(object sender, EventArgs e)
        {
            //清空文本框
            foreach (Control item in this.Controls)
            {
                if (item is TextBox)
                {
                    TextBox tb = item as TextBox;
                    tb.Text = "";
                }
            }
            FrmEventArgs fea = e as FrmEventArgs;

            this.Tp = fea.Temp;//标识存起来
            if (fea.Temp == 2)
            {
                CategoryInfo cat = fea.obj as CategoryInfo;
                txtCName.Text   = cat.CatName;
                txtCNum.Text    = cat.CatNum;
                txtCRemark.Text = cat.Remark;
                labId.Text      = cat.CatId.ToString();
            }
        }
Ejemplo n.º 9
0
        }                             //存标识
        //传值用的
        public void SetText(object sender, EventArgs e)
        {
            LoadMemmberType();
            FrmEventArgs fea = e as FrmEventArgs;

            this.Tp = fea.Temp;
            foreach (Control item in this.Controls)
            {
                if (item is TextBox)
                {
                    TextBox tb = item as TextBox; //将控件转为文件框
                    tb.Text = "";                 //清空所有文本框
                }
            }

            if (fea.Temp == 2)  //修改
            {
                MemmberInfo mem = fea.obj as MemmberInfo;
                //设置所有文本框的内容
                txtBirs.Text             = mem.MemBirthdaty.ToString();              //生日
                txtMemDiscount.Text      = mem.MemDiscount.ToString();               //折扣
                txtMemIntegral.Text      = mem.MemIntegral.ToString();               //积分
                txtmemMoney.Text         = mem.MemMoney.ToString();                  //余额
                txtMemName.Text          = mem.MemName;                              //会员名字
                txtMemNum.Text           = mem.MemNum;                               //会员编号
                txtMemPhone.Text         = mem.MemMobilePhone;                       //手机
                dtEndServerTime.Value    = Convert.ToDateTime(mem.MemEndServerTime); //有效时间
                rdoMan.Checked           = mem.MemGender == "男" ? true : false;
                rdoWomen.Checked         = mem.MemGender == "女" ? true : false;
                labId.Text               = mem.MemmberId.ToString();
                cmbMemType.SelectedValue = mem.MemType;
            }
            else if (fea.Temp == 1)   //新增
            {
                txtMemIntegral.Text = "0";
            }
        }