public bool ProcessRequest(GetParentChildAssociationRequest objParentChildAssociationRequest, GetParentChildAssociationResponse objParentChildAssociationResponse) { bool flag = false; try { //ASSIGNING ID'S objParentChildAssociationResponse.RequestID = objParentChildAssociationRequest.RequestID; objParentChildAssociationResponse.ResponseID = objParentChildAssociationRequest.RequestID; //validateRequest() if (objParentChildAssociationRequest.SNum.Length > 0) { SNumsAssociation[] association = new SNumsAssociation[objParentChildAssociationRequest.SNum.Length]; string[] arrCommaSeparatedSN = new string[objParentChildAssociationRequest.SNum.Length]; #region Tracing Start Code objTraceLogger = new PerformanceTraceLogger(objParentChildAssociationRequest.RequestID, "GetParentChildAssociation", "Getting SNum Mac Tree", objParentChildAssociationRequest.SNum.Length); if (objTraceLogger.IsEnable) { objTraceLogger.StartTrace(); } #endregion DataSet objMfgDS = null; for (int i = 0; i < association.Length; i++) { association[i] = new SNumsAssociation(); association[i].SNum = objParentChildAssociationRequest.SNum[i]; string commaSepIndividualSN = ""; //get Snum & Mac tree objMfgDS = GetSNumMacTree(objParentChildAssociationRequest.SNum[i]); //populate SNumList association[i].SNumList = GetSNumsList(objMfgDS, ref commaSepIndividualSN); association[i].Message = ""; association[i].Status = 0; arrCommaSeparatedSN[i] = commaSepIndividualSN; } #region Tracing End Code if (objTraceLogger.IsEnable) { objTraceLogger.EndTrace(); } #endregion //For each associate //go through SnumList array and create comma separated string of SNum //call objBL.GetLicenseDataTree(objDS); //from DS #region Tracing Start Code objTraceLogger = new PerformanceTraceLogger(objParentChildAssociationRequest.RequestID, "GetParentChildAssociation", "GetLicenseAndSKUData", objParentChildAssociationRequest.SNum.Length); if (objTraceLogger.IsEnable) { objTraceLogger.StartTrace(); } #endregion for (int i = 0; i < association.Length; i++) { DataSet objCryptoLgrDS = null; //pass ds to cryptologger and get license data //passing comma separated serial numbers for individual association //comma separated includes the input snum too //below method fetches two resultsets - //1) distinct skus with latest date from license key table //2) second resultset gets all sku details including version objCryptoLgrDS = GetLicenseAndSKUData(arrCommaSeparatedSN[i]); //This method calls common bl method which gets sku details association[i].SNumList = UpdateSNArrayWithLicenseAndSKU(objCryptoLgrDS, association[i].SNumList); } #region Tracing End Code if (objTraceLogger.IsEnable) { objTraceLogger.EndTrace(); } #endregion objParentChildAssociationResponse.Association = association; } else { objParentChildAssociationResponse.ResponseStatus = (int)Constants.ResponseStatus.InvalidParameter; objParentChildAssociationResponse.ResponseMessage = Constants.ResponseStatus.InvalidParameter.ToString(); } flag = true; } catch (Exception ex) { throw new Exception("Error In Get Parent Child Association. " + ex.Message); } return(flag); }
public bool ProcessRequest(GetSNHierarchyRequest objGetSNHierarchyRequest, GetSNHierarchyResponse objGetSNHierarchyResponse) { bool flag = false; try { //ASSIGNING ID'S objGetSNHierarchyResponse.RequestID = objGetSNHierarchyRequest.RequestID; objGetSNHierarchyResponse.ResponseID = objGetSNHierarchyRequest.RequestID; //validateRequest() if (objGetSNHierarchyRequest.SNum.Length > 0) { SNumsAssociationSN[] association = new SNumsAssociationSN[objGetSNHierarchyRequest.SNum.Length]; string[] arrCommaSeparatedSN = new string[objGetSNHierarchyRequest.SNum.Length]; #region Tracing Start Code objTraceLogger = new PerformanceTraceLogger(objGetSNHierarchyRequest.RequestID, "GetParentChildAssociation", "Getting SNum Mac Tree For GetSNHierarchyRequest", objGetSNHierarchyRequest.SNum.Length); if (objTraceLogger.IsEnable) { objTraceLogger.StartTrace(); } #endregion DataSet objMfgDS = null; for (int i = 0; i < association.Length; i++) { association[i] = new SNumsAssociationSN(); association[i].SNum = objGetSNHierarchyRequest.SNum[i]; string commaSepIndividualSN = ""; //get Snum & Mac tree objMfgDS = GetSNumMacTreeForSNHierarchy(objGetSNHierarchyRequest.SNum[i]); //populate SNumList association[i].SNumList = GetSNumsList(objMfgDS, ref commaSepIndividualSN); association[i].Message = "Success"; association[i].Status = 0; arrCommaSeparatedSN[i] = commaSepIndividualSN; } #region Tracing End Code if (objTraceLogger.IsEnable) { objTraceLogger.EndTrace(); } #endregion objGetSNHierarchyResponse.Association = association; } else { objGetSNHierarchyResponse.ResponseStatus = (int)Constants.ResponseStatus.InvalidParameter; objGetSNHierarchyResponse.ResponseMessage = Constants.ResponseStatus.InvalidParameter.ToString(); } flag = true; } catch (Exception ex) { throw new Exception("Error In GetSNHierarchy Method. " + ex.Message); } return(flag); }