Beispiel #1
0
        private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
        {
            DateTime dt = dateTimePicker1.Value;

            //日
            label10.Text = ConsumerBillBLL.billYY(dt.ToString("yyyyMMdd")) + "元";
            //月
            label11.Text = ConsumerBillBLL.billYY(dt.ToString("yyyyMM")) + "元";
            //年
            label12.Text = ConsumerBillBLL.billYY(dt.ToString("yyyy")) + "元";
        }
Beispiel #2
0
        private void FrmSelectBill_Load(object sender, EventArgs e)
        {
            DataTable dt = ConsumerBillBLL.GetBill();

            chart1.Series[0].YValueMembers = "CDprice";
            chart1.Series[0].XValueMember  = "CDDate";
            chart1.DataSource = dt;
            DataTable dt_p = ProductsBLL.GetPT();

            chart2.Series[0].YValueMembers = "销量";
            chart2.Series[0].XValueMember  = "商品名字";
            chart2.DataSource = dt_p;
            DateTime dtt = dateTimePicker1.Value;

            //日
            label10.Text = ConsumerBillBLL.billYY(dtt.ToString("yyyyMMdd")) + "元";
            //月
            label11.Text = ConsumerBillBLL.billYY(dtt.ToString("yyyyMM")) + "元";
            //年
            label12.Text = ConsumerBillBLL.billYY(dtt.ToString("yyyy")) + "元";
        }
Beispiel #3
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            try
            {
                if (!File.Exists("配置文件.ini"))
                {
                    MessageBox.Show("文件不存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                FileStream   fs = new FileStream("配置文件.ini", FileMode.Open);
                StreamReader rd = new StreamReader(fs, Encoding.Default);
                while (!rd.EndOfStream)
                {
                    string r  = rd.ReadLine();
                    string r1 = r.Split(':')[0];
                    switch (r1)
                    {
                    case "系统名称":
                        label3.Text = r.Split(':')[1];
                        break;

                    default:
                        break;
                    }
                }
                rd.Close();
                fs.Close();

                label4.Text       = admins.UserCompellation;
                label1.Text       = DateTime.Now.ToString("yyyy年MM月dd日");
                label2.Text       = DateTime.Now.ToString("hh:mm:ss");
                label14.Text      = "日营业额" + ConsumerBillBLL.billYY(DateTime.Now.ToString("yyyyMMdd")) + "元";
                pictureBox8.Image = WaySTwo(admins.id);
                dataGridView1.Columns[3].Visible = false;
                dataGridView1.Columns[4].Visible = false;

                #region 动态生成
                List <RoomTypeMDL> list = RoomTypeBLL.selectRoom();
                foreach (RoomTypeMDL item in list)
                {
                    //动态添加tabpage

                    TabPage t = new TabPage();
                    t.Text = item.RTName;
                    t.Tag  = item.RTID;


                    //准备listview
                    ListView lview = new ListView();
                    lview.Dock           = DockStyle.Fill;
                    lview.LargeImageList = imageList1;
                    lview.View           = View.LargeIcon;
                    lview.Font           = new Font("微软雅黑", 12);

                    lview.MouseClick += new MouseEventHandler(lview_MouseClick);


                    t.Controls.Add(lview);
                    this.tabControl1.TabPages.Add(t);
                    List <TablesMDL> list_t = TablesBLL.selectTable(item.RTID);
                    foreach (TablesMDL items in list_t)
                    {
                        TableCount += 1;
                        ListViewItem lvi = new ListViewItem();
                        lvi.Text       = items.TableName;
                        lvi.ImageIndex = items.TableState;
                        if (items.TableState == 1)
                        {
                            kaicount += 1;
                        }
                        if (items.TableState == 0)
                        {
                            nullcount += 1;
                        }
                        lvi.Tag = items.TableID;
                        lview.Items.Add(lvi);
                    }
                }

                #endregion
                label10.Text = "总台:" + TableCount.ToString();
                label11.Text = "空台:" + nullcount.ToString();
                label12.Text = "开台:" + kaicount.ToString();
                double sz  = kaicount / (TableCount + 0.0);
                string bf  = (sz * 100).ToString();
                string bf1 = "";
                if (bf.Length > 4)
                {
                    bf1 = bf.Substring(0, 4);
                }
                label13.Text = "上桌率:" + bf1 + "%";
            }
            catch (Exception)
            {
                MessageBox.Show("发生未只的异常,请联系开发者", "未知异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }