//查询单头单身 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 = ""; ExchangeHeaderReater.DataSource = invoiceDC.getExchangeHeaderBySome(Invoice_no,""); ExchangeLineReater.DataSource = invoiceDC.getExchangeLineBySome(Invoice_no, "", start_time, end_time); if (ExchangeHeaderReater.DataSource == null) { PageUtil.showToast(this, "无相关调拨单头信息"); } ExchangeHeaderReater.DataBind(); if (ExchangeLineReater.DataSource == null) { PageUtil.showToast(this, "无相关调拨单身信息"); } ExchangeLineReater.DataBind(); } catch (Exception e1) { PageUtil.showToast(this, "查询失败"); } }
//显示打印页面中的所有数据 protected void DataView() { InvoiceDC invoiceDC = new InvoiceDC(); try { //绑定其他数据 DataSet dataset_header = new DataSet(); dataset_header = invoiceDC.getExchangeHeaderBySome(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(); create_time.Value = dataset_header.Tables[0].Rows[0]["create_time"].ToString(); create_man.Value = dataset_header.Tables[0].Rows[0]["create_man"].ToString(); //绑定Repeater中数据 DataSet dataset_line = new DataSet(); dataset_line = invoiceDC.getExchangeLineBySome(select_text.Value, "", Convert.ToDateTime("2016-07-01 00:00:00"), DateTime.Now); printTransFerringOrderRepeater.DataSource = dataset_line; printTransFerringOrderRepeater.DataBind(); } catch (Exception e) { PageUtil.showToast(this, "数据库中没有对应数据,请重新输入领料单号"); } }
//调出库别发生改变时 protected void DropDownList_out_subinventory_SelectedIndexChanged(object sender, EventArgs e) { if (invoice_no.Value == "") { PageUtil.showToast(this, "请输入调拨单号再操作"); return; } DataSet ds = invoiceDC.getExchangeHeaderBySome(invoice_no.Value, ""); if (ds == null) { PageUtil.showToast(this, "请确保该调拨单号存在,再操作"); return; } //调出库别与料号的二级联动 try { DropDownList_item_name.Items.Clear(); int text = int.Parse(DropDownList_out_subinventory.SelectedValue.ToString()); DataSet ds_item_name = invoiceDC.getItem_nameBySubinventory(text); if (ds_item_name != null) { DropDownList_item_name.DataSource = ds_item_name.Tables[0].DefaultView; DropDownList_item_name.DataValueField = "item_name"; DropDownList_item_name.DataTextField = "item_name"; DropDownList_item_name.DataBind(); } DropDownList_item_name.Items.Insert(0, "--选择料号--"); DropDownList_item_name.SelectedIndex = 1; } catch (Exception e2) { PageUtil.showToast(this, "调出库别与料号二级联动失败,请检查库存总表是否有关联数据"); return; } }
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; //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.getExchangeHeaderBySome(Invoice_no, ""); GridView_line.DataSource = invoiceDC.getExchangeLineBySome(Invoice_no, Item_name, 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, "查询失败"); } }