예제 #1
0
        public void InitOption()
        {
            var PointX        = 20;
            var PointY        = 20;
            var interval      = 5;
            var currentColumn = 0;

            for (int i = 1; i < 50; i++)
            {
                Label lbNum = new Label();
                lbNum.Text      = i.ToString().PadLeft(2, '0');
                lbNum.Size      = new Size(35, 20);
                lbNum.Tag       = lbNum.Text;
                lbNum.BackColor = ServiceNum.GetNumColor(i);
                lbNum.Name      = "Code";
                lbNum.Font      = new System.Drawing.Font("宋体", 15F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))));

                Label lbPL = new Label();
                lbPL.Text = "00.00";
                lbPL.Size = new Size(60, 20);
                lbPL.Tag  = lbNum.Text;
                lbPL.Name = "PL";
                //  lbPL.BackColor = Color.Yellow;
                lbPL.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));

                TextBox txt = new TextBox();
                txt.Tag       = lbNum.Text;
                txt.KeyPress += new System.Windows.Forms.KeyPressEventHandler(Common.TextBox_FilterString_KeyPress);
                txt.Size      = new Size(45, 30);


                if (i == 1 || i == 11 || i == 21 || i == 31 || i == 41)
                {
                    PointY = 20;
                }
                PointX = 20;
                if (i % 10 > 0)
                {
                    currentColumn = i / 10 + 1;
                }
                else
                {
                    currentColumn = i / 10;
                }
                PointX = PointX + 155 * (currentColumn - 1);


                lbNum.Location = new Point(PointX, PointY);
                lbPL.Location  = new Point(PointX + 35, PointY);
                txt.Location   = new Point(PointX + 30 + 65, PointY);

                PointY = PointY + interval + lbNum.Height;

                this.groupBox2.Controls.Add(lbNum);

                this.groupBox2.Controls.Add(lbPL);

                this.groupBox2.Controls.Add(txt);
            }
        }
예제 #2
0
 public fmFastLX()
 {
     InitializeComponent();
     charList.Add("1");
     charList.Add("2");
     charList.Add("3");
     charList.Add("Q");
     charList.Add("W");
     charList.Add("E");
     charList.Add("A");
     charList.Add("S");
     charList.Add("D");
     charList.Add("Z");
     charList.Add("X");
     charList.Add("C");
     charList.Add("q");
     charList.Add("w");
     charList.Add("e");
     charList.Add("a");
     charList.Add("s");
     charList.Add("d");
     charList.Add("z");
     charList.Add("x");
     charList.Add("c");
     zodiacArray = ServiceNum.GetZodiacArray();
 }
예제 #3
0
파일: ULM.cs 프로젝트: tanzw/six
        public void InitOption()
        {
            var PointX        = 20;
            var PointY        = 20;
            var interval      = 5;
            var currentColumn = 0;

            for (int i = 1; i < 50; i++)
            {
                Label lbNum = new Label();
                lbNum.Text      = i.ToString().PadLeft(2, '0');
                lbNum.Size      = new Size(35, 20);
                lbNum.Tag       = lbNum.Text;
                lbNum.BackColor = ServiceNum.GetNumColor(i);
                lbNum.Name      = "Code";
                lbNum.Font      = new System.Drawing.Font("宋体", 15F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))));

                CheckBox ck = new CheckBox();
                ck.AutoSize = true;
                ck.TabIndex = i;
                ck.Name     = "CK";
                ck.Tag      = lbNum.Tag;
                ck.Enter   += new System.EventHandler(Common.CheckBox_UpdateColor_Enter);
                ck.Leave   += new System.EventHandler(Common.CheckBox_UpdateColor_Leave);



                if (i == 1 || i == 11 || i == 21 || i == 31 || i == 41)
                {
                    PointY = 20;
                }
                PointX = 20;
                if (i % 10 > 0)
                {
                    currentColumn = i / 10 + 1;
                }
                else
                {
                    currentColumn = i / 10;
                }
                PointX = PointX + 200 * (currentColumn - 1);


                lbNum.Location = new Point(PointX, PointY);

                ck.Location = new Point(PointX + 45, PointY + 4);
                PointY      = PointY + interval + lbNum.Height;

                this.Controls.Add(lbNum);


                this.Controls.Add(ck);
            }
        }
예제 #4
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string          OrderId = Guid.NewGuid().ToString("n");
            Order <OrderTM> order   = new Order <OrderTM>()
            {
                Create_Time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id  = "0",
                Customer_Id     = cbxCustomer.SelectedValue.ToString().ToTryInt(),
                Id              = OrderId,
                IsDel           = 0,
                Sort            = textBox1.Text.ToTryInt(),
                Issue           = txtIssue.Text.Trim(),
                Order_No        = ServiceNum.GetOrderNo(),
                Order_Type      = orderType,
                Child_Type      = childType,
                Total_In_Money  = orderDetails.Sum(x => x.InMoney),
                Total_Out_Money = 0,
                Update_Time     = "",
                Update_User_Id  = "",
                OrderDetails    = orderDetails
            };

            order.OrderDetails.ForEach(x =>
            {
                x.OrderId = OrderId;
            });


            OrderImpl services = new OrderImpl();

            if (services.AddOrderTM(order).Code == 0)
            {
                MessageEx.Show("投注成功");
                textBox1.Text = (textBox1.Text.Trim().ToTryInt() + 1).ToString();
                listView1.Items.Clear();
                txtMoney.Text = "";
                txtCode.Text  = "";
                orderDetails.Clear();
            }
            else
            {
                MessageEx.ShowError("投注失敗");
            }
        }
예제 #5
0
파일: fmHX.cs 프로젝트: tanzw/six
        private void btnOK_Click(object sender, EventArgs e)
        {
            #region 检测输入
            if (this.cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIssue.Text))
            {
                MessageEx.ShowWarning("请输入期号");
                return;
            }
            if (txtIssue.Text.Trim().Length != 7)
            {
                MessageEx.ShowWarning("请输入正确的期号");
                return;
            }
            if (GetRadioChecked() <= 1)
            {
                MessageEx.ShowWarning("请选择合肖类型");
                return;
            }
            if (string.IsNullOrWhiteSpace(txtMoney.Text.Trim()))
            {
                MessageEx.ShowWarning("请输入金额");
                return;
            }
            if (string.IsNullOrWhiteSpace(txt.Text.Trim()))
            {
                MessageEx.ShowWarning("请输入生肖");
                return;
            }
            else
            {
                var str     = txt.Text.Trim();
                var l       = ServiceNum.GetZodiacArray();
                var flag    = false;
                var tmpList = new List <string>();
                var tmpr    = false;

                foreach (var s in str)
                {
                    var ss = s.ToString();
                    if (l.Count(x => x.Value == ss) == 0)
                    {
                        flag = true;
                        break;
                    }
                    if (tmpList.Contains(ss.ToString()))
                    {
                        tmpr = true;
                        break;
                    }
                    else
                    {
                        tmpList.Add(ss.ToString());
                    }
                }
                if (flag)
                {
                    MessageEx.ShowWarning("输入的生肖不正确,请输入正确的生肖");
                    return;
                }
                if (tmpr)
                {
                    MessageEx.ShowWarning("生肖存在重复");
                    return;
                }
                if (radioButton1.Checked && txt.Text.Trim().Length != 6)
                {
                    MessageEx.ShowWarning("生肖个数不正确");
                    return;
                }
                if (radioButton2.Checked && txt.Text.Trim().Length != 5)
                {
                    MessageEx.ShowWarning("生肖个数不正确");
                    return;
                }
                if (radioButton3.Checked && txt.Text.Trim().Length != 4)
                {
                    MessageEx.ShowWarning("生肖个数不正确");
                    return;
                }
                if (radioButton4.Checked && txt.Text.Trim().Length != 3)
                {
                    MessageEx.ShowWarning("生肖个数不正确");
                    return;
                }
                if (radioButton5.Checked && txt.Text.Trim().Length != 2)
                {
                    MessageEx.ShowWarning("生肖个数不正确");
                    return;
                }
            }
            var vv   = GetRadioChecked();
            var odds = oddsList.FirstOrDefault(x => x.ChildType == vv);
            if (odds == null)
            {
                MessageEx.ShowWarning("未设置赔率");
                return;
            }

            #endregion
            string         OrderId = Guid.NewGuid().ToString("n");
            List <OrderTM> list    = new List <OrderTM>();

            var detail = new OrderTM();
            detail.ChildType = GetRadioChecked();
            detail.Code      = txt.Text.Trim();
            detail.Flag      = 1;
            detail.Id        = Guid.NewGuid().ToString("n");
            detail.InMoney   = Convert.ToDecimal(txtMoney.Text.Trim());
            detail.Odds      = odds.PL;
            detail.OrderId   = OrderId;
            detail.OutMoney  = detail.Odds * detail.InMoney;
            detail.Remarks   = detail.Code;
            detail.Sort      = 1;
            detail.Status    = (int)ResultStatus.Wait;
            list.Add(detail);

            Order <OrderTM> order = new Order <OrderTM>()
            {
                Create_Time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id  = "0",
                Customer_Id     = cbox.SelectedValue.ToString().ToTryInt(),
                Id              = OrderId,
                IsDel           = 0,
                Issue           = txtIssue.Text.Trim(),
                Order_No        = ServiceNum.GetOrderNo(),
                Order_Type      = (int)OrderType.合肖,
                Total_In_Money  = list.Sum(x => x.InMoney),
                Total_Out_Money = 0,
                Update_Time     = "",
                Update_User_Id  = "",
                OrderDetails    = list
            };

            OrderImpl services = new OrderImpl();
            if (services.AddOrderTM(order).Code == 0)
            {
                MessageBox.Show("成功", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                btnCancel_Click(null, null);
            }
            else
            {
                MessageBox.Show("失败", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
            }
        }
예제 #6
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            #region 检测输入
            if (cbxCustomer.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }
            if (comboBox1.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择连肖类型");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtCode.Text))
            {
                MessageEx.ShowWarning("请输入组合代码");
                txtCode.Text = "";
                txtCode.Focus();
                return;
            }
            else
            {
                if (comboBox1.SelectedIndex == 1)
                {
                    MinCount = 1;
                    if (txtCode.Text.Trim().Length != 1 && checkBox1.Checked == false)
                    {
                        MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                        txtCode.Focus();
                        return;
                    }
                }
                if (comboBox1.SelectedIndex == 2)
                {
                    MinCount = 2;
                    if (txtCode.Text.Trim().Length != 2 && checkBox1.Checked == false)
                    {
                        MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                        txtCode.Focus();
                        return;
                    }
                }

                if (comboBox1.SelectedIndex == 3)
                {
                    MinCount = 3;
                    if (txtCode.Text.Trim().Length != 3 && checkBox1.Checked == false)
                    {
                        MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                        txtCode.Focus();
                        return;
                    }
                }

                if (comboBox1.SelectedIndex == 4)
                {
                    MinCount = 4;
                    if (txtCode.Text.Trim().Length != 4 && checkBox1.Checked == false)
                    {
                        MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                        txtCode.Focus();
                        return;
                    }
                }

                if (comboBox1.SelectedIndex == 5)
                {
                    MinCount = 5;
                    if (txtCode.Text.Trim().Length != 5 && checkBox1.Checked == false)
                    {
                        MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                        txtCode.Focus();
                        return;
                    }
                }

                bool flag = true;

                foreach (var itemss in txtCode.Text.Trim())
                {
                    if (!charList.Contains(itemss.ToString()))
                    {
                        flag = false;
                        break;
                    }
                }
                if (!flag)
                {
                    MessageEx.ShowWarning("您输入的组合代码不符合规则,请重新输入");
                    txtCode.Focus();
                    return;
                }
            }


            if (string.IsNullOrWhiteSpace(txtMoney.Text))
            {
                MessageEx.ShowWarning("請輸入金額!");
                txtMoney.Focus();
                return;
            }
            #endregion

            if (checkBox1.Checked == false)
            {
                #region 非复试
                var detail = new OrderLXLM();
                detail.Id     = Guid.NewGuid().ToString("n");
                detail.Status = (int)ResultStatus.Wait;
                detail.Sort   = listView1.Items.Count + 1;

                detail.InMoney = Convert.ToDecimal(txtMoney.Text);


                var item = new ListViewItem();
                item.UseItemStyleForSubItems = false;
                item.SubItems[0].Text        = (listView1.Items.Count + 1).ToString();
                string str       = "";
                int    charIndex = 0;
                foreach (var itemss in txtCode.Text.Trim())
                {
                    string sd = itemss.ToString().Replace("1", "鼠").Replace("2", "牛").Replace("3", "虎")
                                .Replace("Q", "兔").Replace("q", "兔")
                                .Replace("W", "龙").Replace("w", "龙")
                                .Replace("E", "蛇").Replace("e", "蛇")
                                .Replace("A", "马").Replace("a", "马")
                                .Replace("S", "羊").Replace("s", "羊")
                                .Replace("D", "猴").Replace("d", "猴")
                                .Replace("Z", "鸡").Replace("z", "鸡")
                                .Replace("X", "狗").Replace("x", "狗")
                                .Replace("C", "猪").Replace("c", "猪");
                    var code = zodiacArray.First(x => x.Value == sd).Key;
                    tempList.Add(code);

                    str += sd + "、";
                    switch (charIndex)
                    {
                    case 0:
                        detail.Code1   = code.ToString();
                        detail.Zodiac1 = sd;
                        break;

                    case 1:
                        detail.Code2   = code.ToString();
                        detail.Zodiac2 = sd;
                        break;

                    case 2:
                        detail.Code3   = code.ToString();
                        detail.Zodiac3 = sd;
                        break;

                    case 3:
                        detail.Code4   = code.ToString();
                        detail.Zodiac4 = sd;
                        break;

                    case 4:
                        detail.Code5   = code.ToString();
                        detail.Zodiac5 = sd;
                        break;
                    }

                    charIndex = charIndex + 1;
                }
                detail.ChildType = comboBox1.SelectedValue.ToTryInt();
                detail.Odds      = GetMinOdds(odds.List, tempList);
                detail.OutMoney  = detail.InMoney * detail.Odds;
                str            = str.Substring(0, str.Length - 1);
                detail.Remarks = str;
                orderDetails.Add(detail);
                item.SubItems.Add(str);

                item.SubItems.Add(detail.Odds.ToMoney());
                item.SubItems.Add(txtMoney.Text.Trim());
                listView1.Items.Insert(0, item);
                tempList.Clear();
                txtCode.Text = "";
                txtCode.Focus();
                #endregion
            }
            else
            {
                var ttt = new List <OrderLXLM>();

                foreach (var itemss in txtCode.Text.Trim())
                {
                    string sd = itemss.ToString().Replace("1", "鼠").Replace("2", "牛").Replace("3", "虎")
                                .Replace("Q", "兔").Replace("q", "兔")
                                .Replace("W", "龙").Replace("w", "龙")
                                .Replace("E", "蛇").Replace("e", "蛇")
                                .Replace("A", "马").Replace("a", "马")
                                .Replace("S", "羊").Replace("s", "羊")
                                .Replace("D", "猴").Replace("d", "猴")
                                .Replace("Z", "鸡").Replace("z", "鸡")
                                .Replace("X", "狗").Replace("x", "狗")
                                .Replace("C", "猪").Replace("c", "猪");
                    var code = zodiacArray.First(x => x.Value == sd).Key;
                    tempList.Add(code);
                }
                //需要组合的号码
                List <int> InCombinationList = new List <int>();
                foreach (var item in tempList)
                {
                    InCombinationList.Add(item);
                }

                //生成号码组合
                List <int[]> ListCombination = PermutationAndCombination <int> .GetCombination(InCombinationList.ToArray(), MinCount); //求全部的3-3组合

                //根据号码组合创建订单明细
                int index = 1;
                foreach (int[] arr in ListCombination)
                {
                    OrderLXLM detail     = new OrderLXLM();
                    int       childIndex = 0;
                    var       str        = "";
                    foreach (int item in arr)
                    {
                        switch (childIndex)
                        {
                        case 0:
                            detail.Code1   = item.ToString();
                            detail.Zodiac1 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 1:
                            detail.Code2   = item.ToString();
                            detail.Zodiac2 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 2:
                            detail.Code3   = item.ToString();
                            detail.Zodiac3 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 3:
                            detail.Code4   = item.ToString();
                            detail.Zodiac4 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 4:
                            detail.Code5   = item.ToString();
                            detail.Zodiac5 = ServiceNum.GetNumZodiac(item);
                            break;
                        }

                        str       += ServiceNum.GetNumZodiac(item) + "、";
                        childIndex = childIndex + 1;
                    }
                    detail.Id        = Guid.NewGuid().ToString("n");
                    detail.Sort      = listView1.Items.Count + index;
                    detail.ChildType = comboBox1.SelectedValue.ToTryInt();
                    detail.Remarks   = str.Remove(str.Length - 1, 1);

                    detail.Odds     = GetMinOdds(odds.List, arr.ToList());
                    detail.InMoney  = Convert.ToDecimal(txtMoney.Text);
                    detail.OutMoney = detail.InMoney * detail.Odds;
                    detail.Status   = (int)ResultStatus.Wait;
                    detail.Flag     = 1;

                    ttt.Add(detail);
                    index = index + 1;
                }

                ttt.ForEach(x =>
                {
                    orderDetails.Add(x);
                    var lvitem = new ListViewItem();
                    lvitem.UseItemStyleForSubItems = false;
                    lvitem.SubItems[0].Text        = (listView1.Items.Count + 1).ToString();
                    lvitem.SubItems.Add(x.Remarks);

                    lvitem.SubItems.Add(x.Odds.ToMoney());
                    lvitem.SubItems.Add(txtMoney.Text.Trim());
                    listView1.Items.Insert(0, lvitem);
                });
                tempList.Clear();
                txtCode.Text = "";
                txtCode.Focus();
            }
        }
예제 #7
0
        private void btnOK_ws_Click(object sender, EventArgs e)
        {
            var container    = this.tabControl1.TabPages[tabControl1.SelectedIndex];
            var controls_txt = container.Controls.Find("TXT", false);

            #region 检测输入

            if (this.cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIssue.Text))
            {
                MessageEx.ShowWarning("请输入期号");
                return;
            }
            if (txtIssue.Text.Trim().Length != 7)
            {
                MessageEx.ShowWarning("请输入正确的期号");
                return;
            }
            var flag = false;
            foreach (var control in controls_txt)
            {
                if (control is TextBox)
                {
                    var c = control as TextBox;
                    if (!string.IsNullOrWhiteSpace(c.Text))
                    {
                        flag = true;
                    }
                }
            }
            if (flag == false)
            {
                MessageEx.ShowWarning("请输入内容,内容不能为空");
                return;
            }


            #endregion


            var OrderId = Guid.NewGuid().ToString("n");
            var list    = new List <OrderTM>();
            var index   = 1;
            foreach (var control in controls_txt)
            {
                if (control is TextBox)
                {
                    var c = control as TextBox;
                    if (!string.IsNullOrWhiteSpace(c.Text))
                    {
                        OrderTM O = new OrderTM();
                        O.Id        = Guid.NewGuid().ToString("N");
                        O.OrderId   = OrderId;
                        O.InMoney   = Convert.ToDecimal(c.Text);
                        O.Status    = (int)ResultStatus.Wait;
                        O.ChildType = (int)ChildType.尾数;
                        O.Sort      = index;
                        var Code = container.Controls.Find("Code", false).FirstOrDefault(x => x.Tag == c.Tag);
                        if (Code != null)
                        {
                            var lbCode = Code as Label;
                            O.Code    = lbCode.Tag.ToString();
                            O.Remarks = O.Code;
                        }
                        else
                        {
                            continue;
                        }

                        var PL = container.Controls.Find("PL", false).FirstOrDefault(x => x.Tag == c.Tag);
                        if (PL != null)
                        {
                            var lbPL = PL as Label;
                            O.Odds = Convert.ToDecimal(lbPL.Text);
                        }
                        else
                        {
                            continue;
                        }
                        O.OutMoney = O.Odds * O.InMoney;
                        list.Add(O);
                        index = index + 1;
                    }
                }
            }
            var order = new Order <OrderTM>()
            {
                Create_Time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id  = "0",
                Customer_Id     = cbox.SelectedValue.ToString().ToTryInt(),
                Id              = OrderId,
                IsDel           = 0,
                Issue           = txtIssue.Text.Trim(),
                Order_No        = ServiceNum.GetOrderNo(),
                Order_Type      = (int)OrderType.尾数,
                Child_Type      = (int)ChildType.尾数,
                Total_In_Money  = list.Sum(x => x.InMoney),
                Total_Out_Money = 0,
                Update_Time     = "",
                Update_User_Id  = "",
                OrderDetails    = list
            };

            OrderImpl services = new OrderImpl();
            if (services.AddOrderTM(order).Code == 0)
            {
                MessageEx.Show("成功");
                btnReset_Click(sender, e);
            }
            else
            {
                MessageEx.ShowWarning("失败");
            }
        }
예제 #8
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            #region 检测输入
            if (this.cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIssue.Text))
            {
                MessageEx.ShowWarning("请输入期号");
                return;
            }
            if (txtIssue.Text.Trim().Length != 7)
            {
                MessageEx.ShowWarning("请输入正确的期号");
                return;
            }

            #endregion

            #region 获取输入

            bool flag = false;
            foreach (var control in this.groupBox2.Controls)
            {
                if (control is TextBox)
                {
                    var c = control as TextBox;
                    if (!string.IsNullOrWhiteSpace(c.Text))
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                MessageEx.ShowWarning("请输入号码的金额");
                return;
            }
            #endregion


            var OrderId = Guid.NewGuid().ToString("n");
            var list    = new List <OrderTM>();
            var index   = 0;
            foreach (var control in this.groupBox2.Controls)
            {
                if (control is TextBox)
                {
                    var c = control as TextBox;
                    if (!string.IsNullOrWhiteSpace(c.Text))
                    {
                        OrderTM O = new OrderTM();
                        O.Id        = Guid.NewGuid().ToString("N");
                        O.OrderId   = OrderId;
                        O.InMoney   = Convert.ToDecimal(c.Text);
                        O.ChildType = (int)ChildType.特码;


                        O.Flag = 1;

                        O.Status = (int)ResultStatus.Wait;

                        var Code = this.groupBox2.Controls.Find("Code", false).FirstOrDefault(x => x.Tag == c.Tag);
                        if (Code != null)
                        {
                            var lbCode = Code as Label;
                            O.Code = lbCode.Text;
                            index  = index + 1;
                        }
                        else
                        {
                            continue;
                        }
                        O.Remarks = O.Code;
                        O.Sort    = index;
                        var PL = this.groupBox2.Controls.Find("PL", false).FirstOrDefault(x => x.Tag == c.Tag);
                        if (PL != null)
                        {
                            var lbPL = PL as Label;
                            O.Odds = Convert.ToDecimal(lbPL.Text);
                        }
                        else
                        {
                            continue;
                        }
                        O.OutMoney = O.Odds * O.InMoney;
                        list.Add(O);
                    }
                }
            }
            var order = new Order <OrderTM>()
            {
                Create_Time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id  = "0",
                Customer_Id     = cbox.SelectedValue.ToString().ToTryInt(),
                Id              = OrderId,
                IsDel           = 0,
                Issue           = txtIssue.Text.Trim(),
                Order_No        = ServiceNum.GetOrderNo(),
                Order_Type      = (int)OrderType.特码,
                Child_Type      = (int)ChildType.特码,
                Total_In_Money  = list.Sum(x => x.InMoney),
                Total_Out_Money = 0,
                Update_Time     = "",
                Update_User_Id  = "",
                OrderDetails    = list
            };

            Frm.fmConfirmLX fmConfigm = new fmConfirmLX();
            fmConfigm.InitForm(order);
            if (fmConfigm.ShowDialog() == DialogResult.OK)
            {
                OrderImpl services = new OrderImpl();
                if (services.AddOrderTM(order).Code == 0)
                {
                    MessageBox.Show("成功", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                    btnReset_Click(sender, e);
                }
                else
                {
                    MessageBox.Show("失败", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                }
            }
        }
예제 #9
0
파일: fmQBZ.cs 프로젝트: tanzw/six
        private void btnOK_Click(object sender, EventArgs e)
        {
            List <CodeNum> numlist = Well.Data.ServiceNum.GetNumsArray();

            #region 检测输入
            if (this.cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIssue.Text))
            {
                MessageEx.ShowWarning("请输入期号");
                return;
            }
            if (txtIssue.Text.Trim().Length != 7)
            {
                MessageEx.ShowWarning("请输入正确的期号");
                return;
            }
            if (string.IsNullOrWhiteSpace(txtMoney.Text.Trim()))
            {
                MessageEx.ShowWarning("请输入金额");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode1.Text) && numlist.Count(x => x.Value == txtCode1.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode2.Text) && numlist.Count(x => x.Value == txtCode2.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode3.Text) && numlist.Count(x => x.Value == txtCode3.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode4.Text) && numlist.Count(x => x.Value == txtCode4.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode5.Text) && numlist.Count(x => x.Value == txtCode5.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode6.Text) && numlist.Count(x => x.Value == txtCode6.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode7.Text) && numlist.Count(x => x.Value == txtCode7.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode8.Text) && numlist.Count(x => x.Value == txtCode8.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode9.Text) && numlist.Count(x => x.Value == txtCode9.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }
            if (!string.IsNullOrWhiteSpace(txtCode10.Text) && numlist.Count(x => x.Value == txtCode10.Text.Trim()) == 0)
            {
                MessageEx.ShowWarning("号码不符合规则,请重新输入");
                return;
            }

            #endregion
            string         OrderId = Guid.NewGuid().ToString("n");
            List <OrderTM> list    = new List <OrderTM>();
            string         str     = "";
            int            count   = 0;
            foreach (var item in this.panel1.Controls)
            {
                if (item is TextBox)
                {
                    var cc = item as TextBox;
                    if (!string.IsNullOrWhiteSpace(cc.Text))
                    {
                        str  += cc.Text.Trim() + "、";
                        count = count + 1;
                    }
                }
            }
            if (str.Length > 0)
            {
                str = str.Substring(0, str.Length - 1);
            }
            if (count < 5)
            {
                MessageEx.ShowWarning("输入号码最少5个");
                return;
            }

            var odds = oddsList.FirstOrDefault(x => x.ChildType == GetChildType(count));
            if (odds == null)
            {
                MessageEx.ShowWarning("未设置客户赔率");
                return;
            }
            var detail = new OrderTM();
            detail.ChildType = GetChildType(count);
            detail.Code      = str;
            detail.Flag      = 1;
            detail.Id        = Guid.NewGuid().ToString("n");
            detail.InMoney   = Convert.ToDecimal(txtMoney.Text.Trim());
            detail.Odds      = odds.PL;
            detail.OrderId   = OrderId;
            detail.OutMoney  = detail.Odds * detail.InMoney;
            detail.Remarks   = detail.Code;
            detail.Sort      = 1;
            detail.Status    = (int)ResultStatus.Wait;
            list.Add(detail);



            Order <OrderTM> order = new Order <OrderTM>()
            {
                Create_Time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id  = "0",
                Customer_Id     = cbox.SelectedValue.ToString().ToTryInt(),
                Id              = OrderId,
                IsDel           = 0,
                Issue           = txtIssue.Text.Trim(),
                Order_No        = ServiceNum.GetOrderNo(),
                Order_Type      = (int)OrderType.全不中,
                Total_In_Money  = list.Sum(x => x.InMoney),
                Total_Out_Money = 0,
                Update_Time     = "",
                Update_User_Id  = "",
                OrderDetails    = list
            };

            OrderImpl services = new OrderImpl();
            if (services.AddOrderTM(order).Code == 0)
            {
                MessageBox.Show("成功", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
                btnCancel_Click(null, null);
            }
            else
            {
                MessageBox.Show("失败", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.None);
            }
        }
예제 #10
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            var v         = 0;
            var childtype = 0;
            var pl        = 0M;

            if (radioButton5.Checked)
            {
                v         = 3;
                childtype = (int)ChildType.中三;
                pl        = Convert.ToDecimal(lbSZS.Text);
            }
            if (radioButton6.Checked)
            {
                v         = 3;
                childtype = (int)ChildType.全中;
                pl        = Convert.ToDecimal(lbSQZ.Text);
            }
            if (radioButton7.Checked)
            {
                v         = 2;
                childtype = (int)ChildType.二全中;
                pl        = Convert.ToDecimal(lbEZE.Text);
            }
            if (radioButton8.Checked)
            {
                v         = 2;
                childtype = (int)ChildType.特碰;
                pl        = Convert.ToDecimal(lbTP.Text);
            }

            //需要组合的号码
            List <string> InCombinationList = new List <string>();

            #region  获取输入
            var controls = this.groupBox3.Controls.Find("CK", false);
            var r        = 0;
            foreach (var control in controls)
            {
                if (control is CheckBox)
                {
                    var ck = control as CheckBox;
                    if (ck.Checked)
                    {
                        r += 1;
                        var sd = this.groupBox3.Controls.Find("Code", false);
                        var lb = sd.FirstOrDefault(x => x.Tag == ck.Tag);
                        if (lb != null)
                        {
                            var lbCode = lb as Label;
                            InCombinationList.Add(lbCode.Text);
                        }
                    }
                }
            }
            #endregion

            #region 检测输入

            if (!radioButton5.Checked && !radioButton6.Checked && !radioButton7.Checked && !radioButton8.Checked)
            {
                MessageEx.ShowWarning("请选择连码类型");
                return;
            }

            if (cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtMoney.Text))
            {
                MessageEx.ShowWarning("请输入金额");
                return;
            }

            if (r < v)
            {
                MessageEx.ShowWarning("内容不正确,请重新选择");
                return;
            }

            #endregion



            Frm.fmConfirmLX fm = new Frm.fmConfirmLX();

            #region 创建订单对象
            string OrderId = Guid.NewGuid().ToString("n");

            //订单主体
            var order = new Order <OrderLXLM>()
            {
                Create_Time    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                Create_User_Id = "0",
                Customer_Id    = cbox.SelectedValue.ToString().ToTryInt(),
                Id             = OrderId,
                IsDel          = 0,
                Issue          = txtIssue.Text.Trim(),
                Order_No       = ServiceNum.GetOrderNo(),
                Order_Type     = (int)OrderType.连码,
                Child_Type     = childtype,
                Update_Time    = "",
                Update_User_Id = ""
            };

            //生成号码组合
            List <string[]> ListCombination = PermutationAndCombination <string> .GetCombination(InCombinationList.ToArray(), v); //求全部的3-3组合

            //根据号码组合创建订单明细
            int index = 1;
            foreach (string[] arr in ListCombination)
            {
                OrderLXLM detail     = new OrderLXLM();
                int       childIndex = 0;
                var       str        = "";
                foreach (string item in arr)
                {
                    switch (childIndex)
                    {
                    case 0:
                        detail.Code1 = item.ToString();
                        break;

                    case 1:
                        detail.Code2 = item.ToString();
                        break;

                    case 2:
                        detail.Code3 = item.ToString();
                        break;

                    case 3:
                        detail.Code4 = item.ToString();
                        break;
                    }

                    str       += item + "、";
                    childIndex = childIndex + 1;
                }
                detail.Id        = Guid.NewGuid().ToString("n");
                detail.Sort      = index;
                detail.Remarks   = str.Remove(str.Length - 1, 1);
                detail.OrderId   = OrderId;
                detail.Odds      = pl;
                detail.ChildType = childtype;
                detail.InMoney   = Convert.ToDecimal(txtMoney.Text);
                detail.OutMoney  = detail.InMoney * detail.Odds;
                if (childtype == (int)ChildType.中三)
                {
                    detail.MinOdds     = Convert.ToDecimal(lbSZE.Text);
                    detail.MinOutMoney = detail.InMoney * detail.MinOdds;
                    detail.MaxOdds     = pl;
                    detail.MaxOutMoney = detail.InMoney * detail.MaxOdds;
                }
                detail.Status = (int)ResultStatus.Wait;
                detail.Flag   = 1;
                order.OrderDetails.Add(detail);
                index = index + 1;
            }

            order.Total_In_Money  = order.OrderDetails.Sum(x => x.InMoney);
            order.Total_Out_Money = 0.00M;
            #endregion

            fm.InitForm(order);

            if (fm.ShowDialog() == DialogResult.OK)
            {
                OrderImpl service = new OrderImpl();
                if (service.AddOrderLXLM(order).Code == 0)
                {
                    MessageEx.Show("下单成功");
                }
                else
                {
                    MessageEx.Show("下单失败");
                }
            }
        }
