Esempio n. 1
0
 private void 预定管理ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (frmyuding == null || frmyuding.IsDisposed)
     {
         frmyuding = new Frm_Yuding();
         frmyuding.ShowDialog();
     }
     else
     {
         frmyuding.ShowDialog();
     }
 }
Esempio n. 2
0
        private void lv_desk_Click(object sender, EventArgs e)
        {
            if (lv_desk.SelectedItems.Count == 1)
            {
                string deskId         = lv_desk.SelectedItems[0].SubItems[0].Name.Trim();
                var    deskResult     = deskResultList.Find(n => n.Id.IsEquals(deskId));
                var    deskTypeResult = deskTypeResultList.Find(n => n.Id.IsEquals(deskResult.TypeId));
                switch (StaticStr.GetStatusEnum(deskResult.DeskStatus))
                {
                case StatusEnum.Normal:
                    FrmOrder frm = new FrmOrder();
                    frm.deskResult     = deskResult;
                    frm.deskTypeResult = deskTypeResult;
                    frm.ShowDialog();
                    break;

                case StatusEnum.Reserved:
                    Frm_Yuding reserved = new Frm_Yuding();
                    reserved.deskResult = deskResult;
                    reserved.ShowDialog();
                    break;

                case StatusEnum.Using:
                    Frm_JZ usings = new Frm_JZ();
                    usings.deskResult = deskResult;
                    usings.ShowDialog();
                    break;

                case StatusEnum.Clean:
                    Frm_desk clean = new Frm_desk();
                    clean.deskResult = deskResult;
                    clean.ShowDialog();
                    break;

                case StatusEnum.Malfunction:
                    Frm_desk malfunction = new Frm_desk();
                    malfunction.deskResult = deskResult;
                    malfunction.ShowDialog();
                    break;

                case StatusEnum.Unknown:
                    Frm_desk unknown = new Frm_desk();
                    unknown.deskResult = deskResult;
                    unknown.ShowDialog();
                    break;
                }
                //查询桌台消费信息
                lv_info.Items.Clear();
                toolStripLabel3.Text = deskResult.Name;
                var deskXSList = deskXSResultList.FindAll(n => n.XS_DeskName.IsEquals(deskId));
                foreach (tb_DeskXS item in deskXSList)
                {
                    ListViewItem lv = new ListViewItem(item.XS_goodsName);
                    lv.SubItems.Add(item.XS_dj);
                    lv.SubItems.Add(item.XS_Sum);
                    lv.SubItems.Add(item.XS_allprice.ToString());
                    lv.SubItems.Add(item.XS_sj.ToString());
                    lv.SubItems.Add(item.Open_Waiter);
                    lv.SubItems.Add(item.beizhu);
                    lv_info.Items.Add(lv);
                }
                if (deskResult.IsNotNull() && deskResult.DeskStatus.IsEquals(StatusEnum.Using))
                {
                    //显示时间
                    var operResult = openResultList.Find(n => n.DeskId.IsEquals(deskId));
                    if (operResult.IsNotNull())
                    {
                        LB_ktsj.Text  = operResult.CreateTime.ToString(StaticStr.MM_dd_HH_mm);
                        LB_YCNum.Text = operResult.CustomersNumber.ToString();
                    }
                    var deskXSList2 = deskXSList.FindAll(n => n.XS_DeskName.IsEquals(deskId));
                    if (deskXSList2.IsNotNull())
                    {
                        LB_money.Text = "¥" + deskXSList2.Sum(n => n.XS_allprice);
                    }
                    else
                    {
                        LB_money.Text = "¥0.00";
                    }
                }
                else
                {
                    LB_YCNum.Text = "0";
                    LB_ktsj.Text  = "—";
                    LB_yysj.Text  = "—";
                    LB_money.Text = "¥0.00";
                }
            }
        }