/// <summary> /// 查询按钮点击事件 /// </summary> /// <param name="sender">事件对象</param> /// <param name="e">事件参数</param> private void t_tsb_Query_Click(object sender, RoutedEventArgs e) { try { FrmQuery myForm = new FrmQuery(); myForm.ShowDialog(); m_MQuery = myForm.QueryModel; QueryMethod(); } catch (Exception ex) { XMessageBox.Exception(ex); } }
private void t_btn_Query_Click(object sender, RoutedEventArgs e) { try { MQuery myModel = new MQuery(); switch (t_cmb_Date.SelectedValue.ToString()) { case "当天单据": myModel.DateFilterType = DateFilterTypes.Today; break; case "当周单据": myModel.DateFilterType = DateFilterTypes.Week; break; case "当月单据": myModel.DateFilterType = DateFilterTypes.Month; break; case "所有单据": myModel.DateFilterType = DateFilterTypes.All; break; case "自定义范围": myModel.DateFilterType = DateFilterTypes.Custom; break; } if (t_cmb_Type.SelectedIndex == 0) { myModel.BillType = "Q"; } else { myModel.BillType = "P"; } myModel.BillNo = t_txt_BillNo.Text.Trim(); myModel.StartDate = t_dtp_StartDate.Value; myModel.EndDate = t_dtp_EndDate.Value; myModel.FllowMan = t_txt_FllowMan.Text; myModel.ProjectName = t_txt_ProjectName.Text; myModel.CompanyName = t_txt_CompanyName.Text; ArrayList myList = new ArrayList(); if (t_chk_Save.IsChecked == true) { myList.Add("安全"); } if (t_chk_EMC.IsChecked == true) { myList.Add("EMC"); } if (t_chk_Chemis.IsChecked == true) { myList.Add("化学"); } string[] type = new string[myList.Count]; for (int i = 0; i < myList.Count; i++) { type[i] = myList[i].ToString(); } myModel.Type = type; QueryModel = myModel; this.Close(); } catch (Exception ex) { XMessageBox.Exception(ex); } }