private void OnItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { switch (ConvertUtil.ToString(e.Item.Tag)) { case "刷新": ReloadPO(); break; case "审批": prePOManager.FirstApproveBills(ucPoBody1.FocusedHeaders); break; case "反审": prePOManager.CancelFirstApproveBills(ucPoBody1.FocusedHeaders); break; case "所有待审批": ucQueryCondition.DoQuery(BillStateConst.PO_STATE_CODE_COMMITED, "单据状态=等待审批(一审)的采购单"); break; case "所有已审批": ucQueryCondition.DoQuery(BillStateConst.PO_STATE_CODE_FIRST_APPROVED, "单据状态=已经审批(一审),但是尚未二审或开始收货的采购单"); break; case "编写备注": prePOManager.EditRemark(ucPoBody1.FocusedHeader); break; case "单据日志": prePOManager.ViewLog(ucPoBody1.FocusedHeader); break; } }
void DoClickEvent(string tag) { switch (tag) { case "刷新": ReloadPO(); break; case "进行中单据": ucPoQueryConditionPanel1.DoQueryNotCompleteBill("所有进行中(未完成收货)的单据"); break; case "近一周单据": ucPoQueryConditionPanel1.DoQuery(DateTime.Now.AddDays(-6).Date, DateTime.Now.AddDays(1).Date, string.Format("最近一周(【{0}】-【{1}】)创建的单据", DateTime.Now.AddDays(-6).Date.ToShortDateString(), DateTime.Now.Date.ToShortDateString())); break; case "新建": using (FrmPoEdit frmNewBill = new FrmPoEdit()) { frmNewBill.MdiParent = this.MdiParent; frmNewBill.Show(); } break; case "编辑": DoEditOne(); break; case "删除": prePOManager.DeleteSelectedBill(ucPoBody1.FocusedHeaders); break; case "取消提交": prePOManager.CancelCommitBill(ucPoBody1.FocusedHeaders); break; case "提交": prePOManager.CommitBill(ucPoBody1.FocusedHeaders); break; case "新采购订单": DoCopyOne(); break; case "单据日志": prePOManager.ViewLog(ucPoBody1.FocusedHeader); break; default: MsgBox.OK("正在实现"); break; } }