private void Frm_SendList_Load(object sender, EventArgs e) { CpSendList list = new CpSendList(); Invoice invoice = new Invoice(); if (this.m_SendId.Trim() != "") { DataSet set = invoice.PrintSendList(this.m_SendId); list.SetDataSource(set); this.crv_Send.ReportSource=list; } }
private void Frm_SendDetail_Load(object sender, EventArgs e) { CpSendDetail detail = new CpSendDetail(); Invoice invoice = new Invoice(); if (this.m_SendId.Trim() != "") { DataSet set = invoice.PrintSendList(this.m_SendId); detail.SetDataSource(set); this.crv_Send.ReportSource=detail; } }
public void PrintSendList() { try { CpSendList list = new CpSendList(); Invoice invoice = new Invoice(); if (this.m_SendId.Trim() != "") { DataSet set = invoice.PrintSendList(this.m_SendId); list.SetDataSource(set); } list.PrintOptions.PrinterName=Invoice.GetSendPrinter(); list.PrintToPrinter(1, true, 1, 0x1869f); } catch (Exception exception) { MessageBox.Show("打印时发生错误" + '\n' + exception.Message, "打印送货单", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void dgv_Send_CellEndEdit(object sender, DataGridViewCellEventArgs e) { if (this.cbx_SignIn.Checked && (this.dgv_Send.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString() != "")) { this.dgv_Send.Cursor = Cursors.WaitCursor; Invoice invoice = new Invoice(); if (!invoice.SignInSendList(this.dgv_Send.Rows[e.RowIndex].Cells[0].Value.ToString(), this.dgv_Send.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString())) { MessageBox.Show("回写签收人失败", "回写签收人", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } this.dgv_Send.Cursor = Cursors.Default; } }
private void btn_Refresh_Click(object sender, EventArgs e) { DataSet finishTask = new Task().GetFinishTask(); this.Lvw_Task.Items.Clear(); for (int i = 0; i < finishTask.Tables[0].Rows.Count; i++) { ListViewItem item = new ListViewItem { Checked = this.cbx_Select.Checked, ImageKey = "Task", Text = finishTask.Tables[0].Rows[i]["TaskId"].ToString().Trim() }; item.SubItems.Add(finishTask.Tables[0].Rows[i]["TaskTime"].ToString()); item.SubItems.Add(finishTask.Tables[0].Rows[i]["PlanDepart"].ToString()); item.SubItems.Add(finishTask.Tables[0].Rows[i]["NpNum"].ToString()); item.SubItems.Add(finishTask.Tables[0].Rows[i]["TaskUser"].ToString()); item.SubItems.Add(finishTask.Tables[0].Rows[i]["PackTime"].ToString()); item.SubItems.Add(finishTask.Tables[0].Rows[i]["PackU"].ToString()); this.Lvw_Task.Items.Add(item); } finishTask = new Invoice().GetSendList(); this.Lvw_SendList.Items.Clear(); for (int j = 0; j < finishTask.Tables[0].Rows.Count; j++) { ListViewItem item2 = new ListViewItem { ImageKey = "Send", Text = finishTask.Tables[0].Rows[j]["SendId"].ToString().Trim() }; item2.SubItems.Add(finishTask.Tables[0].Rows[j]["SendTime"].ToString()); item2.SubItems.Add(finishTask.Tables[0].Rows[j]["SendUser"].ToString()); item2.SubItems.Add(finishTask.Tables[0].Rows[j]["PlanId"].ToString()); this.Lvw_SendList.Items.Add(item2); } }
private void btn_Out_Click(object sender, EventArgs e) { if (this.Lvw_Task.CheckedItems.Count == 0) { MessageBox.Show("请选择要打印的生产任务", "出库管理", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { Invoice invoice = new Invoice(); string taskStr = ""; foreach (ListViewItem item in this.Lvw_Task.Items) { if (item.Checked) { taskStr = taskStr + item.Text.Trim() + "-"; item.Remove(); } } invoice.NewSend(taskStr); MessageBox.Show("出库成功", "出库管理", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); this.Lvw_TaskNp.Items.Clear(); this.btn_Refresh_Click(this, new EventArgs()); } }