Exemplo n.º 1
0
    public static IEnumerable GetDebtsByPeriod(string accountID, DateTime b_period, DateTime e_period)
    {
        int i_owner = 1032; // код поставщика, выдаетс¤ администратором системы

        var    client = new ServiceIntegratorClient(new ServiceIntegrator(ServiceUrl.Url));
        string ticket = client.GetAuthorizationTicket(IdentityCredential.User, IdentityCredential.Password);

        var factory = new GetTRICDebtsByPeriodFactory(client);

        var xmlRoot = new XmlBuilder("Accounts");

        var accountElement = new XmlBuilder("Account");

        accountElement.AddAttribute("accountID", accountID);
        string b_period_str = b_period.ToString("dd.MM.yyyy");
        string e_period_str = e_period.ToString("dd.MM.yyyy");

        accountElement.AddAttribute("b_period", b_period_str);
        accountElement.AddAttribute("e_period", e_period_str);

        xmlRoot.AddElement(accountElement.Build());

        string xmlAccounts = xmlRoot.Build().ToString();

        var response = factory.Make(new object[] { i_owner, xmlAccounts }, ticket);

        return(response.Tables[0].Rows);
    }
        public void Setup()
        {
            string user     = IdentityCredential.User;
            string password = IdentityCredential.Password;

            this.columnNamesInResponse = "[cod_pl],[for_period],[s_money],[address],[FIO],[i_house],[d_born]";

            this.client = ServiceIntegratorClientFactory.Make(WebServiceUrl.Url);

            this.ticket = this.client.GetAuthorizationTicket(user, password);

            this.factory = new GetTRICDebtsByPeriodFactory(client);
        }