Ejemplo n.º 1
0
        private void LLAction(string action)
        {
            var param = new RestConnectionParameter();

            param.RestURL  = Properties.Settings.Default.RestURL;
            param.Userid   = Properties.Settings.Default.Userid;
            param.Password = Properties.Settings.Default.Password;

            var ll = new ListLabel();
            var dp = new OpenEdgeDataProvider();

            dp.ServiceAdapter = new RestServiceAdapter(param);
            dp.ServiceName    = Properties.Settings.Default.ServiceName;
            dp.Initialize();
            ll.DataSource = dp;
            try
            {
                if (action == "DESIGN")
                {
                    if (Properties.Settings.Default.DesignerPreviewMaxRows > 0)
                    {
                        dp.MaxRows = Properties.Settings.Default.DesignerPreviewMaxRows;
                    }
                    ll.Design();
                }
                else if (action == "PRINT")
                {
                    ll.Print();
                }
                else
                {
                }
            }
            catch (ListLabelException e)
            {
                MessageBox.Show(e.Message);
            }
            ll.Dispose();

            dp.Dispose();
        }
Ejemplo n.º 2
0
 public RestServiceAdapter(RestConnectionParameter restConnectionParameter)
 {
     _RestConnectionParameter = restConnectionParameter;
 }