예제 #1
0
        public void LoadEj(TableButtonData bData)
        {
            Transaction trans = new Transaction(bData.Trans_no);

            trans.Pos_no          = bData.Pos_no;
            trans.Organization_no = PosSettings.Default.Organization;
            trans.Store_no        = PosSettings.Default.Store;
            trans.Load();
            if (trans.State == (int)Transaction.Status.SUSPEND)
            {  // was this a suspended transaction?
                PosContext.Instance.CurrentEj = Ej.GetSuspendedEj(trans);

                if (PosContext.Instance.CurrentEj.EjArrayList.Count > 0)
                {  // finally make sure there are records
                    PosContext.Instance.TableName = trans.Table_name;
                    trans.State = (int)Transaction.Status.IN_PROGRESS;
                    foreach (Object obj in PosContext.Instance.CurrentEj.EjArrayList)
                    {
                        EjLine line = (EjLine)obj;
                        PosContext.Instance.Receipt.Update(line);
                    }

                    //	context ().homeGuis ();
                    //	context ().eventStack ().setEvent (new FirstItem (context ()));
                    //this.States().Clear();
                    //	PosEventStack.Instance.NextEvent();
                }
            }
        }
예제 #2
0
        public void DrawTableModel(int tableGroupNo)
        {
            this.lastUsedtableGroup = tableGroupNo;

            Hashtable invHashtable = GetCurrentOrders();

            gridTableModel.Children.Clear();
            TableDetails tableDetails = new TableDetails();

            tableDetails.Organization_no = PosSettings.Default.Organization;
            tableDetails.Store_no        = PosSettings.Default.Store;
            tableDetails.Table_group_no  = tableGroupNo;

            DataSet   dataSet = tableDetails.LoadTable();
            DataTable dt      = dataSet.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                TableButtonData bData = new TableButtonData();
                bData.Display_row_no    = int.Parse(dr["display_row_no"].ToString());
                bData.Display_column_no = int.Parse(dr["display_column_no"].ToString());
                bData.Table_no          = int.Parse(dr["table_no"].ToString());
                bData.Table_name        = dr["table_name"].ToString();
                bData.Picture_name      = dr["picture_name"].ToString();

                Button tableBtn = new Button();
                tableBtn.DataContext = bData;

                if (invHashtable.ContainsKey(bData.Table_name))
                {
                    DataRow dr1 = invHashtable[bData.Table_name] as DataRow;
                    bData.Pos_no   = int.Parse(dr1["pos_no"].ToString());
                    bData.Trans_no = int.Parse(dr1["trans_no"].ToString());
                    tableBtn.Style = (Style)FindResource("btnXLSActive");
                }
                else
                {
                    tableBtn.Style = (Style)FindResource("btnXLS");
                }


                gridTableModel.Children.Add(tableBtn);

                tableBtn.Click += new RoutedEventHandler(tableBtn_Click);
            }
        }
예제 #3
0
        void tableBtn_Click(object sender, RoutedEventArgs e)
        {
            //  PosContext.Instance.CurrentPosDisplay.UnloadTableSelect();

            Button          btn   = sender as Button;
            TableButtonData bData = btn.DataContext as TableButtonData;

            PosContext.Instance.InputLine = bData.Table_name;

            /*if (bData.Trans_no > 0)
             * {
             *
             *  this.LoadEj(bData);
             * }
             */
            PosEventStack.Instance.NextEvent();
        }