Exemple #1
0
 private void Generate()
 {
     try
     {
         this.CurrentForm.Freeze(true);
         SBOApp.StatusBar.SetText("正在处理,请稍后...", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Warning);
         SAPbouiCOM.Grid grid_list = this.CurrentForm.Items.Item(GRID_LIST).Specific;
         if (grid_list.Rows.Count > 0)
         {
             SAPbouiCOM.EditTextColumn col_voucher_code = (SAPbouiCOM.EditTextColumn)grid_list.Columns.Item("VoucherCode");
             if (col_voucher_code.PickerType != SAPbouiCOM.BoPickerType.pt_Search)
             {
                 throw new Exception("请在[凭单编码]列上绑定运算逻辑格式化搜索!");
             }
             for (int i = 0; i < grid_list.Rows.Count; i++)
             {
                 grid_list.SetCellFocus(i, 2);
                 col_voucher_code.ClickPicker(i + 1);
                 SBOApp.StatusBar.SetText(string.Format("处理完成{0}/{1}!", i, grid_list.Rows.Count),
                                          SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
             }
         }
         SBOApp.StatusBar.SetText("处理完成!", SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success);
     }
     catch (Exception ex) { throw ex; }
     finally { this.CurrentForm.Freeze(false); }
 }