示例#1
0
        private void btnWeight_Click(object sender, EventArgs e)
        {
            WaitForReady();
            SetStatus(ProcessStatus.Weighing);
            for (int i = 0; i < Global.OcrLines.Count; i++)
            {
                var ocr = Global.OcrLines[i];
                OcrPolicy.AssertAsVendorName(ref ocr);
                OcrPolicy.AssertAsAddress(ref ocr);
                OcrPolicy.AssertAsDateTitle(ref ocr);
                //OcrPolicy.AssertAsDetail(ref ocr);

                OcrPolicy.AssertAsChangeTitle(ref ocr);
                OcrPolicy.AssertAsTenderTitle(ref ocr);
                OcrPolicy.AssertAsTotalTitle(ref ocr);
                OcrPolicy.AssertAsVendorTINtitle(ref ocr);
            }

            //bindingSourceOCR.Clear();
            // Application.DoEvents();

            bindingSourceOCR.DataSource       = Global.OcrLines;
            BindingNavigatorOcr.BindingSource = bindingSourceOCR;
            dgOCR.DataSource = bindingSourceOCR;
            dgOCR.Refresh();

            SetStatus(ProcessStatus.Ready);
        }
示例#2
0
        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(NativeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument

            try
            {
                #region --------------------TRY CONTENT----------------------
                var ocr = context.GetValue(OcrLine);
                OcrPolicy.AssertAsVendorTINtitle(ref ocr);
                context.SetValue(Result, ocr);

                #endregion
            }
            catch (Exception err)
            {
                Global.LogError("Weight VendorTIN---> " + err.Message);
            }
            finally
            {
                // Global.MainWindow.SafeInvoke(c => c.HideBusy());
            }
        }