Exemple #1
0
        private string GetSqlStatement()
        {
            DishTableStatus status = m_mainInfo.GetCheckedStatus();

            frmMainScreenControl mainScreenControl = new frmMainScreenControl();

            frmMainScreenControl.Status = status;

            return(mainScreenControl.GetExeSql(CurrentAreaId, (CurrentSystemInfo.CurrentSysInfo[typeof(SalesPoint).FullName].FirstOrDefault() as SalesPoint).Id, m_mainInfo.txtSearchTable.Text));
        }
Exemple #2
0
        private void RefreshDishTable()
        {
            frmMainScreenControl.Status = GetCheckedStatus();

            string sql = mainScreenControl.GetExeSql(frmMain.CurrentAreaId, CurrentSystemInfo.SalesPoint.Id, txtSearchTable.Text);

            //frmMain = new WinForms.frmMain();
            CurrentUIForms.mainForm.FillDishTableData();
            //mainScreenControl.DishTableDataTable = mainScreenControl.GetDishTableInfo(sql);
            //frmMainScreenControl.DishTableDataTableClone = mainScreenControl.DishTableDataTable;

            //frmMain main = new frmMain();
            //main.MainScreenControl = mainScreenControl;
            //main.FillDishTable();
        }
Exemple #3
0
        public void FillDishTableData(string sql)
        {
            if (mainScreenControl.DishTableDataTable != null)
            {
                mainScreenControl.DishTableDataTable = null;
            }


            sql = mainScreenControl.GetExeSql(CurrentAreaId, CurrentSystemInfo.SalesPoint.Id, m_mainInfo.txtSearchTable.Text);

            mainScreenControl.DishTableDataTable         = mainScreenControl.GetDishTableInfo(sql);
            frmMainScreenControl.DishTableDataTableClone = mainScreenControl.DishTableDataTable;
            if (mainScreenControl.DishTableDataTable.Rows.Count > 0)
            {
                this._mMaxDishTablePage = Convert.ToInt32(mainScreenControl.DishTableDataTable.Rows.Count / CurrentUIForms.custDishTables.Length) + 1;
            }
            if (this._mCurrDishTablePage < 1)
            {
                this._mCurrDishTablePage = 1;
            }
            if (_mMaxDishTablePage > 0)
            {
                if (this._mCurrDishTablePage > this._mMaxDishTablePage)
                {
                    this._mCurrDishTablePage = _mMaxDishTablePage;
                }
            }

            for (int i = 0; i < CurrentUIForms.custDishTables.Length; i++)
            {
                if ((this._mCurrDishTablePage - 1) * CurrentUIForms.custDishTables.Length + i < mainScreenControl.DishTableDataTable.DefaultView.Count)
                {
                    CurrentUIForms.custDishTables[i].TableId    = Convert.ToInt32(mainScreenControl.DishTableDataTable.DefaultView[(this._mCurrDishTablePage - 1) * CurrentUIForms.custDishTables.Length + i]["Id"]);
                    CurrentUIForms.custDishTables[i].GuestCount = Convert.ToInt32(mainScreenControl.DishTableDataTable.DefaultView[(this._mCurrDishTablePage - 1) * CurrentUIForms.custDishTables.Length + i]["GuestCount"]);
                    CurrentUIForms.custDishTables[i].Status     = Convert.ToInt32(mainScreenControl.DishTableDataTable.DefaultView[(this._mCurrDishTablePage - 1) * CurrentUIForms.custDishTables.Length + i]["Status"]);
                    CurrentUIForms.custDishTables[i].TableName  = Convert.ToString(mainScreenControl.DishTableDataTable.DefaultView[(this._mCurrDishTablePage - 1) * CurrentUIForms.custDishTables.Length + i]["Name"]);
                    //this.custDishTables[i].Style = Convert.ToString(mainScreenControl.DishTableDataTable.DefaultView[(this.m_currDishTablePage - 1) * this.custDishTables.Length + i]["Style"]);
                    CurrentUIForms.custDishTables[i].Visible = true;

                    this.ccButtonGrid1.SetBtnVisual(i, true);
                }
                else
                {
                    ccButtonGrid1.SetBtnVisual(i, false);
                }
                ccButtonGrid1.SetBtnId(i, CurrentUIForms.custDishTables[i].TableId);
                ccButtonGrid1.SetBtnText(i, CurrentUIForms.custDishTables[i].GetTableCaption());
                //Color color = this.custDishTables[i].GetBtnBackColor();
                Color color = Color.White;
                this.ccButtonGrid1.SetBtnColr(i, color);
                switch (CurrentUIForms.custDishTables[i].Status)
                {
                case 1:
                    this.ccButtonGrid1.SetBtnImage(i, @"E:\51CTO下载-C# 餐饮管理系统 详细源代码\MrCy\Backup\MrCy\Image\a_1.gif");
                    break;

                case 2:
                    this.ccButtonGrid1.SetBtnImage(i, @"E:\51CTO下载-C# 餐饮管理系统 详细源代码\MrCy\Backup\MrCy\Image\a_2.gif");
                    break;

                case 3:
                    this.ccButtonGrid1.SetBtnImage(i, @"E:\51CTO下载-C# 餐饮管理系统 详细源代码\MrCy\Backup\MrCy\Image\a_3.jpg");
                    break;

                case 4:
                    this.ccButtonGrid1.SetBtnImage(i, @"E:\51CTO下载-C# 餐饮管理系统 详细源代码\MrCy\Backup\MrCy\Image\a_4.jpg");
                    break;

                default:
                    break;
                }

                this.ccButtonGrid1.SetBtnText(CurrentUIForms.custDishTables.Length, "翻 页");
                this.ccButtonGrid1.SetBtnColr(CurrentUIForms.custDishTables.Length, Color.PeachPuff);
                this.ccButtonGrid1.SetBtnImage(CurrentUIForms.custDishTables.Length, @"e:\RMS\RMS\WinForms\bin\Debug\Task1.ico");
                if (mainScreenControl.DishTableDataTable.Rows.Count < CurrentUIForms.custDishTables.GetUpperBound(0))
                {
                    this.ccButtonGrid1.SetBtnVisual(CurrentUIForms.custDishTables.Length, false);
                }
                else
                {
                    this.ccButtonGrid1.SetBtnVisual(CurrentUIForms.custDishTables.Length, true);
                }

                if (this._mCurrDishTableId == CurrentUIForms.custDishTables[i].TableId)
                {
                    this.ccButtonGrid1.SetBtnText(i, "√" + CurrentUIForms.custDishTables[i].TableName);
                }
            }

            //frmMainInfo mainInfo = new frmMainInfo();

            //mainInfo.BindDishTableInfo();
            //BindDishTableInfo();
            isRefreshing = false;
        }