Example #1
0
        //创建技师按钮
        /*private void createTechButton(int x, int y, string txt, Control sp)
        {
            Button btn = new Button();
            btn.AutoEllipsis = true;
            btn.AutoSize = true;
            btn.FlatAppearance.BorderColor = Color.LightGray;
            btn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue;
            btn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.LightSteelBlue;
            btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            btn.ImageList = imageList1;
            btn.ImageIndex = 0;
            btn.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
            btn.Location = new System.Drawing.Point(x, y);
            btn.Name = txt;
            btn.Text = txt;
            btn.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
            btn.UseVisualStyleBackColor = true;

            //btn.Click += new System.EventHandler(btnAvi_Click);

            sp.Controls.Add(btn);
        }*/
        //创建菜单类别界面
        private void createMenuTypePanel()
        {
            cPanel.Controls.Clear();
            bool first = true;
            int x = 10;
            int y = 9;

            for (int i = m_index; i < typeList.Count(); i++ )
            {
                Color color = first ? Color.Orange : Color.Blue;
                first = false;
                createButton(x, y, typeList[i], cPanel, 1, color);
                x += 80;
            }
            m_Catgory = dao.get_Catgory("name='" + typeList[0] + "'");
            //m_Catgory = db.Catgory.FirstOrDefault(z => z.name == typeList[0]);
            createMenuPanel();
        }
Example #2
0
        public CCatgory get_Catgory(string cmd_str)
        {
            CCatgory catgory = null;
            SqlConnection sqlCn = null;

            try
            {
                sqlCn = new SqlConnection(_con_str);
                sqlCn.Open();

                cmd_str = "Select * from [Catgory] where (" + cmd_str + ")";
                SqlCommand cmdSelect = new SqlCommand(cmd_str, sqlCn);
                using (SqlDataReader dr = cmdSelect.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        catgory = new CCatgory();

                        catgory.id = (int)dr["id"];
                        catgory.name = dr["name"].ToString();
                        catgory.kitchPrinterName = dr["kitchPrinterName"].ToString();

                        break;
                    }
                }

            }
            catch (System.Exception e)
            {
                BathClass.printErrorMsg(e.Message);
            }
            finally
            {
                close_connection(sqlCn);
            }

            return catgory;
        }
Example #3
0
        //创建技师列表
        /*private void createTechnicianPanel(List<int> tLst)
        {
            mPanel.Controls.Clear();
            int row = 0;
            int col = 0;
            int index = 0;
            int count = tLst.Count;
            while (index < count)
            {
                while ((col + 1) * 80 < this.Size.Width && index < count)
                {
                    int x = col * 70 + 10 * (col + 1);
                    int y = row * 70 + 10 * (row + 1);
                    createTechButton(x, y, tLst[index].ToString(), mPanel);
                    col++;
                    index++;
                }
                col = 0;
                row++;
            }
        }*/
        //点击菜式类别
        private void btnType_Click(object sender, EventArgs e)
        {
            Button btn = sender as Button;
            foreach (Control c in cPanel.Controls)
                c.BackColor = Color.Blue;
            btn.BackColor = Color.Orange;

            m_Catgory = dao.get_Catgory("name='" + btn.Text + "'");
            //m_Catgory = db.Catgory.FirstOrDefault(x => x.name == btn.Text);
            createMenuPanel();
        }