Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IMainService mainservice = new MainServiceClient();

            DTO.ReqInParm.CCertificateSpcReqInParm parm1 = new DTO.ReqInParm.CCertificateSpcReqInParm();
            Console.WriteLine("Hello World!");
        }
        private async Task SoapRead()
        {
            int?requestIdInt = await GetIdAsInt();

            if (!requestIdInt.HasValue)
            {
                return;
            }

            try
            {
                IMainService mainService = new MainServiceClient();

                SoapService.MainData responseData = await mainService.ReadAsync(requestIdInt.Value);

                ResponseId   = responseData.Id.ToString();
                ResponseText = responseData.Text;

                SoapStatus = "OK";
            }
            catch (FaultException fex)
            {
                SoapStatus = fex.Code.Name;
            }
            catch (Exception)
            {
                SoapStatus = "Error";
            }
        }
        private async Task SoapUpdate()
        {
            int?requestIdInt = await GetIdAsInt();

            if (!requestIdInt.HasValue)
            {
                return;
            }

            try
            {
                IMainService mainService = new MainServiceClient();

                SoapService.MainData requestData = new SoapService.MainData()
                {
                    Id = requestIdInt.Value, Text = RequestText
                };

                await mainService.UpdateAsync(CreateIfNotExisting, requestData);

                SoapStatus = "OK";
            }
            catch (FaultException fex)
            {
                SoapStatus = fex.Code.Name;
            }
            catch (Exception)
            {
                SoapStatus = "Error";
            }
        }
        private async Task SoapDelete()
        {
            int?requestIdInt = await GetIdAsInt();

            if (!requestIdInt.HasValue)
            {
                return;
            }

            try
            {
                IMainService mainService = new MainServiceClient();

                await mainService.DeleteAsync(requestIdInt.Value, ErrorIfNotExisting);

                SoapStatus = "OK";
            }
            catch (FaultException fex)
            {
                SoapStatus = fex.Code.Name;
            }
            catch (Exception)
            {
                SoapStatus = "Error";
            }
        }
        private async Task SoapCreate()
        {
            try
            {
                IMainService mainService = new MainServiceClient();

                SoapService.MainData requestData = new SoapService.MainData()
                {
                    Text = RequestText
                };

                SoapService.MainData responseData = await mainService.CreateAsync(requestData);

                ResponseId   = responseData.Id.ToString();
                ResponseText = responseData.Text;

                SoapStatus = "OK";
            }
            catch (FaultException fex)
            {
                SoapStatus = fex.Code.Name;
            }
            catch (Exception)
            {
                SoapStatus = "Error";
            }
        }
Exemplo n.º 6
0
 public NewTaskWindowViewModel(Task task)
 {
     Task = task;
     TrackingGroup.RegisterObject(Task);
     using (var client = new MainServiceClient())
         Accounts = client.GetAccounts(task.ProjectId);
 }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            try
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.Title           = "Ставки";
                Console.WriteLine("Подключение к серверу...");

                //Соединение с сервером
                client = new MainServiceClient();

                //Печать заголовка
                PrintTitle();

                //Выбор команды
                int cmd = 0;
                do
                {
                    cmd = PrintCmd();
                    DoCmd(cmd);
                }while (cmd != 7);
            }
            catch (Exception ex)
            {
                Console.Clear();
                Console.WriteLine("Не удалось подключится к серверу");
                Console.ReadKey();
            }
        }
Exemplo n.º 8
0
 static void Main(string[] args)
 {
     using (MainServiceClient client = new MainServiceClient())
     {
         string answer = client.HelloMethod("Andrew");
         Console.WriteLine(answer);
         Console.ReadKey();
     }
 }
Exemplo n.º 9
0
 // GET: Products
 public ActionResult Index()
 {
     using (var client = new MainServiceClient())
     {
         var result = client.GetProducts().ToList();
         client.Close();
         return(View(result));
     }
 }
Exemplo n.º 10
0
 static void Main(string[] args)
 {
     using (MainServiceClient client = new MainServiceClient())
     {
         string answer = client.HelloMethod("Andrew");
         Console.WriteLine(answer);
         Console.ReadKey();
     }
 }
Exemplo n.º 11
0
 public NewTaskWindowViewModel(int projectId)
 {
     Task = new Task()
     {
         ProjectId = projectId, State = Data.Enums.TaskState.New
     };
     TrackingGroup.RegisterObject(Task);
     using (var client = new MainServiceClient())
         Accounts = client.GetAccounts(projectId);
 }
Exemplo n.º 12
0
        private void btnGetInfo_Click(object sender, EventArgs e)
        {
            MainServiceClient loClient = new MainServiceClient();
            Int32             personID = Convert.ToInt32(txtPersonID.Text.Trim());

            string mapImageLocation = loClient.getMapLocation(personID);
            var    pair             = loClient.getBeaconLocation(personID);
            string X_pos            = pair.Key.ToString();
            string Y_pos            = pair.Value.ToString();

            txtOutput.Text = "Map Image Location: " + mapImageLocation + " Position X: " + X_pos + " Position Y:" + Y_pos;
        }
 private void CreateClient()
 {
     var callback = new MainServiceCallback();
     _client = new MainServiceClient(new InstanceContext(callback), "NetTcpBinding_IMainService");
     if (_settings.UseSsl)
     {
         var identity = _client.Endpoint.Address.Identity;
         _client.Endpoint.Address = new EndpointAddress(new Uri(_serviceUrl), identity);
     }
     else
     {
         _client.Endpoint.Address = new EndpointAddress(_serviceUrl);
     }
 }
Exemplo n.º 14
0
 public IEnumerable <V_Task> GetTasks(Data.Enums.TaskState state)
 {
     using (var client = new MainServiceClient())
         return(client.GetTasks(state, ProjectId.Value));
 }
Exemplo n.º 15
0
 protected override IEnumerable <V_ProjectStat> GetItems()
 {
     using (var client = new MainServiceClient())
         return(client.GetProjectStats());
 }
 protected override Project GetEditItem()
 {
     using (var client = new MainServiceClient())
         return(client.GetProject(EditItemId));
 }
 public override bool CanRemoveItem(V_Project item)
 {
     using (var client = new MainServiceClient())
         return(client.CanRemoveProject(item.Id));
 }
 public override bool CanRemoveItem(V_Team item)
 {
     using (var client = new MainServiceClient())
         return(client.CanRemoveTeam(item.Id));
 }
Exemplo n.º 19
0
 private void Form1_Load(object sender, EventArgs e)
 {
     handler = new MainServiceClient();
     if (handler.GetAllClients() != null)
     {
         InitGrid();
     }
 }
 protected override IEnumerable <V_Resource> GetItems()
 {
     using (var client = new MainServiceClient())
         return(client.GetResources(InUseFilter));
 }
 public override Team CreateNewItem()
 {
     using (var client = new MainServiceClient())
         return(client.CreateTeam());
 }
 public override bool RemoveItem(V_Resource item)
 {
     using (var client = new MainServiceClient())
         client.RemoveResource(item.Id);
     return(true);
 }
 protected override Resource GetEditItem()
 {
     using (var client = new MainServiceClient())
         return(client.GetResource(EditItemId));
 }
 public override bool CanRemoveItem(V_Resource item)
 {
     using (var client = new MainServiceClient())
         return(client.CanRemoveResource(item.Id));
 }
Exemplo n.º 25
0
 public IEnumerable <EFValuesHistory> GetItems()
 {
     using (var service = new MainServiceClient())
         return(service.GetValuesHistory(ModifyDateTimeRange?.From, ModifyDateTimeRange?.To));
 }
 public override bool RemoveItem(V_Team item)
 {
     using (var client = new MainServiceClient())
         client.RemoveTeam(item.Id);
     return(true);
 }
Exemplo n.º 27
0
 public IEnumerable <V_Project> GetProjects()
 {
     using (var client = new MainServiceClient())
         return(client.GetProjects(true));
 }
 protected override Team GetEditItem()
 {
     using (var client = new MainServiceClient())
         return(client.GetTeam(EditItemId));
 }