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("投注失敗"); } }
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); } }
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); } } }
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("失败"); } }
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); } }