Пример #1
0
        /// <summary>
        /// Sets the entity.
        /// </summary>
        /// <returns></returns>
        private Entity SetEntity()
        {
            Entity objEntity = new Entity();
            objEntity.Property = true;
            objEntity.Type = WELLBOREREPORT;
            ArrayList arlParentAttributeGroup = new ArrayList();
            ArrayList arrBasicAttributeGroup = new ArrayList();
            arrBasicAttributeGroup = SetBasicAttributeGroup();
            AttributeGroup objDateGroup = new AttributeGroup();
            for(int intDate = 0; intDate < rdoRbDate.Items.Count; intDate++)
            {
                if(rdoRbDate.Items[intDate].Selected)
                {
                    objDateGroup = SetDateAttributeGroup();
                }
            }
            if(objDateGroup.AttributeGroups != null)
            {
                arrBasicAttributeGroup.Add(objDateGroup);
            }
            AttributeGroup objGeologicalGroup = new AttributeGroup();
            if(rdoLatLong.Checked)
            {
                #region DREAM 4.0
                /// Requirement: Separate Well and Wellbore Advance search screens
                /// Changed By: Yasotha
                /// Date : 19-Jan-2010

              //  for(int intLatLon = 0; intLatLon < rdoRbLatLon.Items.Count; intLatLon++)
                {
                 //   if(rdoRbLatLon.Items[intLatLon].Selected)
                    {
                        objGeologicalGroup = SetGeographicalAttributeGroup();
                    }
                }
                #endregion
            }
            if(objGeologicalGroup.AttributeGroups != null)
            {
                arrBasicAttributeGroup.Add(objGeologicalGroup);
            }
            if(arrBasicAttributeGroup.Count > 1)
            {
                AttributeGroup objAttributeGroup = new AttributeGroup();
                objAttributeGroup.Operator = GetLogicalOperator();
                objAttributeGroup.AttributeGroups = arrBasicAttributeGroup;
                arlParentAttributeGroup.Add(objAttributeGroup);
                objEntity.AttributeGroups = arlParentAttributeGroup;
            }
            else
            {
                objEntity.AttributeGroups = arrBasicAttributeGroup;
            }
            return objEntity;
        }
Пример #2
0
        /// <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;
        }
Пример #3
0
 /// <summary>
 /// Sets the basic attribute group.
 /// </summary>
 /// <returns></returns>
 private ArrayList SetBasicAttributeGroup(ArrayList arlAttribute)
 {
     ArrayList arrBasicAttributeGroup = new ArrayList();
     try
     {
         AttributeGroup objBasicAttributeGroup = new AttributeGroup();
         objBasicAttributeGroup.Operator = GetLogicalOperator();
         objBasicAttributeGroup.Attribute = arlAttribute;
         arrBasicAttributeGroup.Add(objBasicAttributeGroup);
     }
     catch
     { throw; }
     return arrBasicAttributeGroup;
 }
Пример #4
0
        /// <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;
        }
Пример #5
0
        /// <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;
        }
Пример #6
0
        /// <summary>
        /// Sets the entity.
        /// </summary>
        /// <returns></returns>
        private ShellEntities.Entity SetEntity()
        {
            objEntity = new ShellEntities.Entity();
            objEntity.Name = RESERVOIRSEARCHTYPE;
            ArrayList arlBasicAttributeGroup = new ArrayList();
            ArrayList arlAttribute = new ArrayList();
            ArrayList arlAttributeGroup = new ArrayList();
            string strSearchPercentageValue = PortalConfiguration.GetInstance().GetKey(SEARCHPERCENTAGEVALUE);

            arlAttribute = SetBasicAttribute();
            if (blnSearchClick)
            {
                arlAttributeGroup = SetSRPAttributeGroup(strSearchPercentageValue, arlAttributeGroup);
            }
            if (arlAttribute.Count > 1)
            {
                arlBasicAttributeGroup = SetBasicAttributeGroup(arlAttribute);
                if (arlAttributeGroup.Count > 0)
                {
                    arlAttributeGroup.Add(arlBasicAttributeGroup[0]);
                    ShellEntities.AttributeGroup objFinalAttributeGroup = new ShellEntities.AttributeGroup();
                    objFinalAttributeGroup.Operator = GetLogicalOperator(rdblSearchCond.SelectedValue);
                    objFinalAttributeGroup.AttributeGroups = arlAttributeGroup;
                    ArrayList newArrayList = new ArrayList();
                    newArrayList.Add(objFinalAttributeGroup);
                    objEntity.AttributeGroups = newArrayList;
                }
                else
                {
                    objEntity.AttributeGroups = arlBasicAttributeGroup;
                }
            }
            else
            {
                objEntity.Attribute = arlAttribute;
                if (arlAttributeGroup.Count > 0)
                {
                    ShellEntities.AttributeGroup objFinalAttributeGroup = new ShellEntities.AttributeGroup();
                    objFinalAttributeGroup.Operator = GetLogicalOperator(rdblSearchCond.SelectedValue);
                    objFinalAttributeGroup.AttributeGroups = arlAttributeGroup;
                    ArrayList newArrayList = new ArrayList();
                    newArrayList.Add(objFinalAttributeGroup);
                    objEntity.AttributeGroups = newArrayList;
                }
            }

            return objEntity;
        }
Пример #7
0
 /// <summary>
 /// Gets the request info.
 /// </summary>
 /// <returns></returns>
 private RequestInfo GetRequestInfo()
 {
     objRequestInfo = new RequestInfo();
     Entity objEntity = new Entity();
     objRequestInfo.Entity = objEntity;
     objEntity.Property = true;
     if(rbLstDisplayFormat.SelectedValue.ToLower().Equals(HIERARCHICAL.ToLowerInvariant()))
     {
         objEntity.ResponseType = DATASHEET;
     }
     else
     {
         objEntity.ResponseType = TABULAR;
     }
     objRequestInfo.Entity.AttributeGroups = new ArrayList();
     AttributeGroup objAttributeGroup = new AttributeGroup();
     objAttributeGroup.Operator = ANDOPERATOR;
     objAttributeGroup.Attribute = GetAttributes();
     objRequestInfo.Entity.AttributeGroups.Add(objAttributeGroup);
     return objRequestInfo;
 }
Пример #8
0
        /// <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;
        }
Пример #9
0
        /// <summary>
        /// Creates the attributes Node.
        /// </summary>
        /// <param name="objAttrbuteGroup">The attributegroup object.</param>
        /// <param name="AttributeGroupElement">The attributegroup element.</param>
        private void CreateAttributes(AttributeGroup attributeGroup, XmlElement attributeGroupElement)
        {
            try
            {
                if(attributeGroup.AttributeGroups != null)
                {
                    foreach(AttributeGroup objAttributeGroupChild in attributeGroup.AttributeGroups)
                    {
                        //Loop through all the Attributes object in AttributeGroup object.
                        foreach(Attributes objAttribute in objAttributeGroupChild.Attribute)
                        {
                            //creating the Attribute Element.
                            XmlElement AttributeElement = objXmlDocument.CreateElement(ATTRIBUTE);
                            attributeGroupElement.AppendChild(AttributeElement);

                            //Creating attributes for Attribute Element.
                            if(objAttribute.Name.ToString().Length > 0)
                            {
                                XmlAttribute AttributeName = objXmlDocument.CreateAttribute(NAME);
                                AttributeElement.Attributes.Append(AttributeName);
                                AttributeName.Value = objAttribute.Name;
                            }
                            //Added For DWB Chapter.
                            if(objAttribute.DisplayField.ToString().Length > 0)
                            {
                                XmlAttribute AttributeDisplayField = objXmlDocument.CreateAttribute("displayonlyselectedcolumn");
                                AttributeElement.Attributes.Append(AttributeDisplayField);
                                AttributeDisplayField.Value = objAttribute.DisplayField;
                            }

                            if(objAttribute.Operator.ToString().Length > 0)
                            {
                                XmlAttribute AttributeOperator = objXmlDocument.CreateAttribute(OPERATOR);
                                AttributeElement.Attributes.Append(AttributeOperator);
                                AttributeOperator.Value = objAttribute.Operator;
                            }

                            if(objAttribute.Label.ToString().Length > 0)
                            {
                                XmlAttribute AttributeLabel = objXmlDocument.CreateAttribute(LABEL);
                                AttributeElement.Attributes.Append(AttributeLabel);
                                AttributeLabel.Value = objAttribute.Label;
                            }

                            if(objAttribute.Checked.ToString().Length > 0)
                            {
                                XmlAttribute AttributeCheck = objXmlDocument.CreateAttribute(CHECKED);
                                AttributeElement.Attributes.Append(AttributeCheck);
                                AttributeCheck.Value = objAttribute.Checked;
                            }

                            if(objAttribute.Value != null)         //Checks if Attribute contains Value object.
                            {
                                //Method Call to create Value Node.
                                CreateValue(objAttribute, AttributeElement);
                            }
                            if(objAttribute.Parameter != null)    //Checks if Attribute contains Parameter object.
                            {
                                //Method Call to create Parameter Node.
                                CreateParameter(objAttribute, AttributeElement);
                            }
                            if(objAttribute.IsRangeApplicable.ToString().Length > 0)
                            {

                                XmlAttribute AttributeIsRange = objXmlDocument.CreateAttribute(ISRANGEAPPLICABLE);
                                AttributeElement.Attributes.Append(AttributeIsRange);
                                AttributeIsRange.Value = objAttribute.IsRangeApplicable.ToString();
                            }
                        }
                    }
                }
                if(attributeGroup.Attribute != null)
                {
                    //Loop through all the Attributes object in AttributeGroup object.
                    foreach(Attributes objAttribute in attributeGroup.Attribute)
                    {
                        //creating the Attribute Element.
                        XmlElement AttributeElement = objXmlDocument.CreateElement(ATTRIBUTE);
                        attributeGroupElement.AppendChild(AttributeElement);

                        //Creating attributes for Attribute Element.
                        if(objAttribute.Name.Length > 0)
                        {
                            XmlAttribute AttributeName = objXmlDocument.CreateAttribute(NAME);
                            AttributeElement.Attributes.Append(AttributeName);
                            AttributeName.Value = objAttribute.Name;
                        }

                        //Added For DWB Chapter.
                        if(objAttribute.DisplayField.ToString().Length > 0)
                        {
                            XmlAttribute AttributeDisplayField = objXmlDocument.CreateAttribute("displayonlyselectedcolumn");
                            AttributeElement.Attributes.Append(AttributeDisplayField);
                            AttributeDisplayField.Value = objAttribute.DisplayField;
                        }

                        if(objAttribute.Operator.Length > 0)
                        {
                            XmlAttribute AttributeOperator = objXmlDocument.CreateAttribute(OPERATOR);
                            AttributeElement.Attributes.Append(AttributeOperator);
                            AttributeOperator.Value = objAttribute.Operator;
                        }

                        if(objAttribute.Label.Length > 0)
                        {
                            XmlAttribute AttributeLabel = objXmlDocument.CreateAttribute(LABEL);
                            AttributeElement.Attributes.Append(AttributeLabel);
                            AttributeLabel.Value = objAttribute.Label;
                        }

                        if(objAttribute.Checked.Length > 0)
                        {
                            XmlAttribute AttributeCheck = objXmlDocument.CreateAttribute(CHECKED);
                            AttributeElement.Attributes.Append(AttributeCheck);
                            AttributeCheck.Value = objAttribute.Checked;
                        }

                        if(objAttribute.Value != null)
                        {
                            //Method Call to create Value Node.
                            CreateValue(objAttribute, AttributeElement);
                        }
                        else if(objAttribute.Parameter != null)
                        {
                            //Method Call to create Parameter Node.
                            CreateParameter(objAttribute, AttributeElement);
                        }

                        if(objAttribute.IsRangeApplicable.ToString().Length > 0)
                        {

                            XmlAttribute AttributeIsRange = objXmlDocument.CreateAttribute(ISRANGEAPPLICABLE);
                            AttributeElement.Attributes.Append(AttributeIsRange);
                            AttributeIsRange.Value = objAttribute.IsRangeApplicable.ToString();
                        }
                    }
                }
            }
            catch(Exception)
            {
                throw;
            }
        }
Пример #10
0
 /// <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;
 }
Пример #11
0
        /// <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;
        }
Пример #12
0
        /// <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;
                }

            }
        }
Пример #13
0
 /// <summary>
 /// Sets the quick attribute group.
 /// </summary>
 /// <returns></returns>
 private ArrayList SetQuickAttributeGroup(ArrayList quickAttribute)
 {
     ArrayList arlQuickAttributeGroup = new ArrayList();
     try
     {
         //initializes the attribute group object.
         AttributeGroup objQuickAttributeGroup = new AttributeGroup();
         objQuickAttributeGroup.Operator = GetLogicalOperator();
         objQuickAttributeGroup.Attribute = quickAttribute;
         arlQuickAttributeGroup.Add(objQuickAttributeGroup);
     }
     catch(Exception)
     {
         throw;
     }
     return arlQuickAttributeGroup;
 }
Пример #14
0
        /// <summary>
        /// Creates an Array List of  AttributeGroup Object
        /// </summary>
        /// <param name="attributeList"></param>
        /// <returns></returns>
        private ArrayList CreateAttributeGroup(ArrayList attributeList)
        {
            ArrayList arlAttributeGroup = new ArrayList();

            AttributeGroup objAttributeGroup = new AttributeGroup();
            objAttributeGroup.Operator = Convert.ToString(LogicOperator.AND);
            objAttributeGroup.Attribute = attributeList;
            arlAttributeGroup.Add(objAttributeGroup);

            return arlAttributeGroup;
        }
Пример #15
0
 /// <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;
 }
