protected void Page_Load(object sender, EventArgs e)
        {
            sr = new ServiceReference1.Service1Client();
            ServiceReference1.Post[] lp = sr.LoadAllPosts();


            tb.Columns.Add("type", typeof(string));
            tb.Columns.Add("details", typeof(string));
            tb.Columns.Add("price", typeof(string));
            tb.Columns.Add("phone", typeof(string));
            tb.Columns.Add("address", typeof(string));
            tb.Columns.Add("postalCode", typeof(string));
            tb.Columns.Add("expiration", typeof(string));
            tb.Columns.Add("status", typeof(string));
            tb.Columns.Add("id", typeof(int));


            foreach (ServiceReference1.Post p in lp)
            {
                createTable(p.Type, p.Details, p.Price, p.PhoneNr, p.Address, p.PostalCode, p.Expiration.Date, p.IsReserved, p.Id);
            }

            
            Gv1.DataSource = tb;
            Gv1.DataBind();
            ViewState["table1"] = tb;
           

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            sr = new ServiceReference1.Service1Client();
            DateTime dt = DateTime.Now.AddDays(1);
            Calendar1.VisibleDate = dt;
          //  Calendar1.SelectedDate = dt;
            Calendar1.TodaysDate = dt;

        }
Exemple #3
0
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost(typeof(ServiceReference1.Service1Client));

            ChannelFactory <ServiceReference1.IService1> cf = new ChannelFactory <ServiceReference1
                                                                                  .IService1>("WSHttpBinding_IService");

            //    .IService1>("BasicHttpBinding_IService");
            channel = cf.CreateChannel();

            firstOrder = new ServiceReference2.
                         //Service1Client("WSHttpBinding_IService1");
                         Service1Client("BasicHttpBinding_IService11");
            int moneu = firstOrder.GetMoneyFromImperium();

            channel.InitializeGame();

            try
            {
                char    input = '0';
                Program p     = new Program();

                while (input != '4')
                {
                    p.PrintMenu();
                    input = System.Console.ReadKey().KeyChar;
                    System.Console.WriteLine();

                    switch (input)
                    {
                    case '1':
                    {
                        p.AskImperiumAboutGold();
                        break;
                    }

                    case '2':
                    {
                        p.BuyShipForGold();
                        break;
                    }

                    case '3':
                    {
                        p.SendShip();
                        break;
                    }

                    case '4':
                    {
                        if (_anySystem == false)
                        {
                            System.Console.WriteLine("Victory!");
                        }
                        else
                        {
                            System.Console.WriteLine("You lose");
                        }

                        break;
                    }
                    }
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e);
                host.Abort();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     sr = new ServiceReference1.Service1Client();
 }
        protected void ExecuteIntegrationPlugin(LocalPluginContext localContext)
        {
            if (localContext == null)
            {
                throw new ArgumentNullException("localContext");
            }
            var context = localContext.PluginExecutionContext;

            service = localContext.OrganizationService;
            Entity          targetEntity    = (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) ? (Entity)context.InputParameters["Target"] : null;
            Entity          postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null;
            Entity          preImageEntity  = (context.PostEntityImages != null && context.PreEntityImages.Contains(this.preImageAlias)) ? context.PreEntityImages[this.preImageAlias] : null;
            EntityReference targetEntityRef = (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is EntityReference) ? (EntityReference)context.InputParameters["Target"] : null;

            messageName = context.MessageName;

            try
            {
                if (context.Stage == 40 && messageName == "Create" && targetEntity != null)
                {
                    entityLogicalName = targetEntity.LogicalName;
                    if (entityLogicalName == "new_integrationpoint" || entityLogicalName == "new_integrationpointlog")
                    {
                        return;
                    }
                    DataCollection <Entity> integrationPoints = GetIntegrationPoints();

                    foreach (Entity point in integrationPoints)
                    {
                        string output     = "";
                        string input      = "";
                        int?   datasource = point.Contains("new_datasource_optionset") ? ((OptionSetValue)point["new_datasource_optionset"]).Value : (int?)null;
                        if (datasource == 100000000) /*Microsoft SQL Server*/
                        {
                            input  = ExecuteSqlDatabaseIntegration(point.Id, "SqlDatabaseIntegrationCreate", targetEntity);
                            output = CallAction(input, "new_DatabaseAction");
                        }
                        else if (datasource == 100000001) /*WCF Service*/
                        {
                            BasicHttpBinding binding = new BasicHttpBinding();
                            binding.Name = "BasicHttpBinding_IService1";
                            EndpointAddress             address       = new EndpointAddress("http://crm2016.korusconsulting.ru/ISV/DemoWcfServiceCrm2016/Service1.svc");
                            var                         factory       = new ChannelFactory <ServiceReference1.IService1>(binding, address);
                            ServiceReference1.IService1 channel       = factory.CreateChannel();
                            string                      serviceResult = channel.GetData();
                        }
                        else if (datasource == 100000002) /*RabbitMQ*/
                        {
                            input  = ExecuteRabbitMqIntegration(point.Id, "RabbitMqIntegrationCreate", targetEntity);
                            output = CallAction(input, "new_RabbitMQAction");
                        }

                        CreateLog(output, point.Id);
                    }
                }
                else if (context.Stage == 40 && messageName == "Update" && targetEntity != null)
                {
                    entityLogicalName = targetEntity.LogicalName;
                    if (entityLogicalName == "new_integrationpoint")
                    {
                        return;
                    }
                    DataCollection <Entity> integrationPoints = GetIntegrationPoints();

                    foreach (Entity point in integrationPoints)
                    {
                        string output     = "";
                        string input      = "";
                        int?   datasource = point.Contains("new_datasource_optionset") ? ((OptionSetValue)point["new_datasource_optionset"]).Value : (int?)null;

                        if (datasource == 100000000) /*Microsoft SQL Server*/
                        {
                            input  = ExecuteSqlDatabaseIntegration(point.Id, "SqlDatabaseIntegrationUpdate", targetEntity);
                            output = CallAction(input, "new_DatabaseAction");
                        }
                        else if (datasource == 100000001) /*WCF Service*/
                        {
                        }
                        else if (datasource == 100000002) /*RabbitMQ*/
                        {
                            input  = ExecuteRabbitMqIntegration(point.Id, "RabbitMqIntegrationUpdate", targetEntity);
                            output = CallAction(input, "new_RabbitMQAction");
                        }

                        CreateLog(output, point.Id);
                    }
                }
                else if (context.Stage == 40 && messageName == "Delete" && targetEntityRef != null && preImageEntity != null)
                {
                    entityLogicalName = targetEntityRef.LogicalName;
                    if (entityLogicalName == "new_integrationpoint")
                    {
                        return;
                    }
                    DataCollection <Entity> integrationPoints = GetIntegrationPoints();

                    foreach (Entity point in integrationPoints)
                    {
                        string output     = "";
                        string input      = "";
                        int?   datasource = point.Contains("new_datasource_optionset") ? ((OptionSetValue)point["new_datasource_optionset"]).Value : (int?)null;

                        if (datasource == 100000000) /*Microsoft SQL Server*/
                        {
                            input  = ExecuteSqlDatabaseIntegration(point.Id, "SqlDatabaseIntegrationDelete", preImageEntity);
                            output = CallAction(input, "new_DatabaseAction");
                        }
                        else if (datasource == 100000001) /*WCF Service*/
                        {
                        }
                        else if (datasource == 100000002) /*RabbitMQ*/
                        {
                            input  = ExecuteRabbitMqIntegration(point.Id, "RabbitMqIntegrationDelete", preImageEntity);
                            output = CallAction(input, "new_RabbitMQAction");
                        }

                        CreateLog(output, point.Id);
                    }
                }
            }
            catch (Exception ex)
            {
                throw new InvalidPluginExecutionException(String.Format("Ошибка в плагине IntegrationPlugin: {0}\n{1}", ex.Message, ex.StackTrace), ex);
            }
        }
Exemple #6
0
        static void Main(string[] args)
        {
            ChannelFactory <ServiceReference1.IService1> cf = new ChannelFactory <ServiceReference1
                                                                                  .IService1>("WSHttpBinding_IService");

            channel = cf.CreateChannel();

            try
            {
                char input = '0';


                while (input != '4')
                {
                    PrintMenu();
                    input = System.Console.ReadKey().KeyChar;
                    System.Console.WriteLine();

                    switch (input)
                    {
                    case '1':
                    {
                        System.Console.WriteLine("Podaj nazwe: ");
                        var name = System.Console.ReadLine();
                        System.Console.WriteLine("Podaj moc: ");
                        int    power;
                        string inputt = System.Console.ReadLine();
                        while (!Int32.TryParse(inputt, out power))
                        {
                            System.Console.WriteLine("The amount is incorrect. Please put number: ");
                            inputt = System.Console.ReadLine();
                        }
                        System.Console.WriteLine("Podaj Shield: ");
                        int shield;
                        inputt = System.Console.ReadLine();
                        while (!Int32.TryParse(inputt, out shield))
                        {
                            System.Console.WriteLine("The amount is incorrect. Please put number: ");
                            inputt = System.Console.ReadLine();
                        }
                        channel.CreateWing(new Wing()
                            {
                                Name   = name,
                                Power  = power,
                                Shield = shield
                            });
                        break;
                    }

                    case '2':
                    {
                        System.Console.WriteLine("Podaj nazwe: ");
                        var name = System.Console.ReadLine();
                        System.Console.WriteLine("Power: " + channel.GetWing(name).Power + "Shield" + channel.GetWing(name).Shield);
                        break;
                    }
                    }
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e);
            }
        }
 public Form1()
 {
     sr = new ServiceReference1.Service1Client();
     InitializeComponent();
 }
 static SoapCarHandler()
 {
     carService = new Service1Client("BasicHttpsBinding_IService1");
 }
 public HomeController()
 {
     service = new ServiceReference1.Service1Client();
 }
Exemple #10
0
 private void InitObj()
 {
     //InstanceContext instanceContext = new InstanceContext(new Service1Callback());
     service1Client = new ServiceReference1.Service1Client();
     service        = service1Client.ChannelFactory.CreateChannel();
 }