コード例 #1
0
        public void Test_QueryCreateUpdateDeleteSubscription()
        {
            NotificationSubscription sub = ClientSample.CreateUpdateDeleteSubscription();

            Assert.AreEqual("Someone is waiting on one of my pull requests", sub.Description);
            Assert.AreEqual(SubscriptionStatus.PendingDeletion, sub.Status);
            Assert.AreEqual(GetCurrentUserId(), Guid.Parse(sub.Subscriber.Id));
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: wanglong/PlainElastic.Net
        static void Main(string[] args)
        {
            var plainSample = new PlainSample();

            plainSample.Execute();


            var clientSample = new ClientSample();

            clientSample.Execute();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: sk8tz/PlainElastic.Net
        static void Main(string[] args)
        {
            var plainSample = new PlainSample();

            plainSample.Execute();


            var clientSample = new ClientSample();

            clientSample.Execute();
        }
コード例 #4
0
 public int Edit(int id, ClientSampleModel ObjClientSampleModel)
 {
     try
     {
         if (id > 0)
         {
             if (ObjClientSampleModel != null)
             {
                 ClientSample ObjClientSample = DBContext.ClientSamples.Where(a => a.ClientSample_ID == id).FirstOrDefault();
                 if (ObjClientSample != null)
                 {
                     //ClientSampleModel Edit Properties mapping here.
                     //ObjClientSample.Profile_Name = ObjClientSampleModel.Profile_Name;
                     //ObjClientSample.Password = ObjClientSampleModel.Password;
                     //ObjClientSample.First_Name = ObjClientSampleModel.First_Name;
                     //ObjClientSample.Middle_Name = ObjClientSampleModel.Middle_Name;
                     //ObjClientSample.Last_Name = ObjClientSampleModel.Last_Name;
                     //ObjClientSample.Email_Address = ObjClientSampleModel.Email_Address;
                     //ObjClientSample.Contact_Number = ObjClientSampleModel.Contact_Number;
                     //ObjClientSample.Cell_Number = ObjClientSampleModel.Cell_Number;
                     //ObjClientSample.Location_ID = ObjClientSampleModel.Location_ID;
                     //ObjClientSample.PickUp_Address = ObjClientSampleModel.PickUp_Address;
                     //ObjClientSample.Drop_Address = ObjClientSampleModel.Drop_Address;
                     //ObjClientSample.QR_Code = ObjClientSampleModel.QR_Code;
                     //ObjClientSample.Rating = ObjClientSampleModel.Rating;
                     //ObjClientSample.Created_DateTime = ObjClientSampleModel.Created_DateTime;
                     //ObjClientSample.Created_By = ObjClientSampleModel.Created_By;
                     //ObjClientSample.Modified_DateTime = ObjClientSampleModel.Modified_DateTime;
                     //ObjClientSample.Modified_By = ObjClientSampleModel.Modified_By;
                     //ObjClientSample.Deleted = ObjClientSampleModel.Deleted;
                     DBContext.SubmitChanges();
                     return(ObjClientSample.ClientSample_ID);
                 }
                 else
                 {
                     return(WebApiResponse.NoRecordFound);
                 }
             }
             else
             {
                 return(WebApiResponse.InputObjectIsNull);
             }
         }
         else
         {
             return(WebApiResponse.InputIdInvalid);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #5
0
 public int Create(ClientSample ObjClientSample)
 {
     try
     {
         DBContext.ClientSamples.InsertOnSubmit(ObjClientSample);
         DBContext.SubmitChanges();
         return(ObjClientSample.ClientSample_ID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #6
0
ファイル: Program.cs プロジェクト: swagfin/BitSharp
        private async static void BegingTorrentDownloadSample()
        {
            ClientSample sample = new ClientSample();

            sample.SetupBanlist("banlist.txt");

            /* string folderForSecret = Path.Combine(Env.ContentRootPath, "_LicenseGenSecrets");
             *  if (!Directory.Exists(folderForSecret))
             *      Directory.CreateDirectory(folderForSecret);
             *  string genSecretPath = Path.Combine(folderForSecret, "SemanticReactorProject.nrproj");
             *
             */


            await sample.LoadTorrentAsync("C:/9D4A9495BE35D97B13E60D143F37CC38378D8233.torrent", "D:/TorrentsDownload");
        }
コード例 #7
0
        private void Connect()
        {
            for (int i = 0; i < Connections; i++)
            {
                ConnectorFactory connectorFactory = new ConnectorFactory();
                connectorFactory.Uri = new Uri(webSockets ? "ws://localhost:5001/" : "tcp://127.0.0.1:7000");

                ClientSample clientSample = new ClientSample(Iterations);

                ClientFactory clientFactory = new ClientFactory();
                clientFactory.ConnectorFactory = connectorFactory;
                clientFactory.ChannelRegistry  = clientSample;

                NetworkFactory networkFactory = new NetworkFactory();
                networkFactory.Executable = clientSample;
                networkFactory.Add(clientFactory);
                Network network = networkFactory.Create();

                tasks.Add(network.Execute(cancellationTokenSource.Token));
            }
        }
コード例 #8
0
        private static List <ProcessJob> CreateProcessJobs(List <MeasurementIdNamePair> rawFiles, List <string> processes)
        {
            List <ProcessJob> jobs = new List <ProcessJob>();

            foreach (var item in rawFiles)
            {
                ProcessJob job = new ClientSample()
                {
                    Name            = item.Name,
                    Description     = "job test",
                    Id              = Guid.NewGuid(),
                    ProcessJobNames = processes,
                    RawFile         = item.Name,
                    RawFilePath     = item.Name,
                    JobWorkId       = item.Id
                };
                jobs.Add(job);
            }
            ;
            return(jobs);
        }
コード例 #9
0
 public int Delete(int id, ClientSampleModel ObjInputClientSampleModel)
 {
     try
     {
         //Just keep ObjInputClientSampleModel as parameter for Deleted Log.
         ClientSample ObjClientSample = DBContext.ClientSamples.Where(a => a.ClientSample_ID == id).FirstOrDefault();
         if (ObjClientSample != null)
         {
             DBContext.ClientSamples.DeleteOnSubmit(ObjClientSample);
             DBContext.SubmitChanges();
             return(ObjClientSample.ClientSample_ID);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }