Exemple #1
0
        private void getcomboDishPad()
        {
            //
            comboDishPad = new ArrayList();
            ArrayList    onlydishs = comboDish.Onlydishs;
            TPotDishInfo potinfo   = new TPotDishInfo();
            //组合
            ArrayList combodishs = comboDish.Combodishs;

            for (int i = 0; i <= combodishs.Count - 1; i++)
            {
                TCombo combo = (TCombo)combodishs[i];
                for (int k = 0; k <= combo.Endnum - 1; k++)
                {
                    for (int j = 0; j <= combo.Dishs.Count - 1; j++)
                    {
                        combodishs.Add(combo.Dishs[i]);
                    }
                }
            }
            //必选
            for (int i = 0; i <= onlydishs.Count - 1; i++)
            {
                combodishs.Add((TPotDishInfo)onlydishs[i]);
            }
            //把选择的数量一个一个加到新套餐结构上,下单的时候 primarykey 的尾号就是numbers[]对应的序号
        }
Exemple #2
0
        private bool getGroupDetail()
        {
            bool   ret       = false;
            JArray groupData = null;

            ret = RestClient.getGroupDetail(this.dishinfo.Dishid, out groupData);
            if (!ret)
            {
                Warning("获取鱼锅信息失败!");
                return(false);
            }
            potDishInfo = TPotDishInfo.getPotDishInfo(Globals.CurrOrderInfo.memberno, dishinfo.Dishid, groupData);
            potDishInfo.PotInfo.Dishnum = 1;//strtointdef0(edtnum1)

            string guid = getGUID();

            if (potDishInfo.FishDishInfo2 != null)
            {
                potDishInfo.FishDishInfo2.Dishnum      = strtofloatdef0(edtNum2.Text);
                potDishInfo.FishDishInfo2.Parentdishid = dishinfo.Dishid;
                potDishInfo.FishDishInfo2.Groupid      = guid;
                potDishInfo.FishDishInfo2.Groupid2     = guid;
            }
            potDishInfo.PotInfo.Parentdishid       = this.dishinfo.Dishid;
            potDishInfo.FishDishInfo1.Parentdishid = dishinfo.Dishid;
            potDishInfo.PotInfo.Groupid            = guid;
            potDishInfo.FishDishInfo1.Groupid      = guid;
            potDishInfo.PotInfo.Groupid2           = guid;
            potDishInfo.FishDishInfo1.Groupid2     = guid;
            ret = true;
            return(ret);
        }
Exemple #3
0
        private void addControlCombo(Label lbl, TPotDishInfo potinfo, DevExpress.XtraEditors.TextEdit tbx)
        {
            TComboFromControl cfc = new TComboFromControl();

            lbl.Parent      = pnlMain;
            lbl.Left        = 18;
            lbl.Top         = onlycontrols.Count * lblHeight + combocontrols.Count * (lblHeight) + comboheight;
            cfc.lbl         = lbl;
            lbl.Font        = lblSimple.Font;
            lbl.Height      = lblHeight;
            lbl.ForeColor   = lblSimple.ForeColor;
            lbl.AutoSize    = false;
            lbl.Width       = 528;
            cfc.ispot       = true;
            cfc.potdishinfo = potinfo;
            if (tbx != null)
            {
                tbx.Parent = pnlMain;
                tbx.Font   = edtNum1.Font;
                tbx.Left   = 10;
                tbx.Top    = lbl.Top - 5;// +lblHeight;
                tbx.Left   = edtNum1.Left;
                tbx.Width  = edtNum1.Width;
                cfc.edt    = tbx;
            }
            combocontrols.Add(cfc);
        }
Exemple #4
0
        private void initView()
        {
            lblDishName.Text = dishinfo.Title;
            //根据套餐内容创建控件显示 controls
            ArrayList    onlydishs = comboDish.Onlydishs;
            TPotDishInfo potinfo   = new TPotDishInfo();
            //组合
            ArrayList combodishs = comboDish.Combodishs;

            for (int i = 0; i <= combodishs.Count - 1; i++)
            {
                TCombo combo = (TCombo)combodishs[i];
                Label  lbl   = getonlyLabel(combo);
                lbl.Name = "lbl" + combo.Columnid;
                addComboControl(lbl);
                for (int j = 0; j <= combo.Dishs.Count - 1; j++)
                {
                    if (combo.Dishs[j].GetType().Name.Equals(potinfo.GetType().Name))
                    {
                        //鱼锅
                        lbl = getonlyLabel((TPotDishInfo)combo.Dishs[j]);
                        DevExpress.XtraEditors.TextEdit tbx = getComboTextBox();
                        tbx.Tag          = combo;
                        tbx.Click       += new EventHandler(edtNum1_Click);
                        tbx.TextChanged += new EventHandler(edtNum1_EditValueChanged);
                        tbx.Enter       += new EventHandler(edtNum1_Enter);
                        addControlCombo(lbl, (TPotDishInfo)combo.Dishs[j], tbx);
                    }
                    else
                    {
                        //普通菜
                        lbl = getonlyLabel((t_shopping)combo.Dishs[j], true);
                        DevExpress.XtraEditors.TextEdit tbx = getComboTextBox();
                        tbx.Tag          = combo;
                        tbx.Click       += new EventHandler(edtNum1_Click);
                        tbx.TextChanged += new EventHandler(edtNum1_EditValueChanged);
                        tbx.Enter       += new EventHandler(edtNum1_Enter);
                        addControlCombo(lbl, (t_shopping)combo.Dishs[j], tbx);
                    }
                }
            }
            //必选
            for (int i = 0; i <= onlydishs.Count - 1; i++)
            {
                Label lbl = lblSimple;
                if (onlydishs[i].GetType().Name.Equals(potinfo.GetType().Name))
                {
                    //鱼锅
                    lbl = getonlyLabel((TPotDishInfo)onlydishs[i]);
                    addControl(lbl, (TPotDishInfo)onlydishs[i], null);
                }
                else
                {
                    //普通菜
                    lbl = getonlyLabel((t_shopping)onlydishs[i], false);
                    addControl(lbl, (t_shopping)onlydishs[i], null);
                }
                lblLine.Top = lbl.Top + lblHeight;
            }
        }
Exemple #5
0
        public static bool ShowFish(t_shopping dishinfo, out TPotDishInfo potDishInfo)
        {
            frmFish frm = new frmFish();

            frm.dishinfo = dishinfo;
            frm.getGroupDetail();
            frm.initView();
            frm.ShowDialog();
            bool ret = frm.DialogResult == DialogResult.OK;

            potDishInfo = frm.potDishInfo;
            return(ret);
        }
Exemple #6
0
        private static bool existsDishid(TPotDishInfo potInfo)
        {
            bool isin = false;

            foreach (DataRow dr in Globals.OrderTable.Rows)
            {
                if (dr["dishid"].ToString().Equals(potInfo.PotInfo.Dishid))
                {
                    isin = true;
                    break;
                }
            }
            return(isin);
        }
Exemple #7
0
        private Label getonlyLabel(TPotDishInfo potinfo)
        {
            Label  label    = new Label();
            String potStr   = String.Format("{0}:{1}{2}", potinfo.PotInfo.Title, potinfo.PotInfo.Dishnum, potinfo.PotInfo.Dishunit);
            String dish1Str = String.Format(",{0}:{1}{2}", potinfo.FishDishInfo1.Title, potinfo.FishDishInfo1.Dishnum, potinfo.FishDishInfo1.Dishunit);
            String dish2Str = "";

            if (potinfo.FishDishInfo2 != null)
            {
                dish2Str = String.Format(",{0}:{1}{2}", potinfo.FishDishInfo2.Title, potinfo.FishDishInfo2.Dishnum, potinfo.FishDishInfo2.Dishunit);
            }
            label.Text = String.Format("{0}({1}{2}{3})", potinfo.PotDish.Title, potStr, dish1Str, dish2Str);
            return(label);
        }
Exemple #8
0
        private void addControl(Label lbl, TPotDishInfo potinfo, DevExpress.XtraEditors.TextEdit tbx)
        {
            TComboFromControl cfc = new TComboFromControl();

            lbl.Parent      = pnlMain;
            lbl.Left        = 0;
            lbl.Top         = onlycontrols.Count * lblHeight + combocontrols.Count * (lblHeight) + comboheight;// onlycontrols.Count* lblHeight;
            lbl.Height      = lblHeight;
            cfc.lbl         = lbl;
            lbl.Font        = lblSimple.Font;
            lbl.ForeColor   = lblSimple.ForeColor;
            lbl.AutoSize    = false;
            lbl.Width       = 528;
            cfc.ispot       = true;
            cfc.potdishinfo = potinfo;
            onlycontrols.Add(cfc);
        }
Exemple #9
0
        private void addPot(TPotDishInfo pot)
        {
            string userid = Globals.CurrOrderInfo.userid;

            if (userid == null)
            {
                userid = Globals.UserInfo.UserID;
            }
            //鱼锅
            string guid = getGUID();

            pot.PotDish.Orderstatus     = 6;
            pot.PotDish.Orderid         = Globals.CurrOrderInfo.orderid;
            pot.PotDish.Userid          = userid;// Globals.UserInfo.UserID;
            pot.PotDish.Ordertime       = DateTime.Now;
            pot.PotDish.Tableid         = Globals.CurrTableInfo.tableNo;
            pot.PotDish.Price           = 0;
            pot.PotDish.Groupid         = FGuid;
            pot.PotDish.Groupid2        = guid;
            pot.PotDish.IsPot           = 0;
            pot.PotDish.Primarydishtype = 2;

            pot.PotInfo.Orderstatus     = 2;
            pot.PotInfo.Orderid         = Globals.CurrOrderInfo.orderid;
            pot.PotInfo.Userid          = userid;// Globals.UserInfo.UserID;
            pot.PotInfo.Ordertime       = DateTime.Now;
            pot.PotInfo.Tableid         = Globals.CurrTableInfo.tableNo;
            pot.PotInfo.Price           = 0;
            pot.PotInfo.Groupid         = FGuid;
            pot.PotInfo.Groupid2        = guid;
            pot.PotInfo.IsPot           = 1;
            pot.PotInfo.Primarydishtype = 2;

            pot.FishDishInfo1.Orderstatus     = 5;
            pot.FishDishInfo1.Orderid         = Globals.CurrOrderInfo.orderid;
            pot.FishDishInfo1.Userid          = userid;// Globals.UserInfo.UserID;
            pot.FishDishInfo1.Ordertime       = DateTime.Now;
            pot.FishDishInfo1.Tableid         = Globals.CurrTableInfo.tableNo;
            pot.FishDishInfo1.Price           = 0;
            pot.FishDishInfo1.Groupid         = FGuid;
            pot.FishDishInfo1.Groupid2        = guid;
            pot.FishDishInfo1.Primarydishtype = 2;
            pot.PotDish.Ordertype             = 3;
            t_shopping.add(ref Globals.ShoppTable, pot.PotDish, true);
            pot.PotInfo.Ordertype = 3;
            t_shopping.add(ref Globals.ShoppTable, pot.PotInfo, true);
            pot.FishDishInfo1.Ordertype = 3;
            t_shopping.add(ref Globals.ShoppTable, pot.FishDishInfo1, true);
            if (pot.FishDishInfo2 != null)
            {
                pot.FishDishInfo2.Orderid         = Globals.CurrOrderInfo.orderid;
                pot.FishDishInfo2.Userid          = userid;// Globals.UserInfo.UserID;
                pot.FishDishInfo2.Ordertime       = DateTime.Now;
                pot.FishDishInfo2.Tableid         = Globals.CurrTableInfo.tableNo;
                pot.FishDishInfo2.Orderstatus     = 5;
                pot.FishDishInfo2.Price           = 0;
                pot.FishDishInfo2.Ordertype       = 3;
                pot.FishDishInfo2.Groupid2        = guid;
                pot.FishDishInfo2.Groupid         = FGuid;
                pot.FishDishInfo2.Primarydishtype = 2;
                t_shopping.add(ref Globals.ShoppTable, pot.FishDishInfo2, true);
            }
        }