/// <summary> /// Gets the well event request object. /// </summary> /// <param name="filterCriterias">The filter criterias.</param> /// <param name="includeFilterOptions">if set to <c>true</c> [include filter options].</param> /// <returns></returns> private RequestInfo GetWellEventRequestObject(ArrayList filterCriterias, bool includeFilterOptions) { Attributes objAttribute = null; objRequestInfo = new RequestInfo(); Entity objEntity = new Entity(); objEntity.Property = true; objEntity.ResponseType = TABULAR; ArrayList arlAttribute = new ArrayList(); arlAttribute = objEntity.Attribute; if(arlAttribute == null) arlAttribute = new ArrayList(); AddIdentifierAttribute(arlAttribute);//DREAM 4.0 if(includeFilterOptions) { AttributeGroup objAttributeGroup = new AttributeGroup(); objAttributeGroup.Operator = ANDOPERATOR; objAttributeGroup.Attribute = new ArrayList(); string strFilter; string strFilterVal; foreach(string strVal in filterCriterias) { strFilter = strVal.Split("#".ToCharArray())[0]; strFilterVal = strVal.Split("#".ToCharArray())[1]; objAttribute = new Attributes(); objAttribute.Name = strFilter; if(string.Equals(strFilter, PRIORITY)) { if(strFilterVal.Split(";".ToCharArray()).Length > 1) { objAttribute.Operator = INOPERATOR; foreach(string strFilVal in strFilterVal.Split(";".ToCharArray())) { if(!string.IsNullOrEmpty(strFilVal)) { objAttribute = AddValue(objAttribute, strFilVal); } } } else { objAttribute.Operator = LIKEOPERATOR; objAttribute = AddValue(objAttribute, strFilterVal); } } else { objAttribute.Operator = LIKEOPERATOR; objAttribute = AddValue(objAttribute, strFilterVal); } if(!arlAttribute.Contains(objAttribute)) { arlAttribute.Add(objAttribute); } } objAttributeGroup.Attribute = arlAttribute; objEntity.AttributeGroups = new ArrayList(); if(!objEntity.AttributeGroups.Contains(objAttributeGroup)) { objEntity.AttributeGroups.Add(objAttributeGroup); } } else { objEntity.Attribute = arlAttribute; } objRequestInfo.Entity = objEntity; return objRequestInfo; }
/// <summary> /// Sets the entity. /// </summary> /// <param name="arrFields">The arr fields.</param> /// <param name="lbControl">The lb control.</param> /// <returns></returns> private Entity SetEntity(ArrayList fieldsGroup) { Entity objEntity = new Entity(); AttributeGroup objBasicAttributeGroup = new AttributeGroup(); if(fieldsGroup.Count > 1) { ArrayList arlBasicAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); objBasicAttributeGroup.Operator = GetLogicalOperator(); //Loop through the items in the FieldsGroup. foreach(ListBox lbItem in fieldsGroup) { Attributes objAttribute = new Attributes(); objAttribute.Name = GetControlID(lbItem.ID); ArrayList arrValue = new ArrayList(); for(int intCounter = 0; intCounter < lbItem.Items.Count; intCounter++) { if(lbItem.Items[intCounter].Selected) { Value objValue = new Value(); objValue.InnerText = lbItem.Items[intCounter].Value; arrValue.Add(objValue); } } if(arrValue.Count == 0) { Value objValue = new Value(); objValue.InnerText = AMPERSAND; arrValue.Add(objValue); } objAttribute.Value = arrValue; objAttribute.Operator = GetOperator(objAttribute.Value); arlAttribute.Add(objAttribute); } objBasicAttributeGroup.Attribute = arlAttribute; arlBasicAttributeGroup.Add(objBasicAttributeGroup); objEntity.AttributeGroups = arlBasicAttributeGroup; objEntity.Criteria = SetCriteria(); } else if(fieldsGroup.Count == 1) { ArrayList arlBasicAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); Attributes objAttribute = new Attributes(); objBasicAttributeGroup.Operator = GetLogicalOperator(); objAttribute.Name = GetControlID(lstCountry.ID); ArrayList arlValue = new ArrayList(); for(int intCounter = 0; intCounter < lstCountry.Items.Count; intCounter++) { if(lstCountry.Items[intCounter].Selected) { Value objValue = new Value(); objValue.InnerText = lstCountry.Items[intCounter].Value; arlValue.Add(objValue); } } objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); arlAttribute.Add(objAttribute); objEntity.Attribute = arlAttribute; objEntity.Criteria = SetCriteria(); } else { objEntity.Criteria = SetCriteria(); } return objEntity; }
/// <summary> /// Sets the entity. /// </summary> /// <param name="fieldsGroup">The fields group.</param> /// <param name="userEnteredValue">The User Entered Value</param> /// <param name="attributename">The attributename.</param> /// <param name="entityname">The entityname.</param> /// <returns></returns> private Entity SetEntity(ArrayList fieldsGroup, string userEnteredValue, string attributename, string entityname) { Entity objEntity = new Entity(); if(fieldsGroup.Count == 1 && fieldsGroup[0] != null) { Control radControl = (Control)fieldsGroup[0]; ArrayList arlAttribute = new ArrayList(); Attributes objAttribute = new Attributes(); objAttribute.Name = attributename; ArrayList arlValue = new ArrayList(); Value objValue = new Value(); objValue.InnerText = userEnteredValue; arlValue.Add(objValue); objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); arlAttribute.Add(objAttribute); objEntity.Attribute = arlAttribute; objEntity.Criteria = SetCriteria(); objEntity.Name = entityname; } else { objEntity.Criteria = SetCriteria(); } return objEntity; }
/// <summary> /// Adds the attribute. /// </summary> /// <param name="name">The name.</param> /// <param name="operation">The operation.</param> /// <param name="values">The values.</param> /// <returns></returns> protected Attributes AddAttribute(string name, string operation, string[] values) { Attributes objAttribute = new Attributes(); objAttribute.Value = new ArrayList(); Value objValue = null; objAttribute.Name = name; objAttribute.Operator = operation; foreach(string strValue in values) { if(!string.IsNullOrEmpty(strValue.Trim())) { objValue = new Value(); objValue.InnerText = strValue.Trim(); objAttribute.Value.Add(objValue); } } return objAttribute; }
private ArrayList GetDepositionalAttribute(ArrayList arlAttribute) { ShellEntities.Attributes objAttribute = new ShellEntities.Attributes(); ArrayList arlValue = new ArrayList(); /// Change the Attribute.Name property /// Name will vary based on the selected Depositional level /// This value is return from Depositional Popup along with selected value and stored in hidDepositionalColumn control if (!string.IsNullOrEmpty(hidDepositionalColumn.Value) && !string.IsNullOrEmpty(txtDepositionalEnv.Text.Trim()) && !string.IsNullOrEmpty(hidDepositionalValue.Value)) { /// If Search Click, include attribute only for the selected Depositional environment level and value /// Read value from hidDepositionalValue Hidden field, not from txtDepositionalEnv since it shows only display value if (txtDepositionalEnv.Text.Trim().Length > 0) { objAttribute.Name = hidDepositionalColumn.Value; arlValue.Add(SetValue(hidDepositionalValue.Value.Trim())); objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); /// Fixed by Yasotha /// Without lable name, gives "object reference" error in SearchResults.cs - GetSRPAdvanceSearchRequestXML objAttribute.Label = "none"; arlAttribute.Add(objAttribute); } if (!blnSearchClick) { if (hidDepositionalValue.Value.Trim().Length > 0) { objAttribute = new ShellEntities.Attributes(); arlValue = new ArrayList(); /// Selected Depositional Selected Value attribute objAttribute.Name = GetNodeIDFromControl(hidDepositionalValue.ID); arlValue.Add(SetValue(hidDepositionalValue.Value.Trim())); objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); objAttribute.Label = hidDepositionalValue.ID; objAttribute.Checked = "Exclude"; arlAttribute.Add(objAttribute); } if (hidDepositionalColumn.Value.Trim().Length > 0) { objAttribute = new ShellEntities.Attributes(); arlValue = new ArrayList(); /// Selected Depositional Selected Column attribute objAttribute.Name = GetNodeIDFromControl(hidDepositionalColumn.ID); arlValue.Add(SetValue(hidDepositionalColumn.Value.Trim())); objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); objAttribute.Label = hidDepositionalColumn.ID; objAttribute.Checked = "Exclude"; arlAttribute.Add(objAttribute); } if (txtDepositionalEnv.Text.Trim().Length > 0) { /// Selected Depositional Selected Display attribute arlAttribute = SetUITextControls(txtDepositionalEnv, arlAttribute); if (arlAttribute != null && arlAttribute.Count > 0) { ((ShellEntities.Attributes)arlAttribute[arlAttribute.Count - 1]).Checked = "Exclude"; } } } } return arlAttribute; }
/// <summary> /// Adds the attribute. /// </summary> /// <param name="attName">Name of the att.</param> /// <param name="attOperator">The att operator.</param> /// <param name="valInnerText">The val inner text.</param> /// <returns></returns> private Attributes addAttribute(string attName, string attOperator, string valInnerText) { Attributes objAttribute = new Attributes(); objAttribute.Name = attName.ToString(); objAttribute.Operator = attOperator.ToString(); objAttribute.Value = new ArrayList(); Value objVal = new Value(); objVal.InnerText = valInnerText.ToString(); objAttribute.Value.Add(objVal); return objAttribute; }
/// <summary> /// Sets the atribute. /// </summary> /// <returns></returns> private ArrayList SetAtribute() { ArrayList arlAttribute = new ArrayList(); ArrayList arlValue = new ArrayList(); Attributes objDetail = new Attributes(); objDetail.Name = Criteria; /// Loop through all the values in CriteriaValue object. foreach(string strAttributeValue in CriteriaValue) { if(!string.IsNullOrEmpty(strAttributeValue.Trim())) { if(!arlValue.Contains(strAttributeValue.Trim())) { arlValue.Add(SetValue(strAttributeValue.Trim())); } } } objDetail.Value = arlValue; objDetail.Operator = GetOperator(objDetail.Value); arlAttribute.Add(objDetail); return arlAttribute; }
/// <summary> /// Adds the picks filter criteria. /// </summary> private void AddPicksFilterCriteria() { ArrayList arlAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); AttributeGroup objAttributeGroup = new AttributeGroup(); /// Initializes the attribute objects and set the values Attributes objPicksFilterAttribute = new Attributes(); objPicksFilterAttribute.Name = GEOLOGICFEATURE; objPicksFilterAttribute.Value = new ArrayList(); Value objValue = new Value(); if(strPicksFilter.Equals(SELECTALL)) { objValue.InnerText = STAROPERATOR; } else { objValue.InnerText = strPicksFilter; } objPicksFilterAttribute.Value.Add(objValue); objPicksFilterAttribute.Operator = GetOperator(objPicksFilterAttribute.Value); /// Adds the attribute object to the attribute Group. arlAttribute.Add(objRequestInfo.Entity.Attribute[0]); objRequestInfo.Entity.Attribute = null; arlAttribute.Add(objPicksFilterAttribute); objAttributeGroup.Operator = ANDOPERATOR; objAttributeGroup.Attribute = arlAttribute; arlAttributeGroup.Add(objAttributeGroup); objRequestInfo.Entity.AttributeGroups = arlAttributeGroup; }
/// <summary> /// Creates the EP request info. /// </summary> /// <param name="assetType">Type of the asset.</param> /// <param name="identifiers">The identifiers.</param> /// <returns></returns> private RequestInfo CreateEPRequestInfo(string assetType, string identifiers) { Entity objEntity; RequestInfo objRequestInfo; objRequestInfo = new RequestInfo(); objEntity = new Entity(); objEntity.ResponseType = TABULAR; objEntity.AttributeGroups = new ArrayList(); AttributeGroup objAttributeGrp = new AttributeGroup(); objAttributeGrp.Operator = ANDOPERATOR; objAttributeGrp.Attribute = new ArrayList(); /// Adding asset value if(!string.IsNullOrEmpty(identifiers)) { string strPattern = @"\r\n"; Regex fixMe = new Regex(strPattern); string strTrimmedMyAssetValues = fixMe.Replace(identifiers, string.Empty); string[] arrAssetVal = strTrimmedMyAssetValues.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); Attributes objAssetValue = new Attributes(); objAssetValue.Name = ASSET; objAssetValue.Value = new ArrayList(); foreach(string strAssetVal in arrAssetVal) { Value objVal = new Value(); objVal.InnerText = strAssetVal.Trim(); objAssetValue.Value.Add(objVal); } objAssetValue.Operator = GetOperator(objAssetValue.Value); objAttributeGrp.Attribute.Add(objAssetValue); } //Adding country attribute //DREAM4.0 //Start AddCountryAttribute(objAttributeGrp.Attribute); //end objEntity.AttributeGroups.Add(objAttributeGrp); objRequestInfo.Entity = objEntity; return objRequestInfo; }
/// <summary> /// Sets the attribute node for request xml. /// </summary> /// <returns></returns> private ArrayList SetQuickAttribute() { ArrayList arlAttribute = new ArrayList(); try { ArrayList arlValue = new ArrayList(); if(List.Length > 0) { string strIdentifiedValues = string.Empty; string[] arrIdentifierValue = new string[1]; Attributes objAttribute = new Attributes(); //this will set the SelectedCriteria name and selected rows values from hidden fields objAttribute.Name = HttpContext.Current.Request.Form["hidSelectedCriteriaName"].ToString().Trim(); strIdentifiedValues = HttpContext.Current.Request.Form["hidSelectedRows"].ToString(); arrIdentifierValue = strIdentifiedValues.Split('|'); //Loop through the Selected Identifier Values foreach(string strAttributeValue in arrIdentifierValue) { int checkDuplicate = 0; //validates the attribute value. if(strAttributeValue.Trim().Length > 0) { foreach(Value objValue in arlValue) { if(string.Equals(strAttributeValue.Trim(), objValue.InnerText.ToString())) { checkDuplicate++; } } if(checkDuplicate == 0) { arlValue.Add(SetValue(strAttributeValue.Trim())); } } } objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); arlAttribute.Add(objAttribute); } else { if(!string.Equals(Asset, "Basin")) { Attributes objCountry = new Attributes(); //the below condition check the selected option for country. if(string.Equals(Country.ToUpper().Trim(), ANYCOUNTRYQUERYSTRING)) { objCountry.Name = COUNTRYNAME; arlValue = ReadActiveCountriesList(); //for 'ANYCOUNTRY' read all active countries from SPList objCountry.Value = arlValue; objCountry.Operator = GetOperator(objCountry.Value); } else { objCountry.Name = COUNTRYNAME; arlValue.Add(SetValue(Country)); objCountry.Value = arlValue; objCountry.Operator = GetOperator(objCountry.Value); } arlAttribute.Add(objCountry); } else { //**Dream 3.1 fix /*ArrayList arlActiveBasinList = new ArrayList(); arlActiveBasinList = GetActiveBasin(); Attributes objBasin = new Attributes(); objBasin.Name = BASIN; if (arlActiveBasinList.Count != 0) { //Loop through the basin list. foreach (String strActiveBasin in arlActiveBasinList) { arlValue.Add(SetValue(strActiveBasin)); } } else { arlValue.Add(SetValue("*")); } objBasin.Value = arlValue; objBasin.Operator = GetOperator(objBasin.Value); arlAttribute.Add(objBasin);*/ } } } catch(Exception) { throw; } return arlAttribute; }
/// <summary> /// Adds the data preference attribute. /// </summary> private void AddDataPreferenceAttribute() { if(cboDataPreference != null) { if(!cboDataPreference.SelectedValue.ToLowerInvariant().Equals("show all")) { ArrayList arlAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); AttributeGroup objAttributeGroup = new AttributeGroup(); /// Initializes the attribute objects and set the values Attributes objDataPrefAttribute = new Attributes(); objDataPrefAttribute.Name = PREFERREDFLAG; objDataPrefAttribute.Value = new ArrayList(); Value preferredValue = new Value(); if(cboDataPreference.SelectedValue.ToLowerInvariant().Equals("preferred data")) { preferredValue.InnerText = "true"; } else { preferredValue.InnerText = "false"; } objDataPrefAttribute.Value.Add(preferredValue); objDataPrefAttribute.Operator = GetOperator(objDataPrefAttribute.Value); /// Adds the attribute object to the attribute Group. arlAttribute.Add(objRequestInfo.Entity.Attribute[0]); objRequestInfo.Entity.Attribute = null; arlAttribute.Add(objDataPrefAttribute); objAttributeGroup.Operator = ANDOPERATOR; objAttributeGroup.Attribute = arlAttribute; arlAttributeGroup.Add(objAttributeGroup); objRequestInfo.Entity.AttributeGroups = arlAttributeGroup; } } }
/// <summary> /// Creates an Attribute Object /// </summary> /// <param name="criteriaName"></param> /// <param name="operatorValue"></param> /// <param name="criteriaValue"></param> /// <returns></returns> private Attributes CreateAttribute(string criteriaName, string operatorValue, string criteriaValue) { Attributes objAttribute = new Attributes(); objAttribute.Name = criteriaName; objAttribute.Operator = operatorValue; objAttribute.Value = CreateValue(criteriaValue); return objAttribute; }
/// <summary> /// Sets the date attribute. /// </summary> /// <returns></returns> private ArrayList SetDateAttribute() { ArrayList arrDate = new ArrayList(); if(rdoRbDate.Items[0].Selected) { ArrayList arrSpudDate = new ArrayList(); AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); objFirstChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objFromSpudDate = new Attributes(); objFromSpudDate.Name = SPUDDATE; objFromSpudDate.Label = txtFrom.ID; objFromSpudDate.Operator = GetDateOperator(FROM); objFromSpudDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrSpudDate.Add(objFromSpudDate); Attributes objToSpudDate = new Attributes(); objToSpudDate.Name = SPUDDATE; objToSpudDate.Label = txtTo.ID; objToSpudDate.Operator = GetDateOperator(TO); objToSpudDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrSpudDate.Add(objToSpudDate); objFirstChildAttributeGroup.Attribute = arrSpudDate; arrDate.Add(objFirstChildAttributeGroup); ArrayList arrKickOffDate = new ArrayList(); AttributeGroup objSecondChildAttributeGroup = new AttributeGroup(); objSecondChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objFromKickOffDate = new Attributes(); objFromKickOffDate.Name = KICKOFFDATE; objFromKickOffDate.Operator = GetDateOperator(FROM); objFromKickOffDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrKickOffDate.Add(objFromKickOffDate); Attributes objToKickOffDate = new Attributes(); objToKickOffDate.Name = KICKOFFDATE; objToKickOffDate.Operator = GetDateOperator(TO); objToKickOffDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrKickOffDate.Add(objToKickOffDate); objSecondChildAttributeGroup.Attribute = arrKickOffDate; arrDate.Add(objSecondChildAttributeGroup); } else { AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); ArrayList arrCompletionDate = new ArrayList(); Attributes objFromCompletionDate = new Attributes(); #region DREAM 4.0 /// Requirement: Separate Well and Wellbore Advance search screens /// Changed By: Yasotha /// Date : 19-Jan-2010 objFromCompletionDate.Name = COMPLETIONDATE; #endregion objFromCompletionDate.Label = txtFrom.ID; objFromCompletionDate.Operator = GREATERTHANEQUALS; objFromCompletionDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrCompletionDate.Add(objFromCompletionDate); Attributes objToCompletionDate = new Attributes(); #region DREAM 4.0 /// Requirement: Separate Well and Wellbore Advance search screens /// Changed By: Yasotha /// Date : 19-Jan-2010 objToCompletionDate.Name = COMPLETIONDATE; #endregion objToCompletionDate.Label = txtTo.ID; objToCompletionDate.Operator = LESSTHANEQUALS; objToCompletionDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrCompletionDate.Add(objToCompletionDate); objFirstChildAttributeGroup.Attribute = arrCompletionDate; objFirstChildAttributeGroup.Operator = GetLogicalOperator(); arrDate.Add(objFirstChildAttributeGroup); } return arrDate; }
/// <summary> /// Sets the UI text controls. /// </summary> /// <param name="attributeName">Name of the attribute.</param> /// <param name="attributeValue">The attribute value.</param> /// <param name="labelName">Name of the label.</param> /// <param name="operatorName">Name of the operator.</param> /// <param name="attribute">The attribute.</param> /// <param name="calculateRange">if set to <c>true</c> [calculate range].</param> /// <param name="rangeValue">The range value.</param> /// <param name="attributeChecked">The attribute checked.</param> /// <returns></returns> private ArrayList SetUITextControls(string attributeName, string labelName, string operatorName, ArrayList attribute, bool calculateRange, string rangeValue, string attributeChecked, XmlNodeList childNodes) { string attributeValue = string.Empty; Attributes objAttribute = new Attributes(); Attributes objAttributeMin = new Attributes(); ArrayList arlValue = new ArrayList(); ArrayList arlValueMin = new ArrayList(); AttributeGroup objBasicAttributeGroup = new AttributeGroup(); ArrayList objInnerAttribute = new ArrayList(); double dblRange = Convert.ToDouble(rangeValue); string strNewAttributeValue = string.Empty; if(attributeName.Length > 0) { if(calculateRange && dblRange > 0) { objAttribute.Name = attributeName; string strValue; foreach(XmlNode node in childNodes) { strValue = string.Empty; attributeValue = string.Empty; attributeValue = node.InnerText; strValue = GetMaxRange(attributeValue, dblRange).ToString(); arlValue.Add(SetValue(strValue)); } objAttribute.Value = arlValue; objAttribute.Operator = LESSTHANEQUALS; objAttribute.Label = labelName; objAttribute.IsRangeApplicable = true; objAttribute.Checked = attributeChecked; objInnerAttribute.Add(objAttribute); objAttributeMin.Name = attributeName; foreach(XmlNode node in childNodes) { strValue = string.Empty; attributeValue = string.Empty; attributeValue = node.InnerText; strValue = GetMinRange(attributeValue, dblRange).ToString(); arlValueMin.Add(SetValue(strValue)); } objAttributeMin.Value = arlValueMin; objAttributeMin.Operator = GREATERTHANEQUALS; objAttributeMin.Label = labelName; objAttributeMin.IsRangeApplicable = true; objAttributeMin.Checked = attributeChecked; objInnerAttribute.Add(objAttributeMin); objBasicAttributeGroup.Operator = GetLogicalOperator(); objBasicAttributeGroup.Attribute = objInnerAttribute; attribute.Add(objBasicAttributeGroup); } else { objAttribute.Name = attributeName; /// If Label Name = "cboReserveMagOil - Value column" | "cboReserveMagGas - Value column" | "cboHydrocarbonMain - HydrocarbonCode column" /// Get Value field from SharePoint list and Assign if(labelName.Equals("cboReserveMagOil")) /// Field Adv Search { foreach(XmlNode node in childNodes) { attributeValue = string.Empty; attributeValue = node.InnerText; strNewAttributeValue = string.Empty; strNewAttributeValue = GetSRPValueFields("Reserve Magnitude Oil", "Value", "Title", attributeValue); if(!string.IsNullOrEmpty(strNewAttributeValue)) { arlValue.Add(SetValue(strNewAttributeValue)); } } } else if(labelName.Equals("cboReserveMagGas")) /// Field Adv Search { strNewAttributeValue = string.Empty; foreach(XmlNode node in childNodes) { attributeValue = string.Empty; attributeValue = node.InnerText; strNewAttributeValue = string.Empty; strNewAttributeValue = GetSRPValueFields("Reserve Magnitude Gas", "Value", "Title", attributeValue); if(!string.IsNullOrEmpty(strNewAttributeValue)) { arlValue.Add(SetValue(strNewAttributeValue)); } } } else if(labelName.Equals("cboHydrocarbonMain")) /// Reservoir Adv Search { strNewAttributeValue = string.Empty; foreach(XmlNode node in childNodes) { attributeValue = string.Empty; attributeValue = node.InnerText; strNewAttributeValue = string.Empty; strNewAttributeValue = GetSRPValueFields("HydroCarbon Main", "HydrocarbonCode", "Title", attributeValue); if(!string.IsNullOrEmpty(strNewAttributeValue)) { arlValue.Add(SetValue(strNewAttributeValue)); } } } /// If Label Name = "cboTectonicSetting" | "cboTectonicSettingKle" /// Get Basin Values from sharepoint list and assign to Value fields else if(labelName.Equals("cboTectonicSetting") || labelName.Equals("cboTectonicSettingKle")) /// Field Adv Search { foreach(XmlNode node in childNodes) { attributeValue = string.Empty; attributeValue = node.InnerText; arlValue = GetTectonicSettingsBasinNames("Tectonic Setting", attributeValue); } if(arlValue.Count > 1) { operatorName = INOPERATOR; } } else { foreach(XmlNode node in childNodes) { attributeValue = node.InnerText; arlValue.Add(SetValue(attributeValue)); } } objAttribute.Value = arlValue; objAttribute.Operator = operatorName; objAttribute.Label = labelName; objAttribute.Checked = attributeChecked; if(calculateRange) { objAttribute.IsRangeApplicable = true; } /// If Attribute doesn't contain value collection /// Don't add to attribute collection if(arlValue.Count > 0) { attribute.Add(objAttribute); } } } return attribute; }
/// <summary> /// Sets the atribute. /// </summary> /// <param name="selectedCriteriaValues">The selected criteria values.</param> /// <param name="strIdentifierName">Name of the STR identifier.</param> /// <returns></returns> private ArrayList SetAtribute(string[] selectedCriteriaValues, string strIdentifierName) { ArrayList arlAttribute = new ArrayList(); ArrayList arlValue = new ArrayList(); Attributes objDetail = new Attributes(); foreach (string strAttributeValue in selectedCriteriaValues) { int intCheckDuplicate = 0; if (strAttributeValue.Trim().Length > 0) { //Loop through all the value object in ArrayList. foreach (Value objValue in arlValue) { if (string.Equals(strAttributeValue.Trim(), objValue.InnerText.ToString())) { intCheckDuplicate++; } } if (intCheckDuplicate == 0) { arlValue.Add(SetValue(strAttributeValue.Trim())); } } } objDetail.Value = arlValue; objDetail.Operator = GetOperator(objDetail.Value); objDetail.Name = strIdentifierName.ToString(); arlAttribute.Add(objDetail); return arlAttribute; }
/// <summary> /// Creates the PVT request info. /// </summary> /// <param name="PVTReport">The EPCatalog report.</param> /// <param name="assetType">Type of the asset.</param> /// <param name="identifiers">The identifiers.</param> /// <returns></returns> private RequestInfo CreatePVTRequestInfo(string PVTReport, string assetType, string identifiers) { RequestInfo objPVTRequestInfo = CreateEPRequestInfo(assetType, identifiers); ArrayList arrlstProductType = GetPVTProductTypes(PVTReport); if(arrlstProductType != null) { // ** code for adding group of product types to added**// Attributes objProductType = new Attributes(); objProductType.Name = PRODUCTTYPE; objProductType.Value = new ArrayList(); foreach(string strValue in arrlstProductType) { Value objProductTypeVal = new Value(); objProductTypeVal.InnerText = strValue; objProductType.Value.Add(objProductTypeVal); } objProductType.Operator = GetOperator(objProductType.Value); ((AttributeGroup)objPVTRequestInfo.Entity.AttributeGroups[0]).Attribute.Add(objProductType); } return objPVTRequestInfo; }
//This function is used to generate the Entity, When user clicked the Convert Button. /// <summary> /// Sets the entity tables. /// </summary> /// <returns></returns> private Entity SetEntityTables() { Entity objEntity = new Entity(); //If User Entered values from Populate (Popup) if (Session["DepthValues"] != null) { strDepthValues = string.Empty; strDepthValues = Session["DepthValues"].ToString(); arrDepthValueConvertPath = strDepthValues.Split('|'); dblTopDepth = Convert.ToDouble(arrDepthValueConvertPath[0].ToString()); dblBottomDepth = Convert.ToDouble(arrDepthValueConvertPath[1].ToString()); intDepthInterval = Convert.ToInt32(arrDepthValueConvertPath[2].ToString()); strDepthname = arrDepthValueConvertPath[3].ToString(); //Used to find no.of rows need to create the HTML table. int index = Convert.ToInt32(Math.Round(((dblBottomDepth - dblTopDepth) / intDepthInterval), 0)); int tblCount = tblConvertRows.Rows.Count; } objEntity.ResponseType = TABULAR; objEntity.AttributeGroups = new ArrayList(); AttributeGroup objAttributeGrp = new AttributeGroup(); objAttributeGrp.Operator = ANDOPERATOR; objAttributeGrp.Attribute = new ArrayList(); objAttributeGrp.Attribute.Add(addAttribute("UWBI", "EQUALS", drpWellbore.SelectedItem.Value)); introwCount = tblConvertRows.Rows.Count; Attributes objTopDepthAttribute = new Attributes(); objTopDepthAttribute.Name = "Top Depth"; objTopDepthAttribute.Value = new ArrayList(); // This function is use to get the values from AH/TV textboxes. //this condition is used the get the values from AH depth textboxes. TextBox txtAHTopDepth0 = (TextBox)tblConvertRows.Rows[1].Cells[0].FindControl("txtAHDepth0"); //Suppose, if User changed the drpDepthref value, then we need to covert the depth values from selected drpDepthref to Default Depth value. //Eg User entered value 100 into textbox, and user do not change the drpdepthref default value, then we can sent directly tgis value to webservice, //Suppose user entered 100 into textbox, and user changed the drpDepthRef default value(DF to GL,etc), then need to convert textbox value (100) to DF format : like (100 -GL) +DF if (hdnFirstAHDepthValue != null) { if (!string.IsNullOrEmpty(hdnFirstAHDepthValue.Value)) { txtAHTopDepth0.Text = hdnFirstAHDepthValue.Value; } } Decimal decDrpRefValue = Convert.ToDecimal(drpDepthReference.SelectedItem.Value); Decimal decHdnDrpRefValue = Convert.ToDecimal(Session["hidDrpDepthRefValue"].ToString()); //*added by dev decDrpRefValue = ConvertFeetMetre(decDrpRefValue, hidDepthRefDefaultUnit.Value); decHdnDrpRefValue = ConvertFeetMetre(decHdnDrpRefValue, hidDepthRefDefaultUnit.Value); //end Decimal decResult; if (Session["hidDrpDepthRefText"].ToString().Equals(drpDepthReference.SelectedItem.Text)) { Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = txtAHTopDepth0.Text; objTopDepthAttribute.Value.Add(objTopDepthVal); } else { Decimal decAHTopDepth0 = Convert.ToDecimal(txtAHTopDepth0.Text); decResult = (decAHTopDepth0 - decDrpRefValue) + decHdnDrpRefValue; Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = decResult.ToString(); objTopDepthAttribute.Value.Add(objTopDepthVal); } // Convert all the textbox value into Default Depthref value, before send to Webservice. Decimal decAHDepth; TextBox txtTVDepth; Decimal decTVDepth; Decimal decDepth; //If user enter value from only populate popup. not in Add rows button clicked. if (!string.IsNullOrEmpty(strDepthname) && hidDepthMode.Value == null) { // Values created from AHDepth popup. if (strDepthname.Equals(strMD)) { for (int rowNumber = 1; rowNumber < introwCount - 2; rowNumber++) { TextBox txtAHDepth = (TextBox)tblConvertRows.Rows[rowNumber + 1].Cells[0].FindControl("txtAHDepth" + rowNumber); if (txtAHDepth != null && !string.IsNullOrEmpty(txtAHDepth.Text)) { //user is not change the default drpDepthRef if (Session["hidDrpDepthRefText"].ToString().Equals(drpDepthReference.SelectedItem.Text)) { Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = txtAHDepth.Text; objTopDepthAttribute.Value.Add(objTopDepthVal); } else { // if user changed the drpDepthRef, then first we need to calculate all the value to default drpref value, before sending the resquest xml to the webservice. decAHDepth = Convert.ToDecimal(txtAHDepth.Text); decResult = (decAHDepth - decDrpRefValue) + decHdnDrpRefValue; Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = decResult.ToString(); objTopDepthAttribute.Value.Add(objTopDepthVal); } } } } else { // Values created from TVDepth popup. for (int rowNumber = 1; rowNumber < introwCount - 2; rowNumber++) { txtTVDepth = (TextBox)tblConvertRows.Rows[rowNumber + 1].Cells[0].FindControl("txtTVDepth" + rowNumber); if (txtTVDepth != null && !string.IsNullOrEmpty(txtTVDepth.Text)) { if (Session["hidDrpDepthRefText"].ToString().Equals(drpDepthReference.SelectedItem.Text)) { Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = txtTVDepth.Text; objTopDepthAttribute.Value.Add(objTopDepthVal); } else { decTVDepth = Convert.ToDecimal(txtTVDepth.Text); // if user changed the drpDepthRef, then first we need to calculate all the value to default drpref value, before sending the resquest xml to the webservice. decResult = (decTVDepth - decDrpRefValue) + decHdnDrpRefValue; Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = decResult.ToString(); objTopDepthAttribute.Value.Add(objTopDepthVal); } } } } //Suppose user directly enter the value into textbox, after click the Popup button, then need to clear below values. strDepthname = string.Empty; } else { // Used the get the values from Depth textboxes. TextBox txtDepth; if (hidDepthMode.Value != null) { for (int rowNumber = 1; rowNumber < introwCount - 2; rowNumber++) { //If user directly entered into AH Depth textboxes. if (hidDepthMode.Value.Equals(strMD)) { txtDepth = (TextBox)tblConvertRows.Rows[rowNumber + 1].Cells[0].FindControl("txtAHDepth" + rowNumber); } else { //If user directly entered into TV Depth textboxes. txtDepth = (TextBox)tblConvertRows.Rows[rowNumber + 1].Cells[2].FindControl("txtTVDepth" + rowNumber); } if (txtDepth != null && !string.IsNullOrEmpty(txtDepth.Text)) { // Check whether user changed the drpDepthRef value or not, if changed then need to convert value to Default drpDepthref if (Session["hidDrpDepthRefText"].ToString().Equals(drpDepthReference.SelectedItem.Text)) { Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = txtDepth.Text; objTopDepthAttribute.Value.Add(objTopDepthVal); } else { decDepth = Convert.ToDecimal(txtDepth.Text); // if user changed the drpDepthRef, then first we need to calculate all the value to default drpref value, before sending the resquest xml to the webservice. decResult = (decDepth - decDrpRefValue) + decHdnDrpRefValue; Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = decResult.ToString(); objTopDepthAttribute.Value.Add(objTopDepthVal); } } } } } inttblCount = tblConvertRows.Rows.Count - 2; //Get bottom depth value for gerentating the Request XML. TextBox txtAHBottomDepth = (TextBox)tblConvertRows.Rows[inttblCount].Cells[0].FindControl("txtAHDepth" + inttblCount); if (hdnLastAHDepthValue != null) { if (!string.IsNullOrEmpty(hdnLastAHDepthValue.Value)) { txtAHBottomDepth.Text = hdnLastAHDepthValue.Value; } } if (Session["hidDrpDepthRefText"].ToString().Equals(drpDepthReference.SelectedItem.Text)) { Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = txtAHBottomDepth.Text; objTopDepthAttribute.Value.Add(objTopDepthVal); } else { Decimal decAHBottomDepth = Convert.ToDecimal(txtAHBottomDepth.Text); // if user changed the drpDepthRef, then first we need to calculate all the value to default drpref value, before sending the resquest xml to the webservice. decResult = (decAHBottomDepth - decDrpRefValue) + decHdnDrpRefValue; Value objTopDepthVal = new Value(); objTopDepthVal.InnerText = decResult.ToString(); objTopDepthAttribute.Value.Add(objTopDepthVal); } if (objTopDepthAttribute.Value.Count > 1) { objTopDepthAttribute.Operator = "IN"; objAttributeGrp.Attribute.Add(objTopDepthAttribute); } if (rdoDepthUnitsMetres.Checked) { strInputDepthUnit = "m"; stroutputDepthUnit = "m"; } else { strInputDepthUnit = "feet"; stroutputDepthUnit = "feet"; } objAttributeGrp.Attribute.Add(addAttribute("Input Depth Unit", "EQUALS", strInputDepthUnit.ToString())); objAttributeGrp.Attribute.Add(addAttribute("Output Depth Unit", "EQUALS", stroutputDepthUnit.ToString())); objAttributeGrp.Attribute.Add(addAttribute("Projected Coordinated System", "EQUALS", lblResultProject.Text)); objAttributeGrp.Attribute.Add(addAttribute("Wellbore Path", "EQUALS", lblResultWellborePath.Text)); string strDepthModevalue = string.Empty; // if user enter the value only from Populate. //Some time user enter the value after populate the webservice response XML to table. if (!string.IsNullOrEmpty(strDepthname) && hidDepthMode.Value == null) { strDepthModevalue = strDepthname.ToString(); } else { // after populate the webservice response in to table , then user may be enter the value AHdepth text box or TVDepth textbox. if (hidDepthMode.Value != null && !string.IsNullOrEmpty(hidDepthMode.Value.ToString())) { strDepthModevalue = hidDepthMode.Value; } else { strDepthModevalue = strMD; } } objAttributeGrp.Attribute.Add(addAttribute("Input Depth Mode", "EQUALS", strDepthModevalue.ToString())); tblConvertRows.EnableViewState = true; objEntity.AttributeGroups.Add(objAttributeGrp); return objEntity; }
/// <summary> /// Constructs the Entity object /// </summary> /// <returns></returns> private Entity SetEntity() { Entity objEntity; objEntity = new Entity(); objEntity.ResponseType = TABULAR; objEntity.AttributeGroups = new ArrayList(); AttributeGroup objAttributeGrp = new AttributeGroup(); objAttributeGrp.Operator = ANDOPERATOR; objAttributeGrp.Attribute = new ArrayList(); if(!string.IsNullOrEmpty(txtAUTHORNAME.Text)) { Attributes objAuthorAttribute = new Attributes(); objAuthorAttribute.Name = AUTHOR; objAuthorAttribute.Operator = EQUALSOPERATOR; objAuthorAttribute.Value = new ArrayList(); Value objAuthorVal = new Value(); objAuthorVal.InnerText = txtAUTHORNAME.Text; objAuthorAttribute.Value.Add(objAuthorVal); objAttributeGrp.Attribute.Add(objAuthorAttribute); } //Commented in DREAM 4.0if (IsOptionSelected(lstProductTypes)) if(lstSelectedProdType.Items.Count > 0) { // ** code for adding group of product types to added**// Attributes objProductType = new Attributes(); objProductType.Name = PRODUCTTYPE; objProductType.Operator = INOPERATOR; objProductType.Value = new ArrayList(); Value objLogiVal = null; for(int intProductTypeCounter = 0; intProductTypeCounter < lstSelectedProdType.Items.Count; intProductTypeCounter++) { //Commented in DREAM 4.0 if(lstProductTypes.Items[intProductTypeCounter].Selected) { objLogiVal = new Value(); objLogiVal.InnerText = lstSelectedProdType.Items[intProductTypeCounter].Value; objProductType.Value.Add(objLogiVal); } } objAttributeGrp.Attribute.Add(objProductType); } //adding asset value if(!string.IsNullOrEmpty(hidIdentifiers.Value)) { string strPattern = @"\r\n"; Regex fixMe = new Regex(strPattern); string strTrimmedMyAssetValues = fixMe.Replace(hidIdentifiers.Value, string.Empty); string[] arrAssetVal = strTrimmedMyAssetValues.Split("|".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); Attributes objAssetValue = new Attributes(); objAssetValue.Name = ASSET; objAssetValue.Operator = EQUALSOPERATOR; objAssetValue.Value = new ArrayList(); foreach(string str in arrAssetVal) { Value objVal = new Value(); objVal.InnerText = str.Trim(); objAssetValue.Value.Add(objVal); } objAttributeGrp.Attribute.Add(objAssetValue); } //Commented for Dream 3.1 fix //Attributes objAssetTypeAttribute = new Attributes(); //objAssetTypeAttribute.Name = EPASSETTYPE; //objAssetTypeAttribute.Operator = EQUALSOPERATOR; //objAssetTypeAttribute.Value = new ArrayList(); //Value objAssetTypeVal = new Value(); //if (hidAssetType.Value.ToLowerInvariant().Equals("wellbore")) //{ // hidAssetType.Value = "well"; //} //objAssetTypeVal.InnerText = hidAssetType.Value; //objAssetTypeVal.InnerText = hidAssetType.Value; //objAssetTypeAttribute.Value.Add(objAssetTypeVal); //objAttributeGrp.Attribute.Add(objAssetTypeAttribute); AddCountryAttribute(objAttributeGrp.Attribute);//DREAM 4.0 objEntity.AttributeGroups.Add(objAttributeGrp); //adding published date criteria if((!string.IsNullOrEmpty(txtStartDate.Text)) && (!string.IsNullOrEmpty(txtEndDate.Text))) { AddPublishDateCriteria(objEntity); } return objEntity; }
/// <summary> /// Sets the entity. /// </summary> /// <param name="arrFields">The arr fields.</param> /// <param name="userEnteredValue">The User Entered Value</param> /// <returns></returns> private Entity SetEntity(ArrayList fieldsGroup, string userEnteredValue, string attributeName) { Entity objEntity = new Entity(); if(fieldsGroup.Count == 1 && fieldsGroup[0] != null) { Control radControl = (Control)fieldsGroup[0]; ArrayList arlAttribute = new ArrayList(); Attributes objAttribute = new Attributes(); //Commented in DREAM 4.0 for R5K Changes //objAttribute.Name = GetRadControlID(radControl.ID); //Added in DREAM 4.0 for R5K Changes //Start objAttribute.Name = attributeName; //End ArrayList arlValue = new ArrayList(); Value objValue = new Value(); objValue.InnerText = userEnteredValue; arlValue.Add(objValue); objAttribute.Value = arlValue; objAttribute.Operator = GetOperator(objAttribute.Value); arlAttribute.Add(objAttribute); objEntity.Attribute = arlAttribute; objEntity.Criteria = SetCriteria(); } else { objEntity.Criteria = SetCriteria(); } return objEntity; }
/// <summary> /// Sets the atribute. /// </summary> /// <returns></returns> private ArrayList SetAtribute() { ArrayList arlAttribute = new ArrayList(); ArrayList arlValue = new ArrayList(); Attributes objDetail = new Attributes(); objDetail.Name = Criteria; if (!string.IsNullOrEmpty(CriteriaValue)) arlValue.Add(SetValue(CriteriaValue.Trim())); objDetail.Value = arlValue; objDetail.Operator = GetOperator(objDetail.Value); arlAttribute.Add(objDetail); return arlAttribute; }
/// <summary> /// Sets the logs attribute group. /// </summary> /// <returns></returns> private ArrayList SetLogsAttributeGroup() { ArrayList arlAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); AttributeGroup objAttributeGroup = new AttributeGroup(); /// initializes the attribute objects and set the values Attributes objUWBIAttribute = new Attributes(); objUWBIAttribute.Name = UWBINAME; objUWBIAttribute.Value = SetLogAttributeValue(UWBI); objUWBIAttribute.Operator = GetOperator(objUWBIAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objUWBIAttribute); Attributes objLogServiceAttribute = new Attributes(); objLogServiceAttribute.Name = LOGSERVICENAME; objLogServiceAttribute.Value = SetLogAttributeValue(LogService); objLogServiceAttribute.Operator = GetOperator(objLogServiceAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogServiceAttribute); Attributes objLogTypeAttribute = new Attributes(); objLogTypeAttribute.Name = LOGTYPENAME; objLogTypeAttribute.Value = SetLogAttributeValue(LogType); objLogTypeAttribute.Operator = GetOperator(objLogTypeAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogTypeAttribute); Attributes objLogSourceAttribute = new Attributes(); objLogSourceAttribute.Name = LOGSOURCENAME; objLogSourceAttribute.Value = SetLogAttributeValue(LogSource); objLogSourceAttribute.Operator = GetOperator(objLogSourceAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogSourceAttribute); Attributes objLogNameAttribute = new Attributes(); objLogNameAttribute.Name = LOGATTRIBUTENAME; /// set the attribute value. objLogNameAttribute.Value = SetLogAttributeValue(LogName); objLogNameAttribute.Operator = GetOperator(objLogNameAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogNameAttribute); Attributes objLogActivityAttribute = new Attributes(); objLogActivityAttribute.Name = LOGACTIVITYNAME; /// set the attribute value. objLogActivityAttribute.Value = SetLogAttributeValue(LogActivity); objLogActivityAttribute.Operator = GetOperator(objLogActivityAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogActivityAttribute); Attributes objLogRunAttribute = new Attributes(); objLogRunAttribute.Name = LOGRUNNAME; objLogRunAttribute.Value = SetLogAttributeValue(Logrun); objLogRunAttribute.Operator = GetOperator(objLogRunAttribute.Value); arlAttribute.Add(objLogRunAttribute); Attributes objLogVersionAttribute = new Attributes(); objLogVersionAttribute.Name = LOGVERSIONNAME; /// set the attribute value. objLogVersionAttribute.Value = SetLogAttributeValue(LogVersion); objLogVersionAttribute.Operator = GetOperator(objLogVersionAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogVersionAttribute); Attributes objLogProjectNameAttribute = new Attributes(); objLogProjectNameAttribute.Name = RECALLPROJECTNAME; /// set the attribute value. objLogProjectNameAttribute.Value = SetLogAttributeValue(Recall_Project_Name); objLogProjectNameAttribute.Operator = GetOperator(objLogProjectNameAttribute.Value); /// adds the attribute object to the attribute Group. arlAttribute.Add(objLogProjectNameAttribute); objAttributeGroup.Operator = ANDOPERATOR; objAttributeGroup.Attribute = arlAttribute; arlAttributeGroup.Add(objAttributeGroup); return arlAttributeGroup; }
/// <summary> /// Creates the parameter Node. /// </summary> /// <param name="objAttribute">The attribute object.</param> /// <param name="AttributeElement">The attribute element.</param> private void CreateParameter(Attributes attribute, XmlElement attributeElement) { try { //Looping through all the Parameter object in Attributes object. foreach(Parameters objParameter in attribute.Parameter) { //creating the Parameter Element. XmlElement ParameterElement = objXmlDocument.CreateElement(PARAMETER); attributeElement.AppendChild(ParameterElement); //Creating attribute for Parameter Element. XmlAttribute ParameterName = objXmlDocument.CreateAttribute(NAME); ParameterElement.Attributes.Append(ParameterName); ParameterName.Value = objParameter.Name; XmlAttribute ParameterValue = objXmlDocument.CreateAttribute(VALUE); ParameterElement.Attributes.Append(ParameterValue); ParameterValue.Value = objParameter.Value; XmlAttribute ParameterLabel = objXmlDocument.CreateAttribute(LABEL); ParameterElement.Attributes.Append(ParameterLabel); ParameterLabel.Value = objParameter.Label; } } catch(Exception) { throw; } }
/// <summary> /// Adds the paleo markers attribute. /// </summary> protected void AddPaleoMarkersAttribute() { ArrayList arlAttributeGroup = new ArrayList(); ArrayList arlAttribute = new ArrayList(); AttributeGroup objAttributeGroup = new AttributeGroup(); /// Initializes the attribute objects and set the values Attributes objPaleoMarkersAttribute = new Attributes(); objPaleoMarkersAttribute.Name = PICKSINTERPRETER; objPaleoMarkersAttribute.Value = new ArrayList(); Value pamValue = new Value(); Value palValue = new Value(); pamValue.InnerText = "PAM"; palValue.InnerText = "PAL"; objPaleoMarkersAttribute.Value.Add(pamValue); objPaleoMarkersAttribute.Value.Add(palValue); objPaleoMarkersAttribute.Operator = GetOperator(objPaleoMarkersAttribute.Value); /// Adds the attribute object to the attribute Group. arlAttribute.Add(objRequestInfo.Entity.Attribute[0]); objRequestInfo.Entity.Attribute = null; arlAttribute.Add(objPaleoMarkersAttribute); objAttributeGroup.Operator = ANDOPERATOR; objAttributeGroup.Attribute = arlAttribute; arlAttributeGroup.Add(objAttributeGroup); objRequestInfo.Entity.AttributeGroups = arlAttributeGroup; }
/// <summary> /// Creates the value. /// </summary> /// <param name="objAttribute">The attribute Object.</param> /// <param name="AttributeElement">The attribute element.</param> private void CreateValue(Attributes attribute, XmlElement attributeElement) { try { //Loop through all the value object in Attribute object. foreach(Value objValue in attribute.Value) { //creating the Value Element. XmlElement ValueElement = objXmlDocument.CreateElement(VALUE); attributeElement.AppendChild(ValueElement); //Setting the Innertext value for each value. ValueElement.InnerText = objValue.InnerText; } } catch(Exception) { throw; } }
/// <summary> /// Sets the date attribute. /// </summary> /// <returns></returns> private ArrayList SetDateAttribute() { ArrayList arrDate = new ArrayList(); if(rdoRbDate.Items[0].Selected) { ArrayList arrSpudDate = new ArrayList(); AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); objFirstChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objFromSpudDate = new Attributes(); objFromSpudDate.Name = SPUDDATE; objFromSpudDate.Label = txtFrom.ID; objFromSpudDate.Operator = GetDateOperator(FROM); objFromSpudDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrSpudDate.Add(objFromSpudDate); Attributes objToSpudDate = new Attributes(); objToSpudDate.Name = SPUDDATE; objToSpudDate.Label = txtTo.ID; objToSpudDate.Operator = GetDateOperator(TO); objToSpudDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrSpudDate.Add(objToSpudDate); objFirstChildAttributeGroup.Attribute = arrSpudDate; arrDate.Add(objFirstChildAttributeGroup); ArrayList arrKickOffDate = new ArrayList(); AttributeGroup objSecondChildAttributeGroup = new AttributeGroup(); objSecondChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objFromKickOffDate = new Attributes(); objFromKickOffDate.Name = KICKOFFDATE; objFromKickOffDate.Operator = GetDateOperator(FROM); objFromKickOffDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrKickOffDate.Add(objFromKickOffDate); Attributes objToKickOffDate = new Attributes(); objToKickOffDate.Name = KICKOFFDATE; objToKickOffDate.Operator = GetDateOperator(TO); objToKickOffDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrKickOffDate.Add(objToKickOffDate); objSecondChildAttributeGroup.Attribute = arrKickOffDate; arrDate.Add(objSecondChildAttributeGroup); } else { AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); ArrayList arrCompletionDate = new ArrayList(); Attributes objFromCompletionDate = new Attributes(); objFromCompletionDate.Name = ABANDONEDDATE; objFromCompletionDate.Label = txtFrom.ID; objFromCompletionDate.Operator = GREATERTHANEQUALS; objFromCompletionDate.Value = SetDateValue(FROM, txtFrom.Text, txtTo.Text); arrCompletionDate.Add(objFromCompletionDate); Attributes objToCompletionDate = new Attributes(); objToCompletionDate.Name = ABANDONEDDATE; objToCompletionDate.Label = txtTo.ID; objToCompletionDate.Operator = LESSTHANEQUALS; objToCompletionDate.Value = SetDateValue(TO, txtFrom.Text, txtTo.Text); arrCompletionDate.Add(objToCompletionDate); objFirstChildAttributeGroup.Attribute = arrCompletionDate; objFirstChildAttributeGroup.Operator = GetLogicalOperator(); arrDate.Add(objFirstChildAttributeGroup); } return arrDate; }
/// <summary> /// Create an attributes object and assign its properties /// </summary> /// <param name="name">Name of attribute</param> /// <param name="operation">Operation</param> /// <param name="value">array of value</param> /// <returns>attributes object</returns> private Attributes AddAttribute(string name, string operation, string[] values) { Attributes objAttribute = new Attributes(); objAttribute.Value = new ArrayList(); objAttribute.Name = name; objAttribute.Operator = operation; foreach (string value in values) { Value objValue = new Value(); objValue.InnerText = value; objAttribute.Value.Add(objValue); } return objAttribute; }
/// <summary> /// Sets the geographical attribute. /// </summary> /// <returns></returns> private ArrayList SetGeographicalAttribute() { ArrayList arrLatLon = new ArrayList(); if(rdoRbLatLon.Items[1].Selected) { ArrayList arrLatitude = new ArrayList(); AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); objFirstChildAttributeGroup.Operator = GetLogicalOperator(); objFirstChildAttributeGroup.Checked = TRUE; objFirstChildAttributeGroup.Label = rdoRbLatLon.ID; objFirstChildAttributeGroup.Name = rdoRbLatLon.Items[1].Value.ToString(); Attributes objMinLat = new Attributes(); objMinLat.Name = BOTTOMLATITUDE; objMinLat.Operator = GREATERTHANEQUALS; objMinLat.Parameter = SetParameter(MINLATITUDE); arrLatitude.Add(objMinLat); Attributes objMaxLat = new Attributes(); objMaxLat.Name = BOTTOMLATITUDE; objMaxLat.Operator = LESSTHANEQUALS; objMaxLat.Parameter = SetParameter(MAXLATITUDE); arrLatitude.Add(objMaxLat); objFirstChildAttributeGroup.Attribute = arrLatitude; arrLatLon.Add(objFirstChildAttributeGroup); ArrayList arrLongitude = new ArrayList(); AttributeGroup objSecondChildAttributeGroup = new AttributeGroup(); objSecondChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objMinLon = new Attributes(); objMinLon.Name = BOTTOMLONGITUDE; objMinLon.Operator = GREATERTHANEQUALS; objMinLon.Parameter = SetParameter(MINLONGITUDE); arrLongitude.Add(objMinLon); Attributes objMaxLon = new Attributes(); objMaxLon.Name = BOTTOMLONGITUDE; objMaxLon.Operator = LESSTHANEQUALS; objMaxLon.Parameter = SetParameter(MAXLONGITUDE); arrLongitude.Add(objMaxLon); objSecondChildAttributeGroup.Attribute = arrLongitude; arrLatLon.Add(objSecondChildAttributeGroup); } else { ArrayList arrLatitude = new ArrayList(); AttributeGroup objFirstChildAttributeGroup = new AttributeGroup(); objFirstChildAttributeGroup.Operator = GetLogicalOperator(); objFirstChildAttributeGroup.Checked = TRUE; objFirstChildAttributeGroup.Label = rdoRbLatLon.ID; objFirstChildAttributeGroup.Name = rdoRbLatLon.Items[0].Value.ToString(); Attributes objMinLat = new Attributes(); objMinLat.Name = SURFACELATITUDE; objMinLat.Operator = GREATERTHANEQUALS; objMinLat.Parameter = SetParameter(MINLATITUDE); arrLatitude.Add(objMinLat); Attributes objMaxLat = new Attributes(); objMaxLat.Name = SURFACELATITUDE; objMaxLat.Operator = LESSTHANEQUALS; objMaxLat.Parameter = SetParameter(MAXLATITUDE); arrLatitude.Add(objMaxLat); objFirstChildAttributeGroup.Attribute = arrLatitude; arrLatLon.Add(objFirstChildAttributeGroup); ArrayList arrLongitude = new ArrayList(); AttributeGroup objSecondChildAttributeGroup = new AttributeGroup(); objSecondChildAttributeGroup.Operator = GetLogicalOperator(); Attributes objMinLon = new Attributes(); objMinLon.Name = SURFACELONGITUDE; objMinLon.Operator = GREATERTHANEQUALS; objMinLon.Parameter = SetParameter(MINLONGITUDE); arrLongitude.Add(objMinLon); Attributes objMaxLon = new Attributes(); objMaxLon.Name = SURFACELONGITUDE; objMaxLon.Operator = LESSTHANEQUALS; objMaxLon.Parameter = SetParameter(MAXLONGITUDE); arrLongitude.Add(objMaxLon); objSecondChildAttributeGroup.Attribute = arrLongitude; arrLatLon.Add(objSecondChildAttributeGroup); } return arrLatLon; }
/// <summary> /// Gets the list of projects OW. /// </summary> /// <param name="entityName">Name of the entity.</param> /// <returns></returns> private XmlDocument GetListOfProjectsOW(string entityName) { XmlDocument objListOfProjectsXml = null; XmlDocument objRequestXML = null; objRequestInfo = new ShellEntities.RequestInfo(); objRequestInfo.Entity = new ShellEntities.Entity(); objRequestInfo.Entity.Name = entityName; ShellEntities.Attributes objAttributes = new ShellEntities.Attributes(); ShellEntities.Value objValue = new ShellEntities.Value(); objAttributes.Name = "source"; objValue.InnerText = STAROPERATOR; objAttributes.Value = new ArrayList(); objAttributes.Value.Add(objValue); objAttributes.Operator = GetOperator(objAttributes.Value); objRequestInfo.Entity.Attribute = new ArrayList(); objRequestInfo.Entity.Attribute.Add(objAttributes); objFactory = new ServiceProvider(); objReportController = objFactory.GetServiceManager(REPORTSERVICE); objRequestInfo.Entity.ResponseType = string.Empty; objRequestXML = objReportController.CreateSearchRequest(objRequestInfo); objListOfProjectsXml = objReportController.GetSearchResults(objRequestXML, -1, OWPROJECTS, null, 0); return objListOfProjectsXml; }
/// <summary> /// Create an attributes object and assign its properties /// </summary> /// <param name="name">Name of attribute</param> /// <param name="operation">Operation</param> /// <param name="value">value</param> /// <returns>attributes object</returns> private Attributes AddAttribute(string name, string operation, string value) { Attributes objAttribute = new Attributes(); objAttribute.Value = new ArrayList(); Value objValue = new Value(); try { objAttribute.Name = name; objAttribute.Operator = operation; objValue.InnerText = value; objAttribute.Value.Add(objValue); } catch (Exception) { throw; } return objAttribute; }
/// <summary> /// Adds the value. /// </summary> /// <param name="attribute">The attribute.</param> /// <param name="value">The value.</param> /// <returns></returns> private Attributes AddValue(Attributes attribute, string value) { Value objValue = new Value(); ArrayList arlValue = attribute.Value; if(arlValue == null) arlValue = new ArrayList(); objValue.InnerText = value; if(!arlValue.Contains(objValue)) arlValue.Add(objValue); attribute.Value = arlValue; return attribute; }