//查询单头单身 protected void search(object sender, EventArgs e) { try { string Invoice_no = DropDownList_invoice_no.SelectedValue.ToString(); string first_time = "2016-07-01 00:00:00"; DateTime start_time = Convert.ToDateTime(first_time); DateTime end_time = DateTime.Now; if (Invoice_no == "--选择退料单号--") { Invoice_no = ""; } ReturnHeaderReater.DataSource = invoiceDC.getReturnHeaderBySome(Invoice_no, "", ""); ReturnLineReater.DataSource = invoiceDC.getReturnLineBySome(Invoice_no, "", "", start_time, end_time); if (ReturnHeaderReater.DataSource == null) { PageUtil.showToast(this, "无相关退料单头信息"); } ReturnHeaderReater.DataBind(); if (ReturnLineReater.DataSource == null) { PageUtil.showToast(this, "无相关退料单身信息"); } ReturnLineReater.DataBind(); } catch (Exception e1) { PageUtil.showToast(this, "查询失败"); } }
//显示打印页面中的所有数据 protected void DataView() { InvoiceDC invoiceDC = new InvoiceDC(); try { //绑定其他数据 DataSet dataset_header = new DataSet(); dataset_header = invoiceDC.getReturnHeaderBySome(select_text.Value, "", ""); flex_value.Value = dataset_header.Tables[0].Rows[0]["flex_value"].ToString(); description.Value = dataset_header.Tables[0].Rows[0]["description"].ToString(); remark.Value = dataset_header.Tables[0].Rows[0]["remark"].ToString(); return_type.Value = dataset_header.Tables[0].Rows[0]["return_type"].ToString(); status.Value = dataset_header.Tables[0].Rows[0]["status"].ToString(); //绑定Repeater中数据 DataSet dataset_line = new DataSet(); dataset_line = invoiceDC.getReturnLineBySome(select_text.Value, "", "", Convert.ToDateTime("2016-07-01 00:00:00"), DateTime.Now); printMaterialReturningRepeater.DataSource = dataset_line; printMaterialReturningRepeater.DataBind(); } catch (Exception e) { PageUtil.showToast(this, "数据库中没有对应数据,请重新输入领料单号"); } }
protected void Select(object sender, EventArgs e) { try { //string Invoice_no = DropDownList_invoice_no.SelectedValue.ToString(); //string Item_name = DropDownList_item_name.SelectedValue.ToString(); string Invoice_no = invoice_no.Value; string Item_name = item_name.Value; string Return_type = Request.Form["return_type"]; //if (Invoice_no == "--选择退料单号--") // Invoice_no = ""; //if (Item_name == "--选择料号--") // Item_name = ""; string FIRST_TIME = inpend.Value; if (FIRST_TIME == "") { FIRST_TIME = "2016-07-01 00:00:00"; } start_time = Convert.ToDateTime(FIRST_TIME); string LAST_TIME = inpstart.Value; end_time = Convert.ToDateTime(LAST_TIME); GridView_header.DataSource = invoiceDC.getReturnHeaderBySome(Invoice_no, Return_type, ""); GridView_line.DataSource = invoiceDC.getReturnLineBySome(Invoice_no, Item_name, Return_type, start_time, end_time); if (GridView_header.DataSource == null) { PageUtil.showToast(this, "无相关退料单头信息"); } GridView_header.DataBind(); if (GridView_line.DataSource == null) { PageUtil.showToast(this, "无相关退料单身信息"); } GridView_line.DataBind(); } catch (Exception e1) { PageUtil.showToast(this, "查询失败"); } }