Пример #16
0
        /// <summary>
        /// Creates the child attribute group.
        /// </summary>
        /// <param name="objAttributeGroup">The obj attribute group.</param>
        /// <param name="xmlelmentAttributeGroup">The xmlelment attribute group.</param>
        private XmlElement CreateChildAttributeGroup(AttributeGroup childAttributeGroup, XmlElement parentAttributeGroup)
        {
            try
            {
                foreach(AttributeGroup objChildAttributeGroup in childAttributeGroup.AttributeGroups)
                {
                    if(objChildAttributeGroup.AttributeGroups != null)
                    {
                        XmlElement AttributeGroupElement = objXmlDocument.CreateElement(ATTRIBUTEGROUP);
                        parentAttributeGroup.AppendChild(AttributeGroupElement);

                        //Creating attribute for AttributeGroup Element.
                        XmlAttribute AttributeGroupOperator = objXmlDocument.CreateAttribute(OPERATOR);
                        AttributeGroupElement.Attributes.Append(AttributeGroupOperator);
                        AttributeGroupOperator.Value = objChildAttributeGroup.Operator;

                        if(objChildAttributeGroup.Name.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupName = objXmlDocument.CreateAttribute(NAME);
                            AttributeGroupElement.Attributes.Append(AttributeGroupName);
                            AttributeGroupName.Value = objChildAttributeGroup.Name;
                        }

                        if(objChildAttributeGroup.Label.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupLabel = objXmlDocument.CreateAttribute(LABEL);
                            AttributeGroupElement.Attributes.Append(AttributeGroupLabel);
                            AttributeGroupLabel.Value = objChildAttributeGroup.Label;
                        }

                        if(objChildAttributeGroup.Checked.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupChecked = objXmlDocument.CreateAttribute(CHECKED);
                            AttributeGroupElement.Attributes.Append(AttributeGroupChecked);
                            AttributeGroupChecked.Value = objChildAttributeGroup.Checked;
                        }

                        CreateChildAttributeGroup(objChildAttributeGroup, AttributeGroupElement);
                    }
                    if(objChildAttributeGroup.Attribute != null)
                    {
                        //creating the AttributeGroup Element.
                        XmlElement AttributeGroupElement = objXmlDocument.CreateElement(ATTRIBUTEGROUP);
                        parentAttributeGroup.AppendChild(AttributeGroupElement);

                        //Creating attribute for AttributeGroup Element.
                        XmlAttribute AttributeGroupOperator = objXmlDocument.CreateAttribute(OPERATOR);
                        AttributeGroupElement.Attributes.Append(AttributeGroupOperator);
                        AttributeGroupOperator.Value = objChildAttributeGroup.Operator;

                        if(objChildAttributeGroup.Name.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupName = objXmlDocument.CreateAttribute(NAME);
                            AttributeGroupElement.Attributes.Append(AttributeGroupName);
                            AttributeGroupName.Value = objChildAttributeGroup.Name;
                        }

                        if(objChildAttributeGroup.Label.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupLabel = objXmlDocument.CreateAttribute(LABEL);
                            AttributeGroupElement.Attributes.Append(AttributeGroupLabel);
                            AttributeGroupLabel.Value = objChildAttributeGroup.Label;
                        }

                        if(objChildAttributeGroup.Checked.ToString().Length > 0)
                        {
                            XmlAttribute AttributeGroupChecked = objXmlDocument.CreateAttribute(CHECKED);
                            AttributeGroupElement.Attributes.Append(AttributeGroupChecked);
                            AttributeGroupChecked.Value = objChildAttributeGroup.Checked;
                        }

                        //Method Call to create Attribute Node.
                        CreateAttributes(objChildAttributeGroup, AttributeGroupElement);
                    }
                }
            }
            catch(Exception)
            {
                throw;
            }
            return parentAttributeGroup;
        }
Пример #17
0
        /// <summary>
        /// Sets the basic attribute group.
        /// </summary>
        /// <returns></returns>
        private ArrayList SetBasicAttributeGroup(ArrayList arlAttribute)
        {
            ArrayList arrBasicAttributeGroup = new ArrayList();

            ShellEntities.AttributeGroup objBasicAttributeGroup = new ShellEntities.AttributeGroup();
            objBasicAttributeGroup.Operator = GetLogicalOperator(rdblSearchCond.SelectedValue);
            objBasicAttributeGroup.Attribute = arlAttribute;
            arrBasicAttributeGroup.Add(objBasicAttributeGroup);

            return arrBasicAttributeGroup;
        }
        /// <summary>
        /// Create RequestInfo object for Advanced functionality usage report
        /// </summary>
        /// <returns>RequestInfo object</returns>
        private RequestInfo getAdvRequestInfo()
        {
            objRequestInfo = new RequestInfo();

            objRequestInfo.Entity = new Entity();

            try
            {
                objRequestInfo.Entity.Name = ENTITYNAME;

                objRequestInfo.Entity.Type = ADVANCE;

                ArrayList arlAttributeGroup = new ArrayList();

                AttributeGroup objAttributeGroup = new AttributeGroup();

                objAttributeGroup.Operator = AND;

                objAttributeGroup.Attribute = GetAttributes();

                arlAttributeGroup.Add(objAttributeGroup);

                objRequestInfo.Entity.AttributeGroups = arlAttributeGroup;

            }
            catch (Exception)
            {
                throw;
            }
            return objRequestInfo;
        }
Пример #19
0
        /// <summary>
        /// Gets the request info.
        /// </summary>
        /// <returns></returns>
        private RequestInfo GetRequestInfo(bool wellTestTypeReq)
        {
            objRequestInfo = new RequestInfo();
            objRequestInfo.Entity = new Entity();
            objRequestInfo.Entity.SessionID = this.Page.Session.SessionID;
            objRequestInfo.Entity.Property = true;

            if(wellTestTypeReq)
            {
                objRequestInfo.Entity.Name = TESTTYPE;
                objRequestInfo.Entity.ResponseType = TABULAR.ToLowerInvariant();
                objRequestInfo.Entity.Attribute = new ArrayList();
                objRequestInfo.Entity.Attribute.Add(objUtility.AddAttribute(TESTTYPEATTRIBUTE, LIKEOPERATOR, new string[] { STAROPERATOR }));
            }
            else
            {
                if(strSearchName.ToLowerInvariant().Equals(PRESSURESURVEYDATA))
                {
                    objRequestInfo.Entity.Name = PRESSURESURVEYENTITYNAME;
                }
                else
                {
                    objRequestInfo.Entity.Name = WELLTESTTYPE;
                }
                if(rbLstDisplayFormat.SelectedItem != null)
                {
                    if(rbLstDisplayFormat.SelectedItem.Text.ToLowerInvariant().Equals(TABULAR.ToLowerInvariant()))
                    {
                        objRequestInfo.Entity.ResponseType = TABULAR;
                    }
                    else if(rbLstDisplayFormat.SelectedItem.Text.ToLowerInvariant().Equals(DATASHEET))
                    {
                        objRequestInfo.Entity.ResponseType = DATASHEET;
                    }
                }
                ArrayList arlAttributeGroup = new ArrayList();
                AttributeGroup objAttributeGroup = new AttributeGroup();
                objAttributeGroup.Operator = ANDOPERATOR;
                objAttributeGroup.Attribute = GetAttributes();
                arlAttributeGroup.Add(objAttributeGroup);
                objRequestInfo.Entity.AttributeGroups = arlAttributeGroup;
            }
            return objRequestInfo;
        }
Пример #20
0
        //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;
        }
Пример #21
0
        /// <summary>
        /// Sets the basic attribute group.
        /// </summary>
        /// <returns></returns>
        private ArrayList SetBasicAttributeGroup()
        {
            AttributeGroup objBasicAttributeGroup = new AttributeGroup();
            objBasicAttributeGroup.Operator = GetLogicalOperator();

            objBasicAttributeGroup.Name = WELLREPORT;

            objBasicAttributeGroup.Checked = TRUE;
            objBasicAttributeGroup.Attribute = SetBasicAttribute();

            ArrayList arrBasicAttributeGroup = new ArrayList();
            arrBasicAttributeGroup.Add(objBasicAttributeGroup);

            return arrBasicAttributeGroup;
        }
Пример #22
0
 /// <summary>
 /// Gets the request info.
 /// </summary>
 /// <param name="entityName">Name of the entity.</param>
 /// <returns></returns>
 private RequestInfo GetRequestInfo(string entityName)
 {
     objRequestInfo = new RequestInfo();
     objRequestInfo.Entity = new Entity();
     objRequestInfo.Entity.SessionID = this.Page.Session.SessionID;
     objRequestInfo.Entity.Property = true;
     objRequestInfo.Entity.Name = entityName;
     objRequestInfo.Entity.ResponseType = TABULAR;
     ArrayList arlAttributeGroup = new ArrayList();
     AttributeGroup objAttributeGroup = new AttributeGroup();
     objAttributeGroup.Operator = ANDOPERATOR;
     objAttributeGroup.Attribute = GetAttributes(entityName);
     arlAttributeGroup.Add(objAttributeGroup);
     objRequestInfo.Entity.AttributeGroups = arlAttributeGroup;
     return objRequestInfo;
 }
Пример #23
0
 /// <summary>
 /// Sets the date attribute group.
 /// </summary>
 /// <returns></returns>
 private AttributeGroup SetDateAttributeGroup()
 {
     AttributeGroup objParentAttributeGroup = new AttributeGroup();
     if(rdoRbDate.Items[0].Selected)
     {
         objParentAttributeGroup.Operator = GetLogicalOperator();
         objParentAttributeGroup.Name = rdoRbDate.Items[0].Value.ToString();
         objParentAttributeGroup.Label = rdoRbDate.ID;
         objParentAttributeGroup.Checked = TRUE;
         objParentAttributeGroup.AttributeGroups = SetDateAttribute();
     }
     else
     {
         objParentAttributeGroup.Operator = GetLogicalOperator();
         objParentAttributeGroup.Name = rdoRbDate.Items[1].Value.ToString();
         objParentAttributeGroup.Label = rdoRbDate.ID;
         objParentAttributeGroup.Checked = TRUE;
         objParentAttributeGroup.AttributeGroups = SetDateAttribute();
     }
     return objParentAttributeGroup;
 }
Пример #24
0
        /// <summary>
        /// Sets the basic attribute group.
        /// </summary>
        /// <returns></returns>
        private ArrayList SetBasicAttributeGroup(ArrayList arlAttribute)
        {
            ArrayList arrBasicAttributeGroup = new ArrayList();

            AttributeGroup objBasicAttributeGroup = new AttributeGroup();
            /// SRP Changes
            if(blnSrpControlsEnable)
            {
                objBasicAttributeGroup.Operator = GetLogicalOperator(rdblSearchCond.SelectedValue);
            }
            else
            {
                objBasicAttributeGroup.Operator = GetLogicalOperator();
            }

            objBasicAttributeGroup.Attribute = arlAttribute;
            arrBasicAttributeGroup.Add(objBasicAttributeGroup);

            return arrBasicAttributeGroup;
        }
Пример #25
0
 /// <summary>
 /// Sets the entity.
 /// </summary>
 /// <returns></returns>
 private Entity SetEntity()
 {
     Entity objEntity = new Entity();
     objEntity.Property = true;
     objEntity.Type = WELLREPORT;
     ArrayList arlParentAttributeGroup = new ArrayList();
     ArrayList arrBasicAttributeGroup = new ArrayList();
     arrBasicAttributeGroup = SetBasicAttributeGroup();
     AttributeGroup objDateGroup = new AttributeGroup();
     for(int intDate = 0; intDate < rdoRbDate.Items.Count; intDate++)
     {
         if(rdoRbDate.Items[intDate].Selected)
         {
             objDateGroup = SetDateAttributeGroup();
         }
     }
     if(objDateGroup.AttributeGroups != null)
     {
         arrBasicAttributeGroup.Add(objDateGroup);
     }
     AttributeGroup objGeologicalGroup = new AttributeGroup();
     if(rdoLatLong.Checked)
     {
         objGeologicalGroup = SetGeographicalAttributeGroup();
     }
     if(objGeologicalGroup.AttributeGroups != null)
     {
         arrBasicAttributeGroup.Add(objGeologicalGroup);
     }
     if(arrBasicAttributeGroup.Count > 1)
     {
         AttributeGroup objAttributeGroup = new AttributeGroup();
         objAttributeGroup.Operator = GetLogicalOperator();
         objAttributeGroup.AttributeGroups = arrBasicAttributeGroup;
         arlParentAttributeGroup.Add(objAttributeGroup);
         objEntity.AttributeGroups = arlParentAttributeGroup;
     }
     else
     {
         objEntity.AttributeGroups = arrBasicAttributeGroup;
     }
     return objEntity;
 }
Пример #26
0
        /// <summary>
        /// Sets the entity.
        /// </summary>
        /// <returns></returns>
        private Entity SetEntity()
        {
            objEntity = new Entity();
            ArrayList arlBasicAttributeGroup = new ArrayList();
            ArrayList arlAttribute = new ArrayList();
            ArrayList arlSRPAttribute = new ArrayList();
            string strSearchPercentageVAlue = PortalConfiguration.GetInstance().GetKey(SEARCHPERCENTAGEVALUE);

            arlAttribute = SetBasicAttribute();

            if(blnSrpControlsEnable && blnSearchClick)
            {
                arlSRPAttribute = SetSRPAttributes(arlSRPAttribute);
                if(arlSRPAttribute.Count >= 1)
                {
                    arlAttribute.AddRange(arlSRPAttribute);

                }
                if(arlAttribute.Count > 1)
                {

                    ArrayList arlFinalAttributeGroup = new ArrayList();

                    arlFinalAttributeGroup = SetSRPAttributeGroup(strSearchPercentageVAlue, arlFinalAttributeGroup);
                    if(arlFinalAttributeGroup.Count > 1)
                    {
                        arlBasicAttributeGroup = SetBasicAttributeGroup(arlAttribute);
                        arlFinalAttributeGroup.Add(arlBasicAttributeGroup[0]);

                        AttributeGroup objFinalAttributeGroup = new AttributeGroup();
                        objFinalAttributeGroup.Operator = GetLogicalOperator(rdblSearchCond.SelectedValue);
                        objFinalAttributeGroup.AttributeGroups = arlFinalAttributeGroup;
                        ArrayList newArrayList = new ArrayList();
                        newArrayList.Add(objFinalAttributeGroup);
                        objEntity.AttributeGroups = newArrayList;
                    }

                    else
                    {
                        arlBasicAttributeGroup = SetBasicAttributeGroup(arlAttribute);
                        objEntity.AttributeGroups = arlBasicAttributeGroup;

                    }
                }
                else
                {

                    objEntity.Attribute = arlAttribute;
                }
            }
            else
            {
                if(arlAttribute.Count > 1)
                {
                    arlBasicAttributeGroup = SetBasicAttributeGroup(arlAttribute);
                    objEntity.AttributeGroups = arlBasicAttributeGroup;
                }
                else
                {
                    objEntity.Attribute = arlAttribute;
                }
            }

            return objEntity;
        }
Пример #27
0
        /// <summary>
        /// Sets the geographical attribute group.
        /// </summary>
        /// <returns></returns>
        private AttributeGroup SetGeographicalAttributeGroup()
        {
            AttributeGroup objParentAttributeGroup = new AttributeGroup();

            if(rdoLatLong.Checked)
            {
                objParentAttributeGroup.Operator = GetLogicalOperator();
                objParentAttributeGroup.Label = rdoLatLong.ID;
                objParentAttributeGroup.Name = GetControlID(rdoLatLong.ID);
                objParentAttributeGroup.Checked = TRUE;
                objParentAttributeGroup.AttributeGroups = SetGeographicalAttribute();
            }
            return objParentAttributeGroup;
        }
Пример #28
0
        /// <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;
        }
Пример #29
0
        /// <summary>
        /// Creates RequestInfo object of simple funtionality usage report
        /// </summary>
        /// <returns>RequestInfo object</returns>
        private RequestInfo GetSimpleRequestInfo()
        {
            objRequestInfo = new RequestInfo();

            objRequestInfo.Entity = new Entity();

            try
            {
                objRequestInfo.Entity.Name = ENTITYNAME;

                objRequestInfo.Entity.Type = SIMPLE;

                ArrayList arlAttribute = new ArrayList();

                ArrayList arlAttributeGroup = new ArrayList();

                arlAttribute.Add(AddAttribute(STARTDATE, GTEQ, new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1).ToShortDateString()));

                arlAttribute.Add(AddAttribute(ENDDATE, LTEQ, DateTime.Today.Date.ToShortDateString()));

                AttributeGroup objAttributeGroup = new AttributeGroup();

                objAttributeGroup.Operator = AND;

                objAttributeGroup.Attribute = arlAttribute;

                arlAttributeGroup.Add(objAttributeGroup);

                objRequestInfo.Entity.AttributeGroups = arlAttributeGroup;
            }
            catch (XmlException)
            {
                throw;
            }
            catch (Exception)
            {

                throw;
            }

            return objRequestInfo;
        }
Пример #30
0
        /// <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;
        }