예제 #1
0
        public CashierFrom(MainForm f)
        {
            InitializeComponent();
            m_mainForm = f;
            cafeContext = new cafesystemEntities4();
            //m_orders = new Dictionary<DateTime, List<recipe>>();
            m_currentOrder = new List<recipe>();

            m_currentORDERNUM = Constants.Functions.ORDER_NUM();
            printOrderTemplate();
        }
예제 #2
0
        private void Load_data_Click(object sender, EventArgs e)
        {
            cafeContext = new cafesystemEntities4();
            var foodQuery = from f in cafeContext.food_category select f;
            var recipeQuery = from r in cafeContext.recipe select r;
            var recipestuffQuery = from rs in cafeContext.recipe_stuff select rs;
            var ingridientQuery = from i in cafeContext.ingridient select i;
            var measureQuery = from m in cafeContext.measure select m;
            var supplyQuery = from s in cafeContext.supply select s;
            var departmentQuery = from d in cafeContext.department select d;
            var workersQuery = from w in cafeContext.worker select w;
            var ordersQuery = from o in cafeContext.ordert select o;
            var orderstuffQuery = from os in cafeContext.order_stuff select os;
            try
            {
                foodGridView1.DataSource = ((ObjectQuery)foodQuery).Execute(MergeOption.AppendOnly);
                foodGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                RecipeGridView1.DataSource = ((ObjectQuery)recipeQuery).Execute(MergeOption.AppendOnly);
                RecipeGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                recipestuffGridView1.DataSource = ((ObjectQuery)recipestuffQuery).Execute(MergeOption.AppendOnly);
                recipestuffGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                ingridientGridView1.DataSource = ((ObjectQuery)ingridientQuery).Execute(MergeOption.AppendOnly);
                ingridientGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                MeasureGridView1.DataSource = ((ObjectQuery)measureQuery).Execute(MergeOption.AppendOnly);
                MeasureGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                supplyGridView1.DataSource = ((ObjectQuery)supplyQuery).Execute(MergeOption.AppendOnly);
                supplyGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                departmentGridView1.DataSource = ((ObjectQuery)departmentQuery).Execute(MergeOption.AppendOnly);
                departmentGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                workerGridView1.DataSource = ((ObjectQuery)workersQuery).Execute(MergeOption.AppendOnly);
                workerGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                OrderdataGridView1.DataSource = ((ObjectQuery)ordersQuery).Execute(MergeOption.AppendOnly);
                OrderdataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                OrderStuffdataGridView2.DataSource = ((ObjectQuery)orderstuffQuery).Execute(MergeOption.AppendOnly);
                OrderStuffdataGridView2.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #3
0
        public LoginForm(MainForm F, int DEP)
        {
            InitializeComponent();
            m_mainform = F;
            m_departmentCallFrom = DEP;
            cafeContext = new cafesystemEntities4();

            ///test purposes
            if (DEP == Constants.MANAGERDEP_ID)
            {
                login_tb.Text = "AlexSalo";
                pass_tb.Text = "123";
            }
            ///test purposes
            if (DEP == Constants.COOCKERDEP_ID)
            {
                login_tb.Text = "CookerFast";
                pass_tb.Text = "111";
            }
        }
예제 #4
0
        private void ShowRecipeBtn_Click(object sender, EventArgs e)
        {
            cafeContext = new cafesystemEntities4();

            IEnumerable<string> foodcatQuery = cafeContext.ExecuteStoreQuery<string>("select name from food_category");
            food_category_lb.Items.Clear();
            foreach (string s in foodcatQuery )
                food_category_lb.Items.Add(s);
        }
예제 #5
0
 public AddRecipeForm()
 {
     InitializeComponent();
     m_cafecontext = new cafesystemEntities4();
     totalcost = 0;
 }