-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
81 lines (67 loc) · 3.13 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using Microsoft.Xrm.Sdk.Client;
using System;
using System.ServiceModel.Description;
using Topshelf;
using Xrm;
namespace CustomerService
{
public class Program
{
//نیروفراب
//static Uri oUri = new Uri("https://niroofarab.niroofarabgroup.com:444/XRMServices/2011/Organization.svc");
//آردینه
//static Uri oUri = new Uri("https://crm.ardineh.com/XRMServices/2011/Organization.svc");
//بهینه چوب
//static Uri oUri = new Uri("http://dynamics/BehineChoob/XRMServices/2011/Organization.svc");
//فرانه آرمان
static Uri oUri = new Uri("http://crm2/FarTest/XRMServices/2011/Organization.svc");
public static OrganizationServiceProxy _serviceProxy;
//public static OrganizationServiceProxy ServiceProxy { get => _serviceProxy; }
public static XrmServiceContext dbxrm;
static void Main(string[] args)
{
while (true)
{
try
{
ClientCredentials clientCredentials = new ClientCredentials();
//نیروفراب
//clientCredentials.UserName.UserName = @"farab\it";
//clientCredentials.UserName.Password = @"Admin#@!123";
//آردینه
//clientCredentials.UserName.UserName = @"ardineh\crmadmin";
//clientCredentials.UserName.Password = @"arqwe123!@#";
//بهینه چوب
//clientCredentials.UserName.UserName = @"behinchoob\administrator";
//clientCredentials.UserName.Password = @"Behine2024";
//فرزانه آرمان
clientCredentials.UserName.UserName = @"fartest\administrator";
clientCredentials.UserName.Password = @"FTit@Factory";
_serviceProxy = new OrganizationServiceProxy(oUri, null, clientCredentials, null);
_serviceProxy.EnableProxyTypes();
dbxrm = new XrmServiceContext(_serviceProxy);
var Exitcode = HostFactory.Run(x =>
{
x.Service<BaseTimer>(y =>
{
y.ConstructUsing(timeRrun => new BaseTimer());
y.WhenStarted(timeRrun => timeRrun.Start());
y.WhenStopped(timerRun => timerRun.Stop());
});
x.RunAsLocalSystem();
x.SetServiceName("LunaTicketCustomer");
x.SetDisplayName("LunaTicketCustomer");
x.SetDescription("تیکت از سمت مشتری LunaGroup Copyright © 2024 ");
});
int Exitcodevalue = (int)Convert.ChangeType(Exitcode, Exitcode.GetTypeCode());
Environment.ExitCode = Exitcodevalue;
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
}