Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.21 KB | None | 0 0
  1. @HttpGet
  2. global static String doGet(){
  3. RestRequest req = RestContext.request;
  4. RestResponse res = RestContext.response;
  5. try{
  6. String UserId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
  7. System.debug('UserId:'+UserId);
  8. if(UserId =='' || UserId ==null) UserId = userinfo.getUserId();
  9. return getProfileDetails(UserId);
  10. }catch(Exception e){
  11. System.debug('Message1:'+e.getMessage());
  12. throw new CustomException(PG_Utils.getException(GENERIC_ERROR,GENERIC_ERROR_TYPE, CustomException__c.getValues('GEN0001').Error_Description__c));
  13. }
  14. }
  15.  
  16. @HttpPost
  17. global static String doPost(){
  18. RestRequest req = RestContext.request;
  19. RestResponse res = Restcontext.response;
  20.  
  21. Blob body = req.requestBody;
  22. System.debug('Test:'+body.toString());
  23.  
  24. UpdateProfile profiles = (UpdateProfile) System.JSON.deserialize(body.toString(), UpdateProfile.class);
  25. System.debug('Parsed Input:'+profiles);
  26.  
  27. if(profiles.UserId == '' || profiles.UserId == Null) profiles.UserId = UserInfo.getUserId();
  28. return updateProfileDetails(profiles);
  29. }
  30.  
  31. @HttpPut
  32. global static String doPut(){
  33. RestRequest req = RestContext.request;
  34. RestResponse res = Restcontext.response;
  35. Blob body = req.requestBody;
  36.  
  37. //Map<String, Object> m = (Map<String, Object>)System.JSON.deserialize(body.toString());
  38. //System.debug('m:'+m.get('action'));
  39. manageUser mu = (manageUser) System.JSON.deserialize(body.toString(), manageUser.class);
  40. System.debug('mu:'+mu);
  41. try{
  42. if(mu.action == 'setPassword')
  43. {
  44. String userid = mu.userId;
  45. String Password = mu.newPassword;
  46. if(userid =='' || userid == null) userid = UserInfo.getUserId();
  47.  
  48. if (Password == '' || Password == null) throw new customexception(PG_Utils.getException(USERPASSWORD,ERROR_TYPE,CustomException__c.getValues(USERPASSWORD).Error_Description__c));
  49. if(PG_Utils.IsValidPassword(Password)) throw new customexception(PG_Utils.getException(PASSWORD_ERROR,ERROR_TYPE,CustomException__c.getValues(PASSWORD_ERROR).Error_Description__c));
  50.  
  51. User user = [Select Id from user where Id =:userid ];
  52. try {
  53. System.setPassword(user.id, Password);
  54. }
  55. catch(Exception e){
  56. if(e.getMessage().contains('invalid repeated password')){
  57. throw new CustomException(PG_Utils.getException(USER_ERROR,GENERIC_ERROR_TYPE, 'Invalid repeated password'));
  58. }
  59. }
  60. JSONGenerator gen = JSON.createGenerator(true);
  61. gen.writeStartObject();
  62. gen.writeObjectField('Status','Success');
  63. gen.writeEndObject();
  64. String pretty = gen.getAsString();
  65. return pretty;
  66. }else if(mu.action == 'resetPassword'){
  67. String userid = mu.userId;
  68. String Password = mu.newPassword;
  69. if(userid =='' || userid == null) userid = UserInfo.getUserId();
  70.  
  71. if (Password == '' || Password == null) throw new customexception(PG_Utils.getException(USERPASSWORD,ERROR_TYPE,CustomException__c.getValues(USERPASSWORD).Error_Description__c));
  72. if(PG_Utils.IsValidPassword(Password)) throw new customexception(PG_Utils.getException(PASSWORD_ERROR,ERROR_TYPE,CustomException__c.getValues(PASSWORD_ERROR).Error_Description__c));
  73.  
  74. User user = [Select Id from user where Id =:userid ];
  75. try {
  76. System.setPassword(user.id, Password);
  77. }
  78. catch(Exception e){
  79. if(e.getMessage().contains('invalid repeated password')){
  80. throw new CustomException(PG_Utils.getException(USER_ERROR,GENERIC_ERROR_TYPE, 'Invalid repeated password'));
  81. }
  82. }
  83.  
  84. JSONGenerator gen = JSON.createGenerator(true);
  85. gen.writeStartObject();
  86. gen.writeObjectField('Status','Success');
  87. gen.writeEndObject();
  88. String pretty = gen.getAsString();
  89. return pretty;
  90. }
  91. }catch(Exception e){
  92. system.debug('errorrs'+e);
  93. return e.getMessage();
  94. }
  95. return null;
  96. }
  97.  
  98. global class manageUser{
  99. public String userId {get;set;}
  100. public String action {get;set;}
  101. public String newPassword {get;set;}
  102. }
  103.  
  104. global static String getProfileDetails(String UserId){
  105. try{
  106. List<Addresses> addresses = New List<Addresses>();
  107. List<Roles> roles = new List<Roles>();
  108. List<Pharmacy> pharmacy = new List<Pharmacy>();
  109. Set<ID> subRoleID = new Set<ID>();
  110.  
  111. List<User> users = [Select id, Title, FirstName, LastName, Email, Username, Country, MobilePhone, Fax, Phone, ContactID, AccountID, PG_SecretAnswer__c, PG_SecretQuestion__c, JE_Password__c, PG_TCAgreed__c, LanguageLocaleKey, LocaleSidKey, PG_SecretAnswerSalt__c, IsActive
  112. from User
  113. where Id =: UserID];
  114.  
  115. if(!users.isEmpty()){
  116. User user= users[0];
  117. Contact contact = [Select Id, Salutation, FirstName, LastName, Email, MobilePhone, Fax, OtherPhone, Preferred_Contact__c, MailingCity, MailingPostalCode, MailingStreet, OtherCity, otherPostalCode, OtherStreet, Account.PG_SoldTo__c, owner.Name, Owner.Email, ownerId,
  118. AccountId, Account.Name,Account.PG_PharmacyRegistrationNumber__c, Account.PG_JnJCustomerCode__c, Account.VAT_Number__c, Account.PG_Account__c, PG_ContactApprovalState__r.PG_ApprovalStatus__c , Account.BillingStreet,
  119. Account.BillingCity, Account.BillingPostalCode, Account.ShippingStreet, Account.ShippingCity, Account.ShippingPostalCode,Account.E_Commerce_Eligibility__c,
  120. (Select Account_ID__c, Account_ID__r.VAT_Number__c,Account_ID__r.Ownerid,Account_ID__r.Owner.Name,Account_ID__r.Owner.Email,Account_ID__r.PG_AccountType__c,Account_ID__r.Fax,Account_ID__r.Phone, Account_ID__r.PG_JnJCustomerCode__c, Account_ID__r.PG_PharmacyRegistrationNumber__c, Account_ID__r.BillingPostalCode, Account_ID__r.E_Commerce_Eligibility__c, Account_ID__r.PG_SoldTo__c, Account_ID__r.PG_Account__c, Account_ID__r.Name, Account_ID__r.BillingStreet, Account_ID__r.BillingCity, Account_ID__r.ShippingStreet, Account_ID__r.ShippingCity, Account_ID__r.ShippingPostalCode, Contact_ID__c, isPrimary__c, ApprovalState__c From Account_Affiliations__r) from Contact where Id =: user.ContactId];
  121.  
  122.  
  123. Map<ID,String> mapApproval = new Map<ID,String>();
  124. List<ID> ConID = new List<ID>();
  125. if(contact.Account_Affiliations__r.size()>0){
  126. for(Account_Affiliation__c af : contact.Account_Affiliations__r){
  127. Pharmacy pharma = new Pharmacy();
  128. List<Addresses> PhAddresses = New List<Addresses>();
  129.  
  130. pharma.ID = af.Account_ID__c;
  131. pharma.Name = af.Account_ID__r.Name;
  132. pharma.Status = af.ApprovalState__c;
  133. pharma.CustomerGroup = af.Account_ID__r.PG_SoldTo__c;
  134. pharma.IsPGAccount = af.Account_ID__r.PG_Account__c;
  135. pharma.Phone = af.Account_ID__r.Phone;
  136. pharma.PGAccountStatus=af.Account_ID__r.PG_AccountType__c;
  137. pharma.Fax = af.Account_ID__r.Fax;
  138. pharma.ABP_CIP = af.Account_ID__r.PG_PharmacyRegistrationNumber__c;
  139. pharma.EComm_Eligible = af.Account_ID__r.E_Commerce_Eligibility__c;
  140. pharma.Salesrep_ID=af.Account_ID__r.Ownerid;
  141. pharma.Salesrep_Name=af.Account_ID__r.Owner.Name;
  142. pharma.Salesrep_Email=af.Account_ID__r.Owner.Email;
  143.  
  144. /**** get Pharmacy Address ***/
  145. Addresses PhBillingAddress = new Addresses();
  146. PhBillingAddress.City = af.Account_ID__r.BillingCity;
  147. PhBillingAddress.PostalCode = af.Account_ID__r.BillingPostalCode;
  148. PhBillingAddress.StreetAddress = af.Account_ID__r.BillingStreet;
  149. PhBillingAddress.Type = 'billing';
  150. PhAddresses.add(PhBillingAddress);
  151.  
  152. Addresses PhShippingAddress = new Addresses();
  153. PhShippingAddress.City = af.Account_ID__r.ShippingCity;
  154. PhShippingAddress.PostalCode = af.Account_ID__r.ShippingPostalCode;
  155. PhShippingAddress.StreetAddress = af.Account_ID__r.ShippingStreet;
  156. PhShippingAddress.Type = 'shipping';
  157. PhAddresses.add(PhShippingAddress);
  158.  
  159. pharma.Address = PhAddresses;
  160. pharma.VATNumber = af.Account_ID__r.VAT_Number__c;
  161. if(af.isPrimary__c) { pharma.PrimaryPharmacyId = af.Account_ID__r.PG_PharmacyRegistrationNumber__c; }
  162. pharmacy.add(pharma);
  163. }
  164. }
  165.  
  166. /*** get Address Information ***/
  167. Addresses billingAddress = new Addresses();
  168. billingAddress.City = contact.MailingCity;
  169. billingAddress.PostalCode = contact.MailingPostalCode;
  170. billingAddress.StreetAddress = contact.MailingStreet;
  171. billingAddress.Type = 'billing';
  172. addresses.add(billingAddress);
  173.  
  174. Addresses shippingAddress = new Addresses();
  175. shippingAddress.City = contact.OtherCity;
  176. shippingAddress.PostalCode = contact.otherPostalCode;
  177. shippingAddress.StreetAddress = contact.OtherStreet;
  178. shippingAddress.Type = 'shipping';
  179. addresses.add(shippingAddress);
  180.  
  181. /*** get Role Information ***/
  182. List<PG_ContactUser__c> ContactUser = [Select PG_SubRole__c, Contact__c, PG_SubRole__r.Name,PG_SubRole__r.TranslationKey__c, PG_SubRole__r.ERP_Role__c
  183. From PG_ContactUser__c
  184. where Contact__c =: User.ContactId];
  185.  
  186. for(PG_ContactUser__c conUser :ContactUser)
  187. subRoleID.add(conUser.PG_SubRole__c);
  188.  
  189. List<PG_FunctionalityAccessPerSubRole__c> Function = [Select hasAccess__c, PG_SubRole__c,PG_Functionality__c, PG_Functionality__r.Name, PG_CountryLanguage__r.Name, Name From PG_FunctionalityAccessPerSubRole__c where PG_SubRole__c IN: subRoleID and hasAccess__c = true and PG_CountryLanguage__r.Name =: Userinfo.getLocale()];
  190. Map<ID, list<String>> mapFunctions = new Map<Id,List<String>>();
  191. for(ID ids : subRoleID){
  192. List<String> functionName = new List<String>();
  193. for(PG_FunctionalityAccessPerSubRole__c fun : Function){
  194. if(fun.PG_SubRole__c == ids) functionName.add(fun.PG_Functionality__r.Name);
  195. }
  196. mapFunctions.put(ids,functionName);
  197. }
  198.  
  199.  
  200. for(PG_ContactUser__c conUser :ContactUser){
  201. Roles role = new Roles();
  202. role.Name = conUser.PG_SubRole__r.Name;
  203. role.TranslationKey = conUser.PG_SubRole__r.TranslationKey__c;
  204. role.ERPRole = conUser.PG_SubRole__r.ERP_Role__c;
  205. role.Functions = mapFunctions.get(conUser.PG_SubRole__c);
  206. roles.add(role);
  207. }
  208.  
  209. profileDetails profDetails = new profileDetails();
  210. profDetails.Salutation = user.Title;
  211. profDetails.FirstName = user.FirstName;
  212. profDetails.LastName = user.LastName;
  213. profDetails.EmailAddress = user.Email;
  214. profDetails.Username = user.Username;
  215. profDetails.IsTermsAgreed = user.PG_TCAgreed__c;
  216. profDetails.Country = user.Country;
  217. profDetails.VATNumber = contact.Account.VAT_Number__c;
  218. profDetails.Phone = User.Phone;
  219. profDetails.Fax = User.Fax;
  220. profDetails.Mobile = User.MobilePhone;
  221. profDetails.PreferredContact = contact.Preferred_Contact__c;
  222. profDetails.PrimaryPharmacyId = contact.Account.PG_PharmacyRegistrationNumber__c;
  223. profDetails.UserLanguage = User.LanguageLocaleKey;
  224. profDetails.UserLocale = User.LocaleSidKey;
  225. profDetails.SaltValue = User.PG_SecretAnswerSalt__c;
  226. profDetails.SecretQuestion = User.PG_SecretQuestion__c;
  227. profDetails.SecretAnswer = User.PG_SecretAnswer__c;
  228. profDetails.Addresses = addresses;
  229. profDetails.Roles = roles;
  230. profDetails.Pharmacy = pharmacy;
  231. profDetails.IsActive = User.IsActive;
  232.  
  233. return json.serialize(profDetails);
  234. }else{
  235. throw new CustomException(PG_Utils.getException(USER_ERROR,GENERIC_ERROR_TYPE, CustomException__c.getValues('PC0001').Error_Description__c));
  236. }
  237. }catch(Exception e){
  238. System.debug('Message:'+e.getMessage());
  239. return e.getMessage();
  240. }
  241. return null;
  242. }
  243.  
  244. global static String updateProfileDetails(UpdateProfile profiles){
  245. try{
  246. System.debug('UserID:'+profiles.UserId);
  247. /** Adding a single user into list to support error handiling.
  248. If list not used system will stop the execution **/
  249.  
  250. List<User> users = [Select id, Title, FirstName, LastName, Email, Username, Country, MobilePhone, Fax, Phone, ContactID, AccountID, PG_SecretAnswer__c, PG_SecretQuestion__c,PG_SecretAnswerSalt__c, JE_Password__c, PG_TCAgreed__c, IsActive
  251. from User
  252. where Id =: profiles.UserID];
  253. if(!users.isEmpty()){
  254. User user= users[0];
  255.  
  256. Contact contact = [Select Id, Salutation, FirstName, LastName, Email, MobilePhone, Fax, OtherPhone, Preferred_Contact__c, MailingCity, MailingPostalCode, MailingStreet, OtherCity, otherPostalCode, OtherStreet, PG_ContactApprovalState__c, PG_ContactApprovalState__r.PG_ApprovalStatus__c,
  257. AccountId, Account.Name,Account.PG_PharmacyRegistrationNumber__c, Account.PG_JnJCustomerCode__c
  258. from Contact where Id =: user.ContactId];
  259. Account account = [Select Id, PG_JnJCustomerCode__c, VAT_Number__c, ownerID from Account where PG_JnJCustomerCode__c =:profiles.PrimaryPharmacyId];
  260.  
  261. /*** Update User & contact details ***/
  262. if(profiles.FirstName == null || profiles.FirstName == '')
  263. {
  264. throw new customexception(PG_Utils.getException(FIRST_NAME,ERROR_TYPE,CustomException__c.getValues(FIRST_NAME).Error_Description__c));
  265. }
  266. if(profiles.LastName == null || profiles.LastName == '')
  267. {
  268. throw new customexception(PG_Utils.getException(LAST_NAME,ERROR_TYPE,CustomException__c.getValues(LAST_NAME).Error_Description__c));
  269. }
  270. if(profiles.EmailAddress == null || profiles.EmailAddress == '')
  271. {
  272. throw new customexception(PG_Utils.getException(MAIL,ERROR_TYPE,CustomException__c.getValues(MAIL).Error_Description__c));
  273. }
  274. if(PG_Utils.IsValidEmailFormat(profiles.EmailAddress))
  275. {
  276. throw new customexception(PG_Utils.getException(INVALID_EMAIL,ERROR_TYPE,CustomException__c.getValues(INVALID_EMAIL).Error_Description__c));
  277. }
  278. if(profiles.FirstName != '' && profiles.FirstName != null) user.FirstName = profiles.FirstName;
  279. if(profiles.LastName != '' && profiles.LastName != null) user.LastName = profiles.LastName;
  280. if(profiles.Salutation != '' && profiles.Salutation != null) user.Title = profiles.Salutation;
  281. if(profiles.EmailAddress != '' && profiles.EmailAddress != null) user.Email = profiles.EmailAddress;
  282. if(profiles.Username != '' && profiles.Username != null) user.Username = profiles.Username;
  283. if(profiles.Country != '' && profiles.Country != null) user.Country = profiles.Country;
  284. if(profiles.Phone != '' && profiles.Phone != null) user.Phone = profiles.Phone;
  285. if(profiles.Fax != '' && profiles.Fax != null) user.Fax = profiles.Fax;
  286. if(profiles.Mobile != '' && profiles.Mobile != null) user.MobilePhone = profiles.Mobile;
  287. if(profiles.SecretQuestion != '' && profiles.SecretQuestion != null) user.PG_SecretQuestion__c = profiles.SecretQuestion;
  288. if(profiles.SecretAnswer != '' && profiles.SecretAnswer != null)
  289. {
  290. user.PG_SecretAnswerSalt__c = PG_GuidGenerator.generateSalt();
  291. Blob hash = Crypto.generateDigest('SHA-512', Blob.valueOf(profiles.SecretAnswer + user.PG_SecretAnswerSalt__c));
  292. user.PG_SecretAnswer__c = EncodingUtil.base64Encode(hash);
  293.  
  294. }
  295. if(profiles.UserLanguage != '' && profiles.UserLanguage != null) user.LanguageLocaleKey = profiles.UserLanguage;
  296. if(profiles.UserLanguage != '' && profiles.UserLocale != null) user.LocaleSidKey = profiles.UserLocale;
  297.  
  298. if(profiles.FirstName != '' && profiles.FirstName != null) contact.FirstName = profiles.FirstName;
  299. if(profiles.LastName != '' && profiles.LastName != null) contact.LastName = profiles.LastName;
  300. if(profiles.Salutation != '' && profiles.Salutation != null) contact.Salutation = profiles.Salutation;
  301. if(profiles.EmailAddress != '' && profiles.EmailAddress != null) contact.Email = profiles.EmailAddress;
  302. if(profiles.Phone != '' && profiles.Phone != null) contact.Phone = profiles.Phone;
  303. if(profiles.Fax != '' && profiles.Fax != null) contact.Fax = profiles.Fax;
  304. if(profiles.Mobile != '' && profiles.Mobile != null) contact.MobilePhone = profiles.Mobile;
  305. if(profiles.PreferredContact != '' && profiles.PreferredContact != null) contact.Preferred_Contact__c = profiles.PreferredContact;
  306. else if(profiles.PreferredContact == '' && profiles.PreferredContact == null) contact.Preferred_Contact__c = '';
  307.  
  308. if(profiles.PrimaryPharmacyId != '' && profiles.PrimaryPharmacyId != null)
  309. {
  310. contact.AccountId = account.Id;
  311. contact.OwnerId = account.OwnerId;
  312. }
  313. /*** Commented on 20th October because no user inactive facillity is available ***/
  314. //if(profiles.IsActive == false) user.IsActive = false;
  315. /*** update Address information ***/
  316.  
  317. for(Addresses add : profiles.Addresses){
  318. System.debug('address:'+add);
  319. if(add.Type == 'billing'){
  320. if(add.City != null && add.City != '') contact.MailingCity = add.City;
  321. if(add.PostalCode != null && add.PostalCode != '') contact.MailingPostalCode = add.PostalCode;
  322. if(add.StreetAddress != null && add.StreetAddress != '') contact.MailingStreet = add.StreetAddress;
  323. }else if(add.Type == 'shipping'){
  324. if(add.City != null && add.City != '') contact.OtherCity = add.City;
  325. if(add.PostalCode != null && add.PostalCode != '') contact.OtherPostalCode = add.PostalCode;
  326. if(add.StreetAddress != null && add.StreetAddress != '') contact.OtherStreet = add.StreetAddress;
  327. }
  328. }
  329. if(profiles.IsActive != false){
  330. update user;
  331. update contact;
  332. }else{
  333. update user;
  334. }
  335.  
  336. ProfileDetails pro = (ProfileDetails) Json.deserialize(getProfileDetails(profiles.UserID), ProfileDetails.class);
  337. System.debug('ProfileDeails:'+ pro);
  338. updatedProfile up = new updatedProfile(pro.Salutation, pro.FirstName, pro.LastName, pro.EmailAddress, pro.Username, pro.IsTermsAgreed, pro.Country, pro.VATNumber, pro.Phone, pro.Fax, pro.Mobile, pro.PreferredContact, pro.PrimaryPharmacyId, pro.UserLanguage, pro.UserLocale, pro.IsActive, pro.Addresses, pro.Pharmacy, pro.Roles, 'Success');
  339. return json.serialize(up);
  340. }else{
  341. throw new CustomException(PG_Utils.getException(USER_ERROR,GENERIC_ERROR_TYPE, CustomException__c.getValues('PC0001').Error_Description__c));
  342. }
  343.  
  344. }catch(Exception e){
  345. return e.getMessage();
  346. }
  347. return null;
  348. }
  349.  
  350. global class ProfileDetails{
  351. public String Salutation {get;set;}
  352. public String FirstName {get;set;}
  353. public String LastName {get;set;}
  354. public String EmailAddress {get;set;}
  355. public String Username {get;set;}
  356. public Boolean IsTermsAgreed {get;set;}
  357. public String Country {get;set;}
  358. public String VATNumber {get;set;}
  359. public String Phone {get;set;}
  360. public String Fax {get;set;}
  361. public String Mobile {get;set;}
  362. public String PreferredContact {get;set;}
  363. public String PrimaryPharmacyId {get;set;}
  364. public String UserLanguage {get;set;}
  365. public String UserLocale {get;set;}
  366. public String SaltValue {get;set;}
  367. public String SecretQuestion {get;set;}
  368. public String SecretAnswer {get;set;}
  369. public Boolean IsActive {get;set;}
  370. public List<Addresses> Addresses {get;set;}
  371. public List<Pharmacy> Pharmacy {get;set;}
  372. public List<Roles> Roles {get;set;}
  373.  
  374. public profileDetails(){ }
  375.  
  376. public profileDetails(String Salutation, String FirstName, String LastName, String EmailAddress, String Username, Boolean IsTermsAgreed, String Country, String VATNumber, String Phone, String Fax, String Mobile, String PreferredContact, String PrimaryPharmacyId, String UserLanguage, String UserLocale, String SaltValue, String SecretQuestion, String SecretAnswer, Boolean IsActive, List<Addresses> Addresses, List<Pharmacy> Pharmacy, List<Roles> Roles){
  377. this.Salutation = Salutation;
  378. this.FirstName = FirstName;
  379. this.LastName = LastName;
  380. this.EmailAddress = EmailAddress;
  381. this.Username = Username;
  382. this.IsTermsAgreed = IsTermsAgreed;
  383. this.Country = Country;
  384. this.VATNumber = VATNumber;
  385. this.Phone = Phone;
  386. this.Fax = Fax;
  387. this.Mobile = Mobile;
  388. this.PreferredContact = PreferredContact;
  389. this.PrimaryPharmacyId = PrimaryPharmacyId;
  390. this.UserLanguage = UserLanguage;
  391. this.UserLocale = UserLocale;
  392. this.SaltValue = SaltValue;
  393. this.SecretQuestion = SecretQuestion;
  394. this.SecretAnswer = SecretAnswer;
  395. this.IsActive = IsActive;
  396. this.Addresses = Addresses;
  397. this.Pharmacy = Pharmacy;
  398. this.Roles = Roles;
  399.  
  400. }
  401. }
  402.  
  403. global class updatedProfile{
  404. public String Salutation {get;set;}
  405. public String FirstName {get;set;}
  406. public String LastName {get;set;}
  407. public String EmailAddress {get;set;}
  408. public String Username {get;set;}
  409. public Boolean IsTermsAgreed {get;set;}
  410. public String Country {get;set;}
  411. public String VATNumber {get;set;}
  412. public String Phone {get;set;}
  413. public String Fax {get;set;}
  414. public String Mobile {get;set;}
  415. public String PreferredContact {get;set;}
  416. public String PrimaryPharmacyId {get;set;}
  417. public String UserLanguage {get;set;}
  418. public String UserLocale {get;set;}
  419. public Boolean IsActive {get;set;}
  420. public List<Addresses> Addresses {get;set;}
  421. public List<Pharmacy> Pharmacy {get;set;}
  422. public List<Roles> Roles {get;set;}
  423. public String Status {get;set;}
  424.  
  425. public updatedProfile(){ }
  426.  
  427. public updatedProfile(String Salutation, String FirstName, String LastName, String EmailAddress, String Username, Boolean IsTermsAgreed, String Country, String VATNumber, String Phone, String Fax, String Mobile, String PreferredContact, String PrimaryPharmacyId, String UserLanguage, String UserLocale, Boolean IsActive, List<Addresses> Addresses, List<Pharmacy> Pharmacy, List<Roles> Roles, String Status){
  428. this.Salutation = Salutation;
  429. this.FirstName = FirstName;
  430. this.LastName = LastName;
  431. this.EmailAddress = EmailAddress;
  432. this.Username = Username;
  433. this.IsTermsAgreed = IsTermsAgreed;
  434. this.Country = Country;
  435. this.VATNumber = VATNumber;
  436. this.Phone = Phone;
  437. this.Fax = Fax;
  438. this.Mobile = Mobile;
  439. this.PreferredContact = PreferredContact;
  440. this.PrimaryPharmacyId = PrimaryPharmacyId;
  441. this.UserLanguage = UserLanguage;
  442. this.UserLocale = UserLocale;
  443. this.IsActive = IsActive;
  444. this.Addresses = Addresses;
  445. this.Pharmacy = Pharmacy;
  446. this.Roles = Roles;
  447. this.Status = Status;
  448. }
  449. }
  450.  
  451. global class Addresses{
  452. public String StreetAddress {get;set;}
  453. public String City {get;set;}
  454. public String PostalCode {get;set;}
  455. public String Type {get;set;}
  456. public Addresses(){ }
  457. public Addresses(String Addresses, String City, String PostalCode, String Type){
  458. this.StreetAddress = StreetAddress;
  459. this.City = City;
  460. this.PostalCode = PostalCode;
  461. this.Type = Type;
  462. }
  463. }
  464.  
  465. global class Roles{
  466. public String Name {get;set;}
  467. public String TranslationKey {get;set;}
  468. public String ERPRole {get;set;}
  469. public List<String> Functions {get;set;}
  470. public Roles(){ }
  471. public Roles(String Name, String TranslationKey, String ERPRole, List<String> Functions){
  472. this.Name = Name;
  473. this.TranslationKey = TranslationKey;
  474. this.ERPRole = ERPRole;
  475. this.Functions = Functions;
  476. }
  477. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement