using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NiApiLib;

namespace WD_ORDER_BY_NUMBER
{
    class Program
    {
        static void Main(string[] args)
        {
            connection c = new connection();
            c.connect();
            Console.ReadLine();
        }
    }
    class connection
    {
        NiApiLib.SrvrSession Session = new NiApiLib.SrvrSessionClass();
        NiApiLib.Transaction Trans = new NiApiLib.TransactionClass();
        NiApiLib.DataRow Row = new NiApiLib.DataRowClass();
        public void connect()
        {
            Session.HostAddr = "nidemo.mfd.ru";
            Session.HostPort = 2900;
            Session.Name = "AFedin";
            Session.Password = "12345";
            Session.CatalogName = "catalog.xml";
            Session.OnLogin+=new NiApiLib._ISrvrSessionEvents_OnLoginEventHandler(Session_OnLogin);
            Session.Connect();
        }
        public void Session_OnLogin(int LoginResult)
        {
            if (LoginResult == 0)
            {
                Trans.Open(Session, "WD_ORDER_BY_NUMBER",ETableType.tabAdrr);
                Row.Structure = Trans.Structure;
                object ORDER_NUMBER="I_ORDER_NUMBER";
                Row.set_Item(ref ORDER_NUMBER, 1111);
                Trans.Execute(Row);
                Console.WriteLine("123123131");
            }
            else
            {

            }

        }
    }
}