예제 #11
0
파일: fmDXDS.cs 프로젝트: tanzw/six
        private void InitControls()
        {
            var result = ServiceNum.GetColorArray();

            var red   = Color.Red;
            var blue  = Color.Blue;
            var green = Color.LimeGreen;

            result.Remove(49);

            #region 特大

            var list  = result.Where(x => x.Key > 24);
            var xInn  = 23;
            int index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 26);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }

            #endregion

            #region 特小

            list  = result.Where(x => x.Key < 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 48);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }

            #endregion

            #region 特单

            list  = result.Where(x => x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 70);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region  特双
            list  = result.Where(x => x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 92);
                //lb.Location = new Point(448 + xInn * index, 26);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 特大单
            list  = result.Where(x => x.Key > 24 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 114);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region  特小单
            list  = result.Where(x => x.Key <= 24 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 136);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region  特大双
            list  = result.Where(x => x.Key > 24 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 158);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion


            #region  特小双
            list  = result.Where(x => x.Key <= 24 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 180);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion



            #region 合大


            list = result;
            var num = 0;
            var sum = 0;
            index = 0;
            var hxIndex  = 0;
            var hdIndex  = 0;
            var hsIndex  = 0;
            var hddIndex = 0;
            var hxdIndex = 0;
            var hdsIndex = 0;
            var hxsIndex = 0;

            for (int i = 1; i <= 48; i++)
            {
                num = i;
                while (num > 0)
                {
                    sum += num % 10; //每次的余数都是末尾的数字
                    num /= 10;       //因为是INT型的所以等于直接去掉最后的数字.
                }

                if (sum > 6)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * index, 26);
                    this.groupBox3.Controls.Add(lb);
                    index = index + 1;
                }
                if (sum <= 6)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hxIndex, 48);
                    this.groupBox3.Controls.Add(lb);
                    hxIndex = hxIndex + 1;
                }
                if (sum % 2 != 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hdIndex, 70);
                    this.groupBox3.Controls.Add(lb);
                    hdIndex = hdIndex + 1;
                }
                if (sum % 2 == 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hsIndex, 92);
                    this.groupBox3.Controls.Add(lb);
                    hsIndex = hsIndex + 1;
                }

                if (sum > 6 && sum % 2 != 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hddIndex, 114);
                    this.groupBox3.Controls.Add(lb);
                    hddIndex = hddIndex + 1;
                }
                else if (sum > 6 && sum % 2 == 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hdsIndex, 136);
                    this.groupBox3.Controls.Add(lb);
                    hdsIndex = hdsIndex + 1;
                }
                else if (sum <= 6 && sum % 2 != 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hxdIndex, 158);
                    this.groupBox3.Controls.Add(lb);
                    hxdIndex = hxdIndex + 1;
                }
                else if (sum <= 6 && sum % 2 == 0)
                {
                    Label lb = new Label();
                    lb.Text      = i.ToString().PadLeft(2, '0');
                    lb.BackColor = list.FirstOrDefault(x => x.Key == i).Value;
                    lb.Width     = 19;
                    lb.Height    = 12;
                    lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                    lb.Location  = new Point(151 + xInn * hxsIndex, 180);
                    this.groupBox3.Controls.Add(lb);
                    hxsIndex = hxsIndex + 1;
                }
                sum = 0;
                num = 0;
            }

            index = 0;

            #endregion
        }
예제 #12
0
파일: ULX.cs 프로젝트: tanzw/six
        public void btnOK_Click(object sender, EventArgs e)
        {
            #region 检测输入
            if (this.cbox.SelectedIndex == 0)
            {
                MessageEx.ShowWarning("请选择客户");
                return;
            }

            if (string.IsNullOrWhiteSpace(this.txtMoney.Text))
            {
                MessageEx.ShowWarning("请输入单注金额");
                return;
            }

            if (string.IsNullOrWhiteSpace(txtIssue.Text))
            {
                MessageEx.ShowWarning("请输入期号");
                return;
            }
            if (txtIssue.Text.Trim().Length != 7)
            {
                MessageEx.ShowWarning("请输入正确的期号");
                return;
            }

            #endregion

            #region 获取输入
            Dictionary <int, decimal> list = new Dictionary <int, decimal>();
            foreach (var control in this.groupBox2.Controls)
            {
                if (control is CheckBox)
                {
                    var ck = control as CheckBox;
                    if (ck.Checked)
                    {
                        var sdsdsdsd = this.groupBox2.Controls.Find("PL", false);
                        var lb       = this.groupBox2.Controls.Find("PL", false).FirstOrDefault(x => x.Tag == ck.Tag);
                        if (lb != null)
                        {
                            var l = lb as Label;
                            list.Add(ck.Tag.ToTryInt(), Convert.ToDecimal(l.Text));
                        }
                    }
                }
            }
            #endregion

            if (list.Count < MinCount)
            {
                MessageEx.ShowWarning("内容不正确,请重新下注");
            }
            else
            {
                Frm.fmConfirmLX fm = new Frm.fmConfirmLX();

                #region 创建订单对象
                string OrderId = Guid.NewGuid().ToString("n");

                //订单主体
                var order = new Order <OrderLXLM>()
                {
                    Create_Time    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    Create_User_Id = "0",
                    Customer_Id    = cbox.SelectedValue.ToString().ToTryInt(),
                    Id             = OrderId,
                    IsDel          = 0,
                    Issue          = txtIssue.Text.Trim(),
                    Order_No       = ServiceNum.GetOrderNo(),
                    Order_Type     = OrderType,
                    Child_Type     = ChildType,
                    Update_Time    = "",
                    Update_User_Id = ""
                };

                //需要组合的号码
                List <int> InCombinationList = new List <int>();
                foreach (var item in list)
                {
                    InCombinationList.Add(item.Key);
                }

                //生成号码组合
                List <int[]> ListCombination = PermutationAndCombination <int> .GetCombination(InCombinationList.ToArray(), MinCount); //求全部的3-3组合

                //根据号码组合创建订单明细
                int index = 1;
                foreach (int[] arr in ListCombination)
                {
                    OrderLXLM detail     = new OrderLXLM();
                    int       childIndex = 0;
                    var       str        = "";
                    foreach (int item in arr)
                    {
                        switch (childIndex)
                        {
                        case 0:
                            detail.Code1   = item.ToString();
                            detail.Zodiac1 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 1:
                            detail.Code2   = item.ToString();
                            detail.Zodiac2 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 2:
                            detail.Code3   = item.ToString();
                            detail.Zodiac3 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 3:
                            detail.Code4   = item.ToString();
                            detail.Zodiac4 = ServiceNum.GetNumZodiac(item);
                            break;

                        case 4:
                            detail.Code5   = item.ToString();
                            detail.Zodiac5 = ServiceNum.GetNumZodiac(item);
                            break;
                        }

                        str       += ServiceNum.GetNumZodiac(item) + "、";
                        childIndex = childIndex + 1;
                    }
                    detail.Id        = Guid.NewGuid().ToString("n");
                    detail.Sort      = index;
                    detail.ChildType = ChildType;
                    detail.Remarks   = str.Remove(str.Length - 1, 1);
                    detail.OrderId   = OrderId;
                    detail.Odds      = GetMinOdds(list, arr.ToList());
                    detail.InMoney   = Convert.ToDecimal(txtMoney.Text);
                    detail.OutMoney  = detail.InMoney * detail.Odds;
                    detail.Status    = (int)ResultStatus.Wait;
                    detail.Flag      = 1;
                    order.OrderDetails.Add(detail);
                    index = index + 1;
                }

                order.Total_In_Money  = order.OrderDetails.Sum(x => x.InMoney);
                order.Total_Out_Money = 0.00M;
                #endregion

                fm.InitForm(order);

                if (fm.ShowDialog() == DialogResult.OK)
                {
                    OrderImpl service = new OrderImpl();
                    if (service.AddOrderLXLM(order).Code == 0)
                    {
                        MessageEx.Show("下单成功");
                        btnReset_Click(null, null);
                    }
                    else
                    {
                        MessageEx.Show("下单失败");
                    }
                }
            }
        }
예제 #13
0
파일: fmMain.cs 프로젝트: tanzw/six
 private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var sd = ServiceNum.GetIssue();
 }
예제 #14
0
        private void InitControls()
        {
            var result = ServiceNum.GetColorArray();

            var red   = Color.Red;
            var blue  = Color.Blue;
            var green = Color.LimeGreen;

            #region 红波

            var list  = result.Where(x => x.Value == red);
            var xInn  = 23;
            int index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 26);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }

            #endregion

            #region 蓝波

            list  = result.Where(x => x.Value == blue);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 48);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }

            #endregion

            #region 绿波

            list  = result.Where(x => x.Value == green);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 70);
                this.groupBox2.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--红大
            list  = result.Where(x => x.Value == red && x.Key > 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 26);
                //lb.Location = new Point(448 + xInn * index, 26);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--红小
            list  = result.Where(x => x.Value == red && x.Key <= 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 26);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--红单
            list  = result.Where(x => x.Value == red && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 48);
                //lb.Location = new Point(448 + xInn * index, 26);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--红双
            list  = result.Where(x => x.Value == red && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 48);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion


            #region 半波--蓝大
            list  = result.Where(x => x.Value == blue && x.Key > 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 70);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--蓝小
            list  = result.Where(x => x.Value == blue && x.Key <= 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 70);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--蓝单
            list  = result.Where(x => x.Value == blue && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 92);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--蓝双
            list  = result.Where(x => x.Value == blue && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 92);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--绿大
            list  = result.Where(x => x.Value == green && x.Key > 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 114);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--绿小
            list  = result.Where(x => x.Value == green && x.Key <= 25);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 114);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--绿单
            list  = result.Where(x => x.Value == green && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 136);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半波--绿双
            list  = result.Where(x => x.Value == green && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 136);
                this.groupBox3.Controls.Add(lb);
                index = index + 1;
            }
            #endregion


            #region 半半波--红大单
            list  = result.Where(x => x.Value == red && x.Key > 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 26);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--红大双
            list  = result.Where(x => x.Value == red && x.Key > 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 26);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--红小单
            list  = result.Where(x => x.Value == red && x.Key <= 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 48);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--红小双
            list  = result.Where(x => x.Value == red && x.Key <= 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 48);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--蓝大单
            list  = result.Where(x => x.Value == blue && x.Key > 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 70);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--蓝大双
            list  = result.Where(x => x.Value == blue && x.Key > 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 70);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--蓝小单
            list  = result.Where(x => x.Value == blue && x.Key <= 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 92);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--蓝小双
            list  = result.Where(x => x.Value == blue && x.Key <= 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 92);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--绿大单
            list  = result.Where(x => x.Value == green && x.Key > 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 114);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--绿大双
            list  = result.Where(x => x.Value == green && x.Key > 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 114);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--绿小单
            list  = result.Where(x => x.Value == green && x.Key <= 25 && x.Key % 2 != 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(151 + xInn * index, 136);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion

            #region 半半波--绿小双
            list  = result.Where(x => x.Value == green && x.Key <= 25 && x.Key % 2 == 0);
            index = 0;
            foreach (var item in list)
            {
                Label lb = new Label();
                lb.Text      = item.Key.ToString().PadLeft(2, '0');
                lb.BackColor = item.Value;
                lb.Width     = 19;
                lb.Height    = 12;
                lb.Font      = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                lb.Location  = new Point(496 + xInn * index, 136);
                this.groupBox4.Controls.Add(lb);
                index = index + 1;
            }
            #endregion
        }