Skip to Content
0
J S
Jan 08, 2020 at 10:09 AM

Sdk using C#

161 Views Last edit Jan 24, 2020 at 01:31 AM 2 rev

Hi

I have below code and i want to create Matrix with CheckBoxes

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace AddOn
{
    class SubMain
    {
        static void Main()
        {
            clsCommon c1 = null;
            c1 = new clsCommon();
        }
    }
}




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections;
using System.Windows.Forms;


namespace AddOn
{
    class clsCommon
    {
        private SAPbouiCOM.Application oApp;
        private SAPbobsCOM.Company oCompany;
        private void SetApplication()
        {
            SAPbouiCOM.SboGuiApi SboGuiApi = null;
            string sCon = null;
            SboGuiApi = new SAPbouiCOM.SboGuiApi();
            sCon = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1));
            SboGuiApi.Connect(sCon);
            oApp = SboGuiApi.GetApplication(-1);
        }
        public clsCommon()
        {
            try
            {
                SetApplication();
                oCompany = (SAPbobsCOM.Company)oApp.Company.GetDICompany();
                oApp.MessageBox("U r connected To : " + oCompany.CompanyName, 1, "Ok", "", "");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}

Thanks