void OpenDocument()
 {
     if (dgvReport.CurrentRow == null)
     {
         return;
     }
     string orderId = Convert.ToString(this.dgvReport.CurrentRow.Cells[colID.Name].Value);
     if (orderId.Length == 0)
     {
         return;
     }
     string type = dgvReport.CurrentRow.Cells[colType.Name].Value.ToString();
     switch (type)
     {
         case "销售开单":
             UCSaleBillView ucSaleView = new UCSaleBillView(orderId, null);
             base.addUserControl(ucSaleView, "销售开单-查看", "UCSaleBillView" + orderId + "", this.Tag.ToString(), this.Name);
             break;
         case "三包结算单":
             UCThreeGuarantySettlementView ucView = new UCThreeGuarantySettlementView();
             ucView.SettlementId = orderId;
             base.addUserControl(ucView, "三包结算单-查看", "UCThreeGuarantySettlementView" + orderId, this.Tag.ToString(), this.Name);
             break;
         case "维修结算单":
             UCRepairBalanceView ucRepairView = new UCRepairBalanceView(orderId);
             base.addUserControl(ucRepairView, "维修结算单-查看", "UCRepairBalanceView" + orderId, this.Tag.ToString(), this.Name);
             break;
         case "销售收款":
             UCReceivableAdd ucPayable = new UCReceivableAdd(WindowStatus.View, orderId, null, DataSources.EnumOrderType.RECEIVABLE);
             base.addUserControl(ucPayable, "应收账款-预览", "UCReceivableAdd" + orderId, this.Tag.ToString(), this.Name);
             break;
         case "往来核销":
             UCAccountVerificationAdd ucAccountVerificationView = new UCAccountVerificationAdd(WindowStatus.View, orderId, null);
             base.addUserControl(ucAccountVerificationView, "往来核销-预览", "UCAccountVerificationAdd" + orderId, this.Tag.ToString(), this.Name);
             break;
     }
 }
 //编辑
 void EditData(WindowStatus status)
 {
     if (status != WindowStatus.Edit && status != WindowStatus.Copy)
     {
         return;
     }
     string title = "编辑";
     string menuId = "UCAccountVerificationEdit";
     if (status == WindowStatus.Copy)
     {
         title = "复制";
         menuId = "UCAccountVerificationCopy";
     }
     if (string.IsNullOrEmpty(id))
     {
         return;
     }
     UCAccountVerificationAdd add = new UCAccountVerificationAdd(status, id, uc);
     base.addUserControl(add, string.Format("往来核销-{0}", title), menuId + id, this.Tag.ToString(), this.Name);
 }
 void OpenDocument()
 {
     if (dgvReport.CurrentRow == null)
     {
         return;
     }
     string orderId = Convert.ToString(this.dgvReport.CurrentRow.Cells[colID.Name].Value);
     if (orderId.Length == 0)
     {
         return;
     }
     string type = dgvReport.CurrentRow.Cells[colType.Name].Value.ToString();
     switch (type)
     {
         case "采购开单":
             UCPurchaseBillView ucPurchaseView = new UCPurchaseBillView(orderId, null);
             base.addUserControl(ucPurchaseView, "采购开单-查看", "UCPurchaseBillView" + orderId + "", this.Tag.ToString(), this.Name);
             break;
         case "采购收款":
             UCReceivableAdd ucPayable = new UCReceivableAdd(WindowStatus.View, orderId, null, DataSources.EnumOrderType.PAYMENT);
             base.addUserControl(ucPayable, "应付账款-预览", "UCReceivableAdd" + orderId, this.Tag.ToString(), this.Name);
             break;
         case "往来核销":
             UCAccountVerificationAdd ucAccountVerificationView = new UCAccountVerificationAdd(WindowStatus.View, orderId, null);
             base.addUserControl(ucAccountVerificationView, "往来核销-预览", "UCAccountVerificationAdd" + orderId, this.Tag.ToString(), this.Name);
             break;
     }
 }
 //新增
 void AddData()
 {
     UCAccountVerificationAdd add = new UCAccountVerificationAdd(WindowStatus.Add, null, this);
     this.addUserControl(add, string.Format("往来核销-新增"), "UCAccountVerificationAdd", this.Tag.ToString(), this.Name);
 }
        //编辑
        void EditData(WindowStatus status)
        {
            if (status != WindowStatus.Edit && status != WindowStatus.Copy)
            {
                return;
            }
            string title = "编辑";
            string menuId = "UCAccountVerificationEdit";
            if (status == WindowStatus.Copy)
            {
                title = "复制";
                menuId = "UCAccountVerificationCopy";
            }
            if (dgvVerification.CurrentRow == null)
            {
                MessageBoxEx.Show(string.Format("请选择要{0}的数据!", title));
                return;
            }
            string id = ID;
            if (string.IsNullOrEmpty(id))
            {
                return;
            }

            UCAccountVerificationAdd add = new UCAccountVerificationAdd(status, id, this);
            base.addUserControl(add, string.Format("往来核销-{0}", title), menuId + id, this.Tag.ToString(), this.Name);
        }
        //预览
        void ViewData()
        {

            if (dgvVerification.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择要预览的数据!");
                return;
            }
            string id = ID;
            if (string.IsNullOrEmpty(id))
            {
                return;
            }
            UCAccountVerificationAdd view = new UCAccountVerificationAdd(WindowStatus.View, id, this);
            base.addUserControl(view, "往来核销-预览", "UCAccountVerificationView" + id, this.Tag.ToString(), this.Name);
        }