private void txtPinyin_TextChanged(object sender, System.EventArgs e) { try { if (this.txtPinyin.Text.Equals("")) { return; } //dish.functions.CommValidate cv = new dish.functions.CommValidate(); //string sql = ""; string currentSearchType = ""; DataTable dt = null; if (!Information.IsNumeric(this.txtPinyin.Text)) { if (!this.txtPinyin.Text.Equals("")) { //dt = new MenuManage().GetMenuInfoBySearchCondition(this.txtPinyin.Text); } } else { currentSearchType = "pinyin"; //dt = new MenuManage().GetMenuInfoBySearchCondition(this.txtPinyin.Text, true); } if (dt != null) { this.BindDishCard(dt); } if (!this.dishCards[0].DishName.Equals("") && this.dishCards[1].DishName.Equals("")) { this.DishCards_Click(this.dishCards[0].lblDishName, null); if (this.frmPinyinAndCode == null) { this.frmPinyinAndCode = new frmPinyinAndCode(); } this.frmPinyinAndCode.txtControl.Text = ""; this.txtPinyin.Text = string.Empty; this.txtPinyin.Focus(); } } catch (Exception ex) { MessageBox2.Show(ex.ToString()); LoggerManager.GetILog().Error(ex.StackTrace); } }
private void btnMore_Click(object sender, EventArgs e) { MessageBox2.Show(msgBox.lblMessage.Text, msgBox.Text, MessageBoxButtons.OK); msgBox.Close(); msgBox.Visible = false; }
private void DishCards_Click(object sender, System.EventArgs e) { try { timer1.Enabled = false; int mo_count = 0; Label lbl = (Label)sender; DishCard dc = (DishCard)lbl.Parent.Parent; if (!dc.DishName.Equals("")) { string pos = ""; string mydishname = dc.DishName; if (mydishname.Split(']').Length > 1) { mydishname = dc.DishName.Split(']')[1].Trim(); } int orderId; //if (new OrdersManage().ExistsMenuInDgv(dc.DishId, this.tableOrders.Id, out orderId)) //{ // OrdersEntity orderDish = new SqlServerDbMapper<OrdersEntity>().GetSingleObj(new OrdersEntity { Id = orderId }); // new OrdersManage().ChangeAmount(0, "++", orderDish); // timer1.Enabled = true; // return; // //new OrdersManage().ChangeAmount(amount, psType, this.m_selectOrderDish); // //return; //} if (dc.dispType.Equals("")) { if (dc.isgq == 1) { return; } if (this.dgvOrderDish.SelectedRows.Count > 0) { //selectedOrderdish = (DataRow)dgvOrderDish.SelectedRows[0].Tag; //OrdersEntity orderDish = new OrdersEntity(); //m_selectOrderDish = new OrdersManage().GetOrdersEntitiyById(Convert.ToInt32(selectedOrderdish["Id"])); //if ((DataRow)dgvOrderDish.SelectedRows[0].Tag != null) //{ // if (dc.DishId == m_selectOrderDish.Menu_Id) // { // this.ChangeAmount(0, "++"); // timer1.Enabled = true; // return; // } //} } OrdersCls orderdish = new OrdersCls(); orderdish.MenuName = mydishname; orderdish.Amount = 1; orderdish.Menu_Id = dc.DishId; orderdish.Price = Convert.ToSingle(dc.Price.Split('/')[0]); orderdish.Status = 0; // "即上"; orderdish.TableOrders_Id = this.tableOrders.Table_Id; orderdish.UnitName = Convert.ToString(dc.Price.Split('/')[1]); //this.AddNewDish(orderdish, 0); //this.updateOrdersPages(); //mo_count = new PriceManage().GetDishPriceCountByMenuId(dc.DishId); //SetCCOrderDishInfo(); } } } catch (Exception ex) { MessageBox2.Show(ex.ToString()); } }