Example #1
0
 public CustomerInformation FindCustomerByID(int cID)
 {
     global::CustomerInformation ci = new global::CustomerInformation();
     global::FindCustomerByIDResponse fcbid = new FindCustomerByIDResponse();
     FindCustomerByIDRequest fcbidq = new FindCustomerByIDRequest(cID);
     fcbid = _sqlService.FindCustomerByID(fcbidq);
     ci = fcbid.FindCustomerByIDResult;
     CustomerInformation co = new CustomerInformation(ci.FirstName, ci.LastName, ci.PhoneNumber, ci.EMail, ci.CompanyName, ci.Notes, ci.SQLID, Convert.ToDateTime(ci.LastModified));
     return co;
 }
Example #2
0
        public CustomerInformation CreateCustomer(CustomerInformation cinfo)
        {
            global::CustomerInformation ci = new global::CustomerInformation();
            ci.CompanyName = cinfo.CompanyName;
            ci.EMail = cinfo.EMail;
            ci.FirstName = cinfo.FirstName;
            ci.LastModified = Convert.ToDateTime(cinfo.LastModified);
            ci.LastModifiedSpecified = true;
            ci.LastName = cinfo.LastName;
            ci.Notes = cinfo.Notes;
            ci.PhoneNumber = cinfo.PhoneNumber;
            //ci.SQLID = cinfo.SQLID;

            CreateCustomerRequest creq = new CreateCustomerRequest(ci);
            Task<CreateCustomerResponse> cres =  _sqlService.CreateCustomerAsync(creq);
            ci = cres.Result.CreateCustomerResult;
            return new CustomerInformation(ci.FirstName,ci.LastName,ci.PhoneNumber,ci.EMail,ci.CompanyName,ci.Notes,ci.SQLID,cinfo.LastModified);
        }
Example #3
0
        public DataTable FindCustomer(CustomerInformation cinfo, bool strict, bool? bytime)
        {
            global::CustomerInformation ci = new global::CustomerInformation();
            ci.CompanyName = cinfo.CompanyName;
            ci.EMail = cinfo.EMail;
            ci.FirstName = cinfo.FirstName;
            if ((bool)bytime)
            {
                ci.LastModified = (Convert.ToDateTime(cinfo.LastModified));
                ci.LastModifiedSpecified = true;
            } else { ci.LastModifiedSpecified = false; }
            ci.LastName = cinfo.LastName;
            ci.Notes = cinfo.Notes;
            ci.PhoneNumber = cinfo.PhoneNumber;
            ci.SQLID = cinfo.SQLID;
            ci.SQLIDSpecified = true;

            FindCustomerRequest fcreq = new FindCustomerRequest(ci,strict,bytime);

            Task<FindCustomerResponse> fcres = _sqlService.FindCustomerAsync(fcreq);

            return fcres.Result.FindCustomerResult;
        }
Example #4
0
        public bool UpdateCustomer(CustomerInformation cinfo)
        {
            global::CustomerInformation ci = new global::CustomerInformation();
            ci.CompanyName = cinfo.CompanyName;
            ci.EMail = cinfo.EMail;
            ci.FirstName = cinfo.FirstName;
            ci.LastModified = Convert.ToDateTime(cinfo.LastModified);
            ci.LastModifiedSpecified = true;
            ci.LastName = cinfo.LastName;
            ci.Notes = cinfo.Notes;
            ci.PhoneNumber = cinfo.PhoneNumber;
            ci.SQLID = cinfo.SQLID;
            ci.SQLIDSpecified = true;

            UpdateCustomerRequest ucreq = new UpdateCustomerRequest(ci);
            Task<UpdateCustomerResponse> ucres = _sqlService.UpdateCustomerAsync(ucreq);

            return ucres.Result.UpdateCustomerResult;
        }