/// <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> /// 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> /// Creates a BOOKMARKS object /// </summary> /// <param name="searchType">Type of the search.</param> /// <returns></returns> private BookMarks SetQuickBookMarks(string searchType) { BookMarks objRootNode = new BookMarks(); BookMark objBookMark = null; Value objValue; ArrayList arlBookMark = new ArrayList(); strAssetIdentifier = HttpContext.Current.Request.Form["hidSelectedCriteriaName"].ToString(); objBookMark = new BookMark(); objBookMark.BookMarkType = searchType; objBookMark.IdentifierName = strAssetIdentifier; if (!arlBookMark.Contains(objBookMark)) arlBookMark.Add(objBookMark); string[] arrMyAssetVal = SelectedIdentifiers; ArrayList arlValue = null; foreach (string strAssetVal in arrMyAssetVal) { if (strAssetVal.Trim().Length > 0) { if (objBookMark.Value == null) { arlValue = new ArrayList(); } else arlValue = objBookMark.Value; objValue = new Value(); objValue.InnerText = strAssetVal.Trim(); if (!arlValue.Contains(objValue)) arlValue.Add(objValue); objBookMark.Value = arlValue; } } objRootNode.BookMark = arlBookMark; return objRootNode; }
/// <summary> /// Adds a new Value Object to the Attribute Object /// </summary> /// <param name="objAttribute"></param> /// <param name="val"></param> /// <returns></returns> private Attributes AddValue(Attributes attribute, XmlNode valueNode) { Value objBookMarkValue = new Value(); ArrayList arlValue = attribute.Value; if(arlValue == null) arlValue = new ArrayList(); objBookMarkValue.InnerText = valueNode.InnerText; if(!arlValue.Contains(objBookMarkValue)) arlValue.Add(objBookMarkValue); attribute.Value = arlValue; return attribute; }
/// <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; }
/// <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> /// Creates a Value Object /// </summary> /// <param name="criteriaValue"></param> /// <returns></returns> private ArrayList CreateValue(string criteriaValue) { ArrayList arlValues = new ArrayList(); Value objValue = new Value(); objValue.InnerText = criteriaValue; arlValues.Add(objValue); return arlValues; }
/// <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 value. /// </summary> /// <param name="strField">The STR field.</param> /// <returns>Value object</returns> private Value SetValue(string value) { Value objValue = new Value(); objValue.InnerText = value; return objValue; }
/// <summary> /// Assigns the properties of the Value Object and adds Display Object /// </summary> /// <param name="objDisplay"></param> /// <param name="columnName"></param> /// <returns></returns> private Display CreateDisplayColumnNames(Display display, string strColumnName) { Value objValue = new Value(); objValue.InnerText = strColumnName; if(!display.Value.Contains(objValue)) display.Value.Add(objValue); return display; }
/// <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; }
/// <summary> /// Sets the value. /// </summary> /// <param name="strField">The STR field.</param> /// <returns>Value object</returns> protected Value SetValue(string value) { Value objValue = new Value(); objValue.InnerText = value; return objValue; }
/// <summary> /// Sets the date value. /// </summary> /// <param name="selectedDate">The selected date.</param> /// <param name="fromValue">From value.</param> /// <param name="toValue">To value.</param> /// <returns></returns> protected ArrayList SetDateValue(string selectedDate, string fromValue, string toValue) { ArrayList arrDate = new ArrayList(); Value objDate = new Value(); if(string.Equals(selectedDate, FROM)) { objDate.InnerText = objDateTimeConvertorService.GetDateInFormat(fromValue, WEBSERVICEDATEFORMAT); } else { objDate.InnerText = objDateTimeConvertorService.GetDateInFormat(toValue, WEBSERVICEDATEFORMAT); } arrDate.Add(objDate); return arrDate; }
//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> /// 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> /// 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> /// 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> /// Sets the string field as a Value object. /// </summary> /// <param name="strField">field.</param> /// <returns></returns> private Value SetValue(string field) { Value objValue = new Value(); objValue.InnerText = field; //returns the value object. return objValue; }
/// <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> /// 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 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; }
/// <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> /// 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> /// 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> /// Sets the date value. /// </summary> /// <param name="strDate">date.</param> /// <returns></returns> private ArrayList SetDateValue(string date) { ArrayList arlDate = new ArrayList(); try { Value objDate = new Value(); if (rbLastWeek.Checked) { if (string.Equals(date, STARTDATENODE)) { objDate.InnerText = DateTime.Today.AddDays(-7).ToString(WEBSERVICEDATEFORMAT); } else if (string.Equals(date, ENDDATENODE)) { objDate.InnerText = DateTime.Today.ToString(WEBSERVICEDATEFORMAT); } } else if (rbLastMonth.Checked) { if (string.Equals(date, STARTDATENODE)) { objDate.InnerText = DateTime.Today.AddDays(-31).ToString(WEBSERVICEDATEFORMAT); } else if (string.Equals(date, ENDDATENODE)) { objDate.InnerText = DateTime.Today.ToString(WEBSERVICEDATEFORMAT); } } else if (rbLastYear.Checked) { if (string.Equals(date, STARTDATENODE)) { objDate.InnerText = DateTime.Today.AddDays(-365).ToString(WEBSERVICEDATEFORMAT); } else if (string.Equals(date, ENDDATENODE)) { objDate.InnerText = DateTime.Today.ToString(WEBSERVICEDATEFORMAT); } } else if (rbSelectDates.Checked) { if (string.Equals(date, STARTDATENODE)) { objDate.InnerText = objDateTimeConvertorService.GetDateInFormat(txtStartDate.Text, WEBSERVICEDATEFORMAT); } else if (string.Equals(date, ENDDATENODE)) { objDate.InnerText = objDateTimeConvertorService.GetDateInFormat(txtEndDate.Text, WEBSERVICEDATEFORMAT); } } arlDate.Add(objDate); } catch { throw; } return arlDate; }