244. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2/1/2017 2:56:27 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

244.1 Files compared

# Location File Last Modified
1 C:\Araxis_Merge_Comprasion\Pub_un\BTSSS_CIF_122016.zip\BTSSS_CIF_12_20_16\clean\CRM\trunk\SDK\SampleCode\CS\BusinessDataModel\ScheduleAndAppointment BookAppointment.cs Tue Dec 20 19:51:43 2016 UTC
2 Wed Feb 1 19:56:27 2017 UTC

244.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 0 0
Removed 1 239

244.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

244.4 Active regular expressions

No regular expressions were active.

244.5 Comparison detail

1   // ======= ========== ========== ========== ========== ========== ========== ==        
2   //        
3   //  This f ile is par t of the M icrosoft D ynamics CR M SDK code  samples.        
4   //        
5   //  Copyri ght (C) Mi crosoft Co rporation.  All right s reserved .        
6   //        
7   //  This s ource code  is intend ed only as  a supplem ent to Mic rosoft        
8   //  Develo pment Tool s and/or o n-line doc umentation .  See the se other        
9   //  materi als for de tailed inf ormation r egarding M icrosoft c ode sample s.        
10   //        
11   //  THIS C ODE AND IN FORMATION  ARE PROVID ED "AS IS"  WITHOUT W ARRANTY OF  ANY        
12   //  KIND,  EITHER EXP RESSED OR  IMPLIED, I NCLUDING B UT NOT LIM ITED TO TH E        
13   //  IMPLIE D WARRANTI ES OF MERC HANTABILIT Y AND/OR F ITNESS FOR  A        
14   //  PARTIC ULAR PURPO SE.        
15   //        
16   // ======= ========== ========== ========== ========== ========== ========== ==        
17   //<snippet BookAppoin tment>        
18   using Syst em;        
19   using Syst em.Linq;        
20   using Syst em.Service Model;        
21   using Syst em.Service Model.Desc ription;        
22          
23   // These n amespaces  are found  in the Mic rosoft.Xrm .Sdk.dll a ssembly        
24   // found i n the SDK\ bin folder .        
25   using Micr osoft.Xrm. Sdk;        
26   using Micr osoft.Xrm. Sdk.Client ;        
27   using Micr osoft.Xrm. Sdk.Query;        
28   using Micr osoft.Xrm. Sdk.Discov ery;        
29   using Micr osoft.Xrm. Sdk.Messag es;        
30          
31   // This na mespace is  found in  Microsoft. Crm.Sdk.Pr oxy.dll as sembly        
32   // found i n the SDK\ bin folder .        
33   using Micr osoft.Crm. Sdk.Messag es;        
34          
35   namespace  Microsoft. Crm.Sdk.Sa mples        
36   {        
37       /// <s ummary>        
38       /// Th is sample  shows how  to book or  schedule  an appoint ment.        
39       /// </ summary>        
40       public  class Boo kAppointme nt        
41       {        
42           #r egion Clas s Level Me mbers        
43          
44           // / <summary >        
45           // / Stores t he organiz ation serv ice proxy.        
46           // / </summar y>        
47           pr ivate Orga nizationSe rviceProxy  _serviceP roxy;        
48          
49           //  Define th e IDs need ed for thi s sample.        
50           pu blic Guid  _appointme ntId = Gui d.Empty;                 
51          
52           #e ndregion C lass Level  Members        
53          
54           #r egion How  To Sample  Code        
55           // / <summary >        
56           // / Create a nd configu re the org anization  service pr oxy.        
57           // / Initiate  the metho d to creat e any data  that this  sample re quires.        
58           // / Book an  appointmen t.                
59           // / Optional ly delete  any entity  records t hat were c reated for  this samp le.        
60           // / </summar y>        
61           // / <param n ame="serve rConfig">C ontains se rver conne ction info rmation.</ param>        
62           // / <param n ame="promp tforDelete ">When Tru e, the use r will be  prompted t o delete a ll        
63           // / created  entities.< /param>        
64           pu blic void  Run(Server Connection .Configura tion serve rConfig, b ool prompt ForDelete)        
65           {        
66                try        
67                {        
68          
69                    // C onnect to  the Organi zation ser vice.         
70                    // T he using s tatement a ssures tha t the serv ice proxy  will be pr operly dis posed.        
71                    usin g (_servic eProxy = n ew Organiz ationServi ceProxy(se rverConfig .Organizat ionUri, se rverConfig .HomeRealm Uri,        
72                                                                              s erverConfi g.Credenti als, serve rConfig.De viceCreden tials))        
73                    {        
74                         // This st atement is  required  to enable  early-boun d type sup port.        
75                         _servicePr oxy.Enable ProxyTypes ();        
76          
77                         // Call th e method t o create a ny data th at this sa mple requi res.        
78                         CreateRequ iredRecord s();        
79          
80                         //<snippet BookAppoin tment1>        
81          
82                         // Get the  current u ser inform ation        
83                         WhoAmIRequ est userRe quest = ne w WhoAmIRe quest();        
84                         WhoAmIResp onse userR esponse =  (WhoAmIRes ponse)_ser viceProxy. Execute(us erRequest) ;        
85          
86                         // Create  the Activi tyParty in stance.        
87                         ActivityPa rty party  = new Acti vityParty        
88                         {        
89                             PartyI d = new En tityRefere nce(System User.Entit yLogicalNa me, userRe sponse.Use rId)        
90                         };        
91                                
92                         // Create  the appoin tment inst ance.        
93                         Appointmen t appointm ent = new  Appointmen t        
94                         {        
95                             Subjec t = "Test  Appointmen t",        
96                             Descri ption = "T est Appoin tment crea ted using  the BookRe quest Mess age.",        
97                             Schedu ledStart =  DateTime. Now.AddHou rs(1),        
98                             Schedu ledEnd = D ateTime.No w.AddHours (2),        
99                             Locati on = "Offi ce",        
100                             Requir edAttendee s = new Ac tivityPart y[] { part y },        
101                             Organi zer = new  ActivityPa rty[] { pa rty }                                  
102                         };                              
103                                
104                         // Use the  Book requ est messag e.        
105                         BookReques t book = n ew BookReq uest        
106                         {        
107                             Target  = appoint ment        
108                         };        
109                         BookRespon se booked  = (BookRes ponse)_ser viceProxy. Execute(bo ok);        
110                         _appointme ntId = boo ked.Valida tionResult .ActivityI d;        
111                                
112                         // Verify  that the a ppointment  has been  scheduled.        
113                         if (_appoi ntmentId ! = Guid.Emp ty)        
114                         {        
115                             Consol e.WriteLin e("Succesf ully booke d {0}.", a ppointment .Subject)  ;        
116                         }        
117                                
118                         //</snippe tBookAppoi ntment1>        
119          
120                         DeleteRequ iredRecord s(promptFo rDelete);        
121                    }        
122                }        
123                // Catch  any servi ce fault e xceptions  that Micro soft Dynam ics CRM th rows.        
124                catch (F aultExcept ion<Micros oft.Xrm.Sd k.Organiza tionServic eFault>)        
125                {        
126                    // Y ou can han dle an exc eption her e or pass  it back to  the calli ng method.        
127                    thro w;        
128                }        
129           }        
130          
131           // / <summary >        
132           // / This met hod create s any enti ty records  that this  sample re quires.                 
133           // / </summar y>        
134           pu blic void  CreateRequ iredRecord s()        
135           {        
136                // All t he entity  records in  this samp le are cre ated in th e Run() me thod.        
137           }        
138          
139           // / <summary >        
140           // / Deletes  any entity  records t hat were c reated for  this samp le.        
141           // / <param n ame="promp t">Indicat es whether  to prompt  the user  to delete         
142           // / the reco rds create d in this  sample.</p aram>        
143           // / </summar y>        
144           pu blic void  DeleteRequ iredRecord s(bool pro mpt)        
145           {        
146                bool del eteRecords  = true;        
147          
148                if (prom pt)        
149                {        
150                    Cons ole.WriteL ine("\nDo  you want t hese entit y records  to be dele ted? (y/n) ");        
151                    Stri ng answer  = Console. ReadLine() ;        
152          
153                    dele teRecords  = (answer. StartsWith ("y") || a nswer.Star tsWith("Y" ));        
154                }        
155          
156                if (dele teRecords)        
157                {        
158                    _ser viceProxy. Delete(App ointment.E ntityLogic alName, _a ppointment Id);                         
159                    Cons ole.WriteL ine("Entit y records  have been  deleted.") ;        
160                }        
161           }        
162          
163           #e ndregion H ow To Samp le Code        
164          
165           #r egion Main        
166           // / <summary >        
167           // / Standard  Main() me thod used  by most SD K samples.        
168           // / </summar y>        
169           // / <param n ame="args" ></param>        
170           st atic publi c void Mai n(string[]  args)        
171           {        
172                try        
173                {        
174                    // O btain the  target org anization' s Web addr ess and cl ient logon          
175                    // c redentials  from the  user.        
176                    Serv erConnecti on serverC onnect = n ew ServerC onnection( );        
177                    Serv erConnecti on.Configu ration con fig = serv erConnect. GetServerC onfigurati on();        
178          
179                    Book Appointmen t app = ne w BookAppo intment();        
180                    app. Run(config , true);        
181                }        
182          
183                catch (F aultExcept ion<Micros oft.Xrm.Sd k.Organiza tionServic eFault> ex )        
184                {        
185                    Cons ole.WriteL ine("The a pplication  terminate d with an  error.");        
186                    Cons ole.WriteL ine("Times tamp: {0}" , ex.Detai l.Timestam p);        
187                    Cons ole.WriteL ine("Code:  {0}", ex. Detail.Err orCode);        
188                    Cons ole.WriteL ine("Messa ge: {0}",  ex.Detail. Message);        
189                    Cons ole.WriteL ine("Plugi n Trace: { 0}", ex.De tail.Trace Text);        
190                    Cons ole.WriteL ine("Inner  Fault: {0 }",        
191                         null == ex .Detail.In nerFault ?  "No Inner  Fault" :  "Has Inner  Fault");        
192                }        
193                catch (S ystem.Time outExcepti on ex)        
194                {        
195                    Cons ole.WriteL ine("The a pplication  terminate d with an  error.");        
196                    Cons ole.WriteL ine("Messa ge: {0}",  ex.Message );        
197                    Cons ole.WriteL ine("Stack  Trace: {0 }", ex.Sta ckTrace);        
198                    Cons ole.WriteL ine("Inner  Fault: {0 }",        
199                         null == ex .InnerExce ption.Mess age ? "No  Inner Faul t" : ex.In nerExcepti on.Message );        
200                }        
201                catch (S ystem.Exce ption ex)        
202                {        
203                    Cons ole.WriteL ine("The a pplication  terminate d with an  error.");        
204                    Cons ole.WriteL ine(ex.Mes sage);        
205          
206                    // D isplay the  details o f the inne r exceptio n.        
207                    if ( ex.InnerEx ception !=  null)        
208                    {        
209                         Console.Wr iteLine(ex .InnerExce ption.Mess age);        
210          
211                         FaultExcep tion<Micro soft.Xrm.S dk.Organiz ationServi ceFault> f e        
212                             = ex.I nnerExcept ion        
213                             as Fau ltExceptio n<Microsof t.Xrm.Sdk. Organizati onServiceF ault>;        
214                         if (fe !=  null)        
215                         {        
216                             Consol e.WriteLin e("Timesta mp: {0}",  fe.Detail. Timestamp) ;        
217                             Consol e.WriteLin e("Code: { 0}", fe.De tail.Error Code);        
218                             Consol e.WriteLin e("Message : {0}", fe .Detail.Me ssage);        
219                             Consol e.WriteLin e("Plugin  Trace: {0} ", fe.Deta il.TraceTe xt);        
220                             Consol e.WriteLin e("Inner F ault: {0}" ,        
221                                 nu ll == fe.D etail.Inne rFault ? " No Inner F ault" : "H as Inner F ault");        
222                         }        
223                    }        
224                }        
225                // Addit ional exce ptions to  catch: Sec urityToken Validation Exception,  ExpiredSe curityToke nException ,        
226                // Secur ityAccessD eniedExcep tion, Mess ageSecurit yException , and Secu rityNegoti ationExcep tion.        
227          
228                finally        
229                {        
230          
231                    Cons ole.WriteL ine("Press  <Enter> t o exit.");        
232                    Cons ole.ReadLi ne();        
233                }        
234          
235           }        
236           #e ndregion M ain        
237       }        
238   }        
239   //</snippe tBookAppoi ntment>