Exemple #1
0
        public static string WMSaveRequestHead(object objAdr, string State)
        {
            string                result         = "";
            CustomProfile         profile        = CustomProfile.GetProfile();
            iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient();
            tAddress              Adrs           = new tAddress();
            tContactPersonDetail  Con            = new tContactPersonDetail();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objAdr;

                Adrs.AddressLine1     = dictionary["AddressLine1"].ToString();
                Adrs.ID               = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString());
                Adrs.LastModifiedBy   = profile.Personal.UserID.ToString();
                Adrs.LastModifiedDate = DateTime.Now;
                Adrs.City             = "";
                UCCommonFilter.EditAddress(Adrs, profile.DBConnection._constr);

                Con.Name     = dictionary["Name"].ToString();
                Con.EmailID  = dictionary["EmilID"].ToString();
                Con.MobileNo = dictionary["MobileNo"].ToString();
                long AdrsID = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString());
                UCCommonFilter.EditLocation(Con, AdrsID, profile.DBConnection._constr);

                result = "Location saved successfully";
            }
            catch { result = "Some error occurred"; }
            finally { UCCommonFilter.Close(); }

            return(result);
        }
Exemple #2
0
        public string GetAddressByLine1(string paraSessionID, string Address, string City, string Country, string state, string paraUserID, string currentFormID, string[] conn)
        {
            string Result          = "";
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <tAddress> existingAddressList = new List <tAddress>();

            existingAddressList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentFormID, conn);
            /*End*/

            /*Get Filter List [Filter By paraSequence]*/
            tAddress filterList = new tAddress();

            filterList = (from exist in existingAddressList
                          where exist.AddressLine1 == Address && exist.County == Country && exist.City == City && exist.State == state
                          select exist).FirstOrDefault();
            if (filterList == null)
            {
                Result = "";
            }
            else
            {
                Result = "Same Address Already Exist";
            }
            return(Result);
        }
        public tAddress GetWarehouseAddress(long ReferenceID, string[] conn)
        {
            BISPL_CRMDBEntities db        = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            tAddress            wmaddress = new tAddress();

            wmaddress = db.tAddresses.Where(p => p.ReferenceID == ReferenceID).FirstOrDefault();
            return(wmaddress);
        }
        public long InsertSiteAddress(tAddress SiteAddress, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));

            ce.tAddresses.AddObject(SiteAddress);
            ce.SaveChanges();
            return(1);
        }
 private void CopyAddressProperties(tAddress address)
 {
     PatientId  = address.PatientId;
     Address1   = address.Address1;
     Address2   = address.Address2;
     PostalCode = address.PostalCode;
     City       = address.City;
 }
        public long updateSiteAddress(tAddress ObjAddress, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));

            ce.tAddresses.Attach(ObjAddress);
            ce.ObjectStateManager.ChangeObjectState(ObjAddress, EntityState.Modified);
            ce.SaveChanges();
            return(1);
        }
Exemple #7
0
        protected void GetContactDetailByContactID()
        {
            CustomProfile         profile        = CustomProfile.GetProfile();
            iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient();

            try
            {
                tAddress conper = new tAddress();
                conper = UCCommonFilter.GetAddressDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr);
                VW_GetUserLocation LocDetail = UCCommonFilter.GetLocationDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr);
                btnSave.Visible = true;
                if (sessionID == null)
                {
                    sessionID = Session.SessionID;
                }
                if (LocDetail.AddressLine1 != null)
                {
                    txtAddress.Text = LocDetail.AddressLine1.ToString();
                }
                if (LocDetail.LocationCode != null)
                {
                    txtLocationCode.Text = LocDetail.LocationCode.ToString();
                }
                txtLocationCode.Enabled = false;
                if (LocDetail.LocationName != null)
                {
                    txtLocationName.Text = LocDetail.LocationName.ToString();
                }
                txtLocationName.Enabled = false;
                if (LocDetail.Name != null)
                {
                    txtContactName.Text = LocDetail.Name.ToString();
                }
                if (LocDetail.MobileNo != null)
                {
                    txtContactNo.Text = LocDetail.MobileNo.ToString();
                }
                if (LocDetail.EmailID != null)
                {
                    txtEmailID.Text = LocDetail.EmailID.ToString();
                }


                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('India','Maharashtra','0','0');", true);
                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','0','0');", true);
                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','" + conper.Zone + "','" + conper.SubZone + "');", true);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "AddEditSearchAddress", "GetContactDetailByContactID");
            }
            finally
            {
                UCCommonFilter.Close();
            }
        }
Exemple #8
0
        public static string WMSaveRequestHead(object objAdr, string State)
        {
            string                result         = "";
            CustomProfile         profile        = CustomProfile.GetProfile();
            iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient();
            tAddress              Adrs           = new tAddress();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objAdr;

                Adrs.AddressLine1 = dictionary["AddressLine1"].ToString();
                Adrs.City         = dictionary["City"].ToString();
                Adrs.County       = "Qatar";
                Adrs.State        = dictionary["State"].ToString();


                if (State == "Edit")
                {
                    Adrs.ID               = Convert.ToInt64(HttpContext.Current.Session["ConID"].ToString());
                    Adrs.LastModifiedBy   = profile.Personal.UserID.ToString();
                    Adrs.LastModifiedDate = DateTime.Now;

                    UCCommonFilter.EditAddress(Adrs, profile.DBConnection._constr);
                }
                else
                {
                    long DID       = Convert.ToInt64(HttpContext.Current.Session["DeptID"].ToString());
                    long CompanyID = UCCommonFilter.GetCompanyIDFromSiteID(DID, profile.DBConnection._constr);

                    Adrs.ObjectName   = "Account";
                    Adrs.ReferenceID  = DID;
                    Adrs.RouteID      = CompanyID;
                    Adrs.CompanyID    = CompanyID;
                    Adrs.Sequence     = 1;
                    Adrs.AddressType  = "none";
                    Adrs.IsDefault    = "N";
                    Adrs.Active       = "Y";//Set Active Y N
                    Adrs.CreatedBy    = profile.Personal.UserID.ToString();
                    Adrs.CreationDate = DateTime.Now;
                    UCCommonFilter.AddIntotAddress(Adrs, profile.DBConnection._constr);
                }
                result = "Address saved successfully";
            }
            catch { result = "Some error occurred"; }
            finally { UCCommonFilter.Close(); }

            return(result);
        }
Exemple #9
0
        public void GetWarehouseAddress()
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            tAddress         getaddr         = new tAddress();

            getaddr               = Warehouseclient.GetWarehouseAddress(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
            txtCAddress1.Text     = getaddr.AddressLine1;
            txtAddress2.Text      = getaddr.AddressLine2;
            txtZipCode.Text       = getaddr.Zipcode;
            hdnCountry.Value      = getaddr.County;
            hdncountryState.Value = getaddr.State;
            txtCity.Text          = getaddr.City;
            //Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + getaddr.County + "','" + getaddr.State + "');", true);
        }
Exemple #10
0
        /// <summary>
        /// Get List Of Address Record By Sequence No
        /// </summary>
        /// <param name="paraSessionID"></param>
        /// <param name="paraUserID"></param>
        /// <param name="paraObjectName"></param>
        /// <param name="paraSequence"></param>
        /// <returns></returns>
        public tAddress GetAddressFromTempTableBySequence(string paraSessionID, string paraUserID, string currentFormID, int paraSequence, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <tAddress> existingAddressList = new List <tAddress>();

            existingAddressList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentFormID, conn);
            /*End*/

            /*Get Filter List [Filter By paraSequence]*/
            tAddress filterList = new tAddress();

            filterList = (from exist in existingAddressList
                          where exist.Sequence == paraSequence
                          select exist).FirstOrDefault();
            return(filterList);
        }
        public AddressNode(tAddress ad)
        {
            if (ad == null)
            {
                return;
            }

            Name = "Address";
            Tag  = ad;
            if (ad.P != null)
            {
                for (int i = 0; i < ad.P.Length; i++)
                {
                    var n = new PNode(ad.P [i]);
                    this.Nodes.Add(n);
                }
            }
        }
Exemple #12
0
        /// <summary>
        /// Tis Is Method To Get Existing Record From tContactPersonDetail and tempdata and merge it
        /// </summary>
        /// <param name="paraSessionID"></param>
        /// <param name="paraUserID"></param>
        /// <param name="paraObjectName"></param>
        /// <returns></returns>
        public List <tAddress> GetExistingTempDataBySessionIDFormID(string paraSessionID, string paraUserID, string currentformid, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            List <tAddress>     ObjAddToAddressList = new List <tAddress>();
            TempData            tempdata            = new TempData();
            tAddress            taddress            = new tAddress();

            tempdata = (from temp in ce.TempDatas
                        where temp.SessionID == paraSessionID &&
                        temp.ObjectName == currentformid &&
                        temp.UserID == paraUserID
                        select temp).FirstOrDefault();

            if (tempdata != null)
            {
                ObjAddToAddressList = datahelper.DeserializeEntity1 <tAddress>(tempdata.Data);
            }
            return(ObjAddToAddressList);
        }
Exemple #13
0
        /// <summary>
        /// This Is Method ToInsert Record In to TempData table
        /// </summary>
        /// <param name="ContactPerson"></param>
        /// <param name="paraSessionID"></param>
        /// <param name="paraUserID"></param>
        /// <param name="paraObjectName"></param>
        /// <returns></returns>

        public List <tAddress> InsertIntoTemp(tAddress Address, string paraSessionID, string paraUserID, string currentformid, string[] conn)
        {
            BISPL_CRMDBEntities ce = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            /*Begin : Get Existing Records from TempData*/
            List <tAddress> existingAddressList = new List <tAddress>();

            existingAddressList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentformid, conn);
            /*End*/

            /*Begin : Merge (Existing + Newly Added) Products to Create TempData of AddToCart*/
            List <tAddress> mergedAddToAddressList = new List <tAddress>();

            mergedAddToAddressList.AddRange(existingAddressList);
            Address.Sequence = existingAddressList.Count + 1;
            mergedAddToAddressList.Add(Address);
            /*End*/

            /*Begin : Serialize & Save MergedAddToCartList*/
            SaveTempDataToDB(mergedAddToAddressList, paraSessionID, paraUserID, currentformid, conn);
            /*End*/

            return(mergedAddToAddressList);
        }
Exemple #14
0
        public List <tAddress> SetValuesToTempData_onChange(string paraSessionID, string paraUserID, string currentformid, int paraSequence, tAddress paraInput, string[] conn)
        {
            BISPL_CRMDBEntities ce           = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
            List <tAddress>     existingList = new List <tAddress>();

            existingList = GetExistingTempDataBySessionIDFormID(paraSessionID, paraUserID, currentformid, conn);

            tAddress editRow = new tAddress();

            editRow = (from exist in existingList
                       where exist.Sequence == paraSequence
                       select exist).FirstOrDefault();
            editRow      = paraInput;
            existingList = existingList.Where(e => e.Sequence != paraSequence).ToList();
            existingList.Add(editRow);
            existingList = (from e in existingList
                            orderby e.Sequence
                            select e).ToList();

            SaveTempDataToDB(existingList, paraSessionID, paraUserID, currentformid, conn);

            return(existingList);
        }
Exemple #15
0
        protected void GetContactDetailByContactID()
        {
            CustomProfile         profile        = CustomProfile.GetProfile();
            iUCCommonFilterClient UCCommonFilter = new iUCCommonFilterClient();

            try
            {
                tAddress conper = new tAddress();
                conper = UCCommonFilter.GetAddressDetailsByID(long.Parse(hdnConID.Value), profile.DBConnection._constr);
                if (sessionID == null)
                {
                    sessionID = Session.SessionID;
                }
                if (conper.AddressLine1 != null)
                {
                    txtAddress.Text = conper.AddressLine1.ToString();
                }
                if (conper.City != null)
                {
                    txtcity.Text = conper.City.ToString();
                }
                bindDropdown();
                ddlState.SelectedIndex = ddlState.Items.IndexOf(ddlState.Items.FindByValue(conper.State.ToString()));

                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('India','Maharashtra','0','0');", true);
                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry1" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','0','0');", true);
                // Page.ClientScript.RegisterStartupScript(GetType(), "fillCountry" + sessionID, "setCountry('" + conper.County + "','" + conper.State + "','" + conper.Zone + "','" + conper.SubZone + "');", true);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "AddEditSearchAddress", "GetContactDetailByContactID");
            }
            finally
            {
                UCCommonFilter.Close();
            }
        }
        public long SaveWarehouseAddress(tAddress WMaddress, string[] conn)
        {
            try
            {
                BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn));
                if (WMaddress.ID == 0)
                {
                    db.tAddresses.AddObject(WMaddress);
                    db.SaveChanges();
                }
                else
                {
                    db.tAddresses.Attach(WMaddress);
                    db.ObjectStateManager.ChangeObjectState(WMaddress, EntityState.Modified);
                    db.SaveChanges();
                }

                return(WMaddress.ID);
            }
            catch
            {
                return(0);
            }
        }
Exemple #17
0
        /// <summary>
        /// This method shows the information to edit all values pre-configured for SMV,
        /// SMVControl and SMVoptions classes.
        /// </summary>
        /// <param name="treeSCL">
        /// TreeNode reference
        /// </param>
        /// <param name="smvc">
        /// Sampled Value Controls class.
        /// </param>
        /// <param name="smvopt">
        /// Sampled Value Options class.
        /// </param>
        /// <param name="smv">
        /// Sampled Value class.
        /// </param>
        /// <param name="oldSMVName">
        /// Control block Name of the SMV.
        /// </param>
        public void SMVHandler(TreeNode treeSCL, object smvc, object smvopt, string[] smv, string oldSMVName)
        {
            SCL sCL = (SCL)treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Tag;
            tSampledValueControl tsmvc = (tSampledValueControl)smvc;

            tsmvc = (tSampledValueControl)smvc;
            tSampledValueControlSmvOpts tsmvco = (tSampledValueControlSmvOpts)smvopt;

            tsmvco = (tSampledValueControlSmvOpts)smvopt;
            this.objectManagement.ModifyObjectOfArrayObjectOfParentObject(tsmvc, treeSCL.TreeView.SelectedNode.Index, treeSCL.TreeView.SelectedNode.Parent.Parent.Tag);
            treeSCL.TreeView.SelectedNode.Tag  = tsmvc;
            treeSCL.TreeView.SelectedNode.Text = tsmvc.name;
            String[] names = new String[4];
            names[0] = "MAC_Address";
            names[1] = "APPID";
            names[2] = "VLAN_PRIORITY";
            names[3] = "VLAN_ID";
            if (sCL.Communication != null)
            {
                TreeNode Conn = this.treeViewSCL.SeekAssociation(treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes,
                                                                 this.objectManagement.FindVariable(
                                                                     this.treeViewSCL.SearchUPForTypeAndGetSCLTreeNode(treeSCL.TreeView.SelectedNode, typeof(tAccessPoint)).Tag, "name").ToString(),
                                                                 this.objectManagement.FindVariable(
                                                                     this.treeViewSCL.SearchUPForTypeAndGetSCLTreeNode(treeSCL.TreeView.SelectedNode, typeof(tIED)).Tag, "name").ToString());
                if (sCL.Communication.SubNetwork != null && Conn != null)
                {
                    for (int i = 0; i < sCL.Communication.SubNetwork.Length; i++)
                    {
                        TreeNode smvN   = treeViewSCL.SeekAssociation(treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[i].Nodes, oldSMVName, "cbName", "tSMV");
                        TreeNode newSMV = smvN;
                        if (smvN != null)
                        {
                            tSMV tsmv = (tSMV)smvN.Tag;
                            tsmv.ldInst  = smv[0];
                            tsmv.cbName  = tsmvc.name;
                            tsmv.desc    = smv[5];
                            tsmvc.datSet = this.datSet.SelectedItem.ToString();                            //victor
                            if (this.objectManagement.ModifyObjectOfArrayObjectOfParentObject(tsmv, smvN.Index, smvN.Parent.Parent.Tag))
                            {
                                if (smvN.FirstNode != null)
                                {
                                    object   arrayOf = smvN.FirstNode.Tag;
                                    tP[]     arr     = (tP[])this.objectManagement.FindVariable(arrayOf, "P");
                                    tAddress tad     = new tAddress();
                                    tsmv.Address = tad;
                                    if (arr != null)
                                    {
                                        for (int x = 0; x < arr.Length; x++)
                                        {
                                            for (int y = 0; y < names.Length; y++)
                                            {
                                                if (arr[x].type.ToString() == names[y])
                                                {
                                                    arr[x].Value = smv[y + 1].ToString();
                                                }
                                            }
                                        }
                                    }
                                    tsmv.Address.P = (tP[])arr;
                                    smvN.Tag       = tsmv;
                                    smvN.Text      = tsmv.cbName;
                                    if (this.objectManagement.ModifyObjectOfArrayObjectOfParentObject((tP[])arr, 0, tsmv.Address.P))
                                    {
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    SMVHandler(tsmvc, tsmvco, smv, treeSCL);
                }
            }
            else
            {
                SMVHandler(tsmvc, tsmvco, smv, treeSCL);
            }
        }
 public PatientAddressViewModel(tAddress address)
 {
     CopyAddressProperties(address);
     CommandSavePatientAddress = new RelayCommand <object>((parameter) => SavePatientAddressData(parameter), (parameter) => CanSave(parameter));
 }
        /// <summary>
        /// This method shows the information to edit all values pre-configured for
        /// subnetwork, connectedAP and tps
        /// </summary>
        /// <param name="treeSCL">
        /// TreeNode reference
        /// </param>
        /// <param name="apParentName">
        /// Name of Access Point where belongs the communication configurations.
        /// </param>
        /// <param name="iedParentName">
        /// Name of IED where belongs the communication configurations.
        /// </param>
        private void CommunicationHandler(TreeNode treeSCL, string apParentName, string iedParentName)
        {
            tConnectedAP tconn = new tConnectedAP();
            tSubNetwork  tsub  = new tSubNetwork();

            tsub.desc = this.descSubNet.Text;
            String[] comm  = new String[6];
            String[] names = new String[6];
            this.nameSubNet.Text = this.nameSubNetCB.SelectedItem.ToString();
            tsub.name            = this.nameSubNet.Text;
            comm[0]  = this.ip.Text;
            comm[1]  = this.mask.Text;
            comm[2]  = this.gateway.Text;
            comm[3]  = this.tsel.Text;
            comm[4]  = this.psel.Text;
            comm[5]  = this.ssel.Text;
            names[0] = "IP";
            names[1] = "IP_SUBNET";
            names[2] = "IP_GATEWAY";
            names[3] = "OSI_TSEL";
            names[4] = "OSI_PSEL";
            names[5] = "OSI_SSEL";
            for (int i = 0; i < this.scl.Communication.SubNetwork.Length; i++)
            {
                if (this.scl.Communication.SubNetwork[i].name == this.nameSubNetCB.SelectedItem.ToString())
                {
                    this.scl.Communication.SubNetwork[i].name = this.nameSubNet.Text;
                    this.scl.Communication.SubNetwork[i].desc = this.descSubNet.Text;
                    TreeNode connected = this.treeViewSCL.SeekAssociation(treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[i].Nodes, apParentName, iedParentName, "apName", "iedName");
                    if (connected != null)
                    {
                        tconn         = (tConnectedAP)connected.Tag;
                        tconn.iedName = iedParentName;
                        tconn.apName  = apParentName;
                        if (this.objectManagement.ModifyObjectOfArrayObjectOfParentObject(tconn, connected.Index, connected.Parent.Parent.Tag))
                        {
                            if (connected.FirstNode != null)
                            {
                                object   arrayOf = connected.FirstNode.Tag;
                                tP[]     arr     = (tP[])this.objectManagement.FindVariable(arrayOf, "P");
                                tAddress tad     = new tAddress();
                                tconn.Address   = tad;
                                tconn.Address.P = arr;
                                connected.Tag   = tconn;
                                if (arr != null)
                                {
                                    for (int j = 0; j < arr.Length; j++)
                                    {
                                        for (int k = 0; k < names.Length; k++)
                                        {
                                            if (arr[j].type.ToString() == names[k])
                                            {
                                                arr[j].Value = comm[k].ToString();
                                            }
                                        }
                                    }
                                    this.objectManagement.ModifyObjectOfArrayObjectOfParentObject((tP[])arr, 0, tconn.Address.P);
                                }
                                else
                                {
                                    DrawCommunication();
                                }
                            }
                            else
                            {
                                DrawCommunication();
                            }
                        }
                    }
                    else
                    {
                        DrawCommunication();
                    }
                }
            }
        }
Exemple #20
0
        /// <summary>
        /// This method shows the information to edit all values pre-configured for SMV,
        /// SMVControl and SMVoptions classes.
        /// </summary>
        /// <param name="sMVControl">
        /// Sampled Value Controls class.
        /// </param>
        /// <param name="sMVOptions">
        /// Sampled Value Options class.
        /// </param>
        /// <param name="smv">
        /// Sampled Value class.
        /// </param>
        /// <param name="treeSCL">
        /// TreeNode reference
        /// </param>
        public void SMVHandler(object sMVControl, object sMVOptions, string[] smv, TreeNode treeSCL)
        {
            tSampledValueControl sMVCtrl = (tSampledValueControl)sMVControl;

            sMVCtrl.datSet = this.datSet.SelectedItem.ToString();
            SCL sCL = (SCL)treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Tag;
            tSampledValueControlSmvOpts sMVOpts = (tSampledValueControlSmvOpts)sMVOptions;
            TreeNode nodeSMVControl             = new TreeNode();
            TreeNode nodeSMV;

            nodeSMVControl.Name = sMVCtrl.name;
            nodeSMVControl.Text = sMVCtrl.name;
            nodeSMVControl.Tag  = sMVCtrl;
            TreeNode nodetSMV;
            tSMV     tsmv = new tSMV();

            if (this.objectManagement.AddObjectToArrayObjectOfParentObject(sMVCtrl, treeSCL.Tag))
            {
                if (treeSCL.TreeView.SelectedNode.Tag is tLN0)
                {
                    tLN0     ln0       = (tLN0)treeSCL.Tag;
                    TreeNode parentSMV = new TreeNode();
                    parentSMV.Name = "tSampledValueControl[]";
                    parentSMV.Text = "SampledValueControl";
                    parentSMV.Tag  = ln0.SampledValueControl;
                    treeSCL.Nodes.Add(parentSMV);
                    treeSCL = parentSMV;
                }
                else
                {
                    treeSCL = treeSCL.TreeView.SelectedNode;
                }
                treeSCL.Nodes.Add(nodeSMVControl);
                this.objectManagement.AddObjectToSCLObject(sMVOpts, sMVCtrl);
                TreeNode nodeOP = new TreeNode();
                nodeOP.Name = "SMVOpts";
                nodeOP.Text = "SMVOpts";
                nodeOP.Tag  = sMVOpts;
                nodeSMVControl.Nodes.Add(nodeOP);
            }
            treeViewSCL.CreateCommNode(sCL, treeSCL);
            TreeNode connAPRef = new TreeNode();

            for (int i = 0; i < sCL.Communication.SubNetwork.Length; i++)
            {
                connAPRef = treeViewSCL.SeekAssociation(treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[i].Nodes, apParentName, iedParentName, "apName", "iedName");
                if (connAPRef == null && sCL.Communication.SubNetwork[i].ConnectedAP == null)
                {
                    treeViewSCL.CreateConnectedNode(sCL, treeSCL, apParentName, iedParentName, i);
                    connAPRef = treeViewSCL.SeekAssociation(treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[i].Nodes, apParentName, iedParentName, "apName", "iedName");
                }
                if (connAPRef != null)
                {
                    tsmv.cbName = sMVCtrl.name;
                    tsmv.ldInst = smv[0];
                    tsmv.desc   = smv[5];
                    nodeSMV     = new TreeNode();
                    this.objectManagement.AddObjectToArrayObjectOfParentObject(tsmv, connAPRef.Tag);
                    if (connAPRef.Nodes["tSMV[]"] == null)
                    {
                        tConnectedAP tconn = (tConnectedAP)connAPRef.Tag;
                        nodeSMV.Text = "SMV";
                        nodeSMV.Name = "tSMV[]";
                        nodeSMV.Tag  = tconn.SMV;
                        connAPRef.Nodes.Add(nodeSMV);
                    }
                    else
                    {
                        nodeSMV = connAPRef.Nodes["tSMV[]"];
                    }
                    nodetSMV      = new TreeNode();
                    nodetSMV.Text = sMVCtrl.name;
                    nodetSMV.Name = smv[0] + "." + sMVCtrl.name;
                    nodetSMV.Tag  = tsmv;
                    nodeSMV.Nodes.Add(nodetSMV);
                    AttributeReferences aReferences = new AttributeReferences();
                    aReferences.Insert(tsmv, nodeSMVControl);
                    tAddress taddr = new tAddress();
                    this.objectManagement.AddObjectToSCLObject(taddr, tsmv);
                    TreeNode nodeAddress = new TreeNode();
                    nodeAddress.Text = "Address";
                    nodeAddress.Name = "Address";
                    nodeAddress.Tag  = taddr;
                    nodetSMV.Nodes.Add(nodeAddress);
                    TreeNode nodetP = new TreeNode();
                    nodetP.Name = "tP[]";
                    nodetP.Text = "P";
                    nodeAddress.Nodes.Add(nodetP);
                    Utils utilsOM = new Utils();

                    tP            t_mac  = new tP();
                    tP_MACAddress t_mac_ = new tP_MACAddress();
                    this.objectManagement.EmptySourcetoDestinyObject(t_mac_, t_mac);
                    t_mac.Value = this.mac.Text;
                    utilsOM.AddTPTreeNode(t_mac, "tP_mac", "tP", taddr, nodetP);

                    tP       t_app  = new tP();
                    tP_APPID t_app_ = new tP_APPID();
                    this.objectManagement.EmptySourcetoDestinyObject(t_app_, t_app);
                    t_app.Value = this.appID.Text;
                    utilsOM.AddTPTreeNode(t_app, "tP_app", "tP", taddr, nodetP);

                    tP t_vlap = new tP();
                    tP_VLANPRIORITY t_vlap_ = new tP_VLANPRIORITY();
                    this.objectManagement.EmptySourcetoDestinyObject(t_vlap_, t_vlap);
                    t_vlap.Value = this.vLANP.Text;
                    utilsOM.AddTPTreeNode(t_vlap, "tP_vlanp", "tP", taddr, nodetP);

                    tP        t_vlani  = new tP();
                    tP_VLANID t_vlani_ = new tP_VLANID();
                    this.objectManagement.EmptySourcetoDestinyObject(t_vlani_, t_vlani);
                    t_vlani.Value = this.vLANI.Text;
                    utilsOM.AddTPTreeNode(t_vlani, "tP_vlani", "tP", taddr, nodetP);
                }
            }
        }
Exemple #21
0
        protected void btncustomernext_Click(object sender, System.EventArgs e)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient WarehouseClient = new iWarehouseClient();

            try
            {
                mWarehouseMaster WHDetail = new mWarehouseMaster();
                tAddress         address  = new tAddress();
                WHDetail.Code          = txtcode.Text.ToString();
                WHDetail.WarehouseName = txtwarehousename.Text.ToString();
                WHDetail.Type          = ddltype.SelectedItem.Text;
                WHDetail.Description   = txtdescription.Text.ToString();
                WHDetail.Remark        = txtremark.Text.ToString();
                WHDetail.Active        = "No";
                if (rbtYes.Checked == true)
                {
                    WHDetail.Active = "Yes";
                }
                WHDetail.CompanyID     = long.Parse(hdncompanyid.Value);
                WHDetail.CustomerID    = long.Parse(hdncustomerid.Value);
                WHDetail.CreatedBy     = profile.Personal.UserID;
                WHDetail.CreationDate  = DateTime.Now;
                address.AddressLine1   = txtCAddress1.Text.ToString();
                address.AddressLine2   = txtAddress2.Text.ToString();
                address.Zipcode        = txtZipCode.Text.ToString();
                address.County         = hdnCountry.Value;
                address.State          = hdncountryState.Value;
                address.City           = txtCity.Text.ToString();
                address.ObjectName     = "Warehouse";
                address.Active         = "Y";
                address.CreatedBy      = profile.Personal.UserID.ToString();
                address.CreationDate   = DateTime.Now;
                address.CompanyID      = long.Parse(hdncompanyid.Value);
                address.AddressType    = "Warehouse";
                hdnWarehouseName.Value = txtwarehousename.Text.ToString();

                Session["WarehouseName"] = txtwarehousename.Text.ToString();
                long WarehouseID = 0;
                WarehouseID         = WarehouseClient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID = WarehouseID;
                long AddressID = WarehouseClient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                hdnwarehouseID.Value = WarehouseID.ToString();
                Session.Add("CompanyID", hdncompanyid.Value);
                if (hdnwarehouseID.Value != "0")
                {
                    ActiveTab("Next");
                    btncustomernext.Visible = false;
                }
                else
                {
                    WebMsgBox.MsgBox.Show("Error Occured");
                }
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Warehouse Master", "Buttonnextsave");
            }
            finally
            {
            }
        }
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            try
            {
                CustomProfile     profile          = CustomProfile.GetProfile();
                mTerritory        objmTerritory    = new mTerritory();
                tAddress          objtAddress      = new tAddress();
                iSiteMasterClient SiteMasterClient = new iSiteMasterClient();
                if (HdnSiteId.Value != "")
                {
                    v_GetSiteDetails SiteDtls = new v_GetSiteDetails();
                    SiteDtls = SiteMasterClient.GetTerritoryListByID(Convert.ToInt64(HdnSiteId.Value), profile.DBConnection._constr);
                    objtAddress.CreatedBy      = SiteDtls.Address_CreatedBy;
                    objtAddress.CreationDate   = SiteDtls.Address_CreationDate;
                    objtAddress.ReferenceID    = SiteDtls.ReferenceID;
                    objtAddress.ID             = SiteDtls.AddressID;
                    objmTerritory.CreatedBy    = SiteDtls.CreatedBy;
                    objmTerritory.CreationDate = SiteDtls.CreationDate;
                }
                else
                {
                    objtAddress.LastModifiedBy     = profile.Personal.UserID.ToString();
                    objtAddress.LastModifiedDate   = DateTime.Now;
                    objmTerritory.LastModifiedBy   = profile.Personal.UserID.ToString();
                    objmTerritory.LastModifiedDate = DateTime.Now;
                }

                objtAddress.AddressLine1 = null;
                if (txtCAddress1.Text.ToString().Trim() != "")
                {
                    objtAddress.AddressLine1 = txtCAddress1.Text;
                }

                objtAddress.County = hdnCountry.Value;
                objtAddress.State  = hdnState.Value;

                objtAddress.City = null;
                if (txtCity.Text.ToString().Trim() != "")
                {
                    objtAddress.City = txtCity.Text;
                }

                objtAddress.Zipcode = null;
                if (txtZipCode.Text.ToString().Trim() != "")
                {
                    objtAddress.Zipcode = txtZipCode.Text;
                }

                objtAddress.Landmark = null;
                if (txtLandMark.Text.ToString().Trim() != "")
                {
                    objtAddress.Landmark = txtLandMark.Text;
                }

                objtAddress.EmailID = null;
                if (txtemailid.Text.ToString().Trim() != "")
                {
                    objtAddress.EmailID = txtemailid.Text;
                }

                objtAddress.PhoneNo = null;
                if (txtphoneno.Text.ToString().Trim() != "")
                {
                    objtAddress.PhoneNo = txtphoneno.Text;
                }

                objtAddress.FaxNo = null;
                if (txtFax.Text.ToString().Trim() != "")
                {
                    objtAddress.FaxNo = txtFax.Text;
                }

                objtAddress.Active = "Y";

                objtAddress.AddressType = "none";

                objtAddress.ObjectName = "Site";

                objtAddress.CompanyID = profile.Personal.CompanyID;

                objmTerritory.Territory = null;
                if (txtSiteName.Text.ToString().Trim() != "")
                {
                    objmTerritory.Territory = txtSiteName.Text;
                }

                objmTerritory.ParentID = null;
                objmTerritory.ParentID = 1; //For HQ

                objmTerritory.Level = null;
                objmTerritory.Level = 2;

                objmTerritory.GroupTitle = null;
                objmTerritory.GroupTitle = "Site";

                if (HdnSiteId.Value == string.Empty)
                {
                    objmTerritory.CreatedBy    = profile.Personal.UserID.ToString();
                    objmTerritory.CreationDate = DateTime.Now;
                    objtAddress.CreatedBy      = profile.Personal.UserID.ToString();
                    objtAddress.CreationDate   = DateTime.Now;
                    long result = SiteMasterClient.InsertSiteMaster(objmTerritory, profile.DBConnection._constr);
                    objtAddress.ReferenceID = result;
                    long result1 = SiteMasterClient.InsertSiteAddress(objtAddress, profile.DBConnection._constr);
                    if (result != 0 && result1 != 0)
                    {
                        WebMsgBox.MsgBox.Show("Record saved successfully");
                    }
                }
                else
                {
                    objmTerritory.ID               = Convert.ToInt64(HdnSiteId.Value);
                    objmTerritory.LastModifiedBy   = profile.Personal.UserID.ToString();
                    objmTerritory.LastModifiedDate = DateTime.Now;
                    objtAddress.LastModifiedBy     = profile.Personal.UserID.ToString();
                    objtAddress.LastModifiedDate   = DateTime.Now;
                    long result = SiteMasterClient.updatemTerritory(objmTerritory, profile.DBConnection._constr);

                    long result1 = SiteMasterClient.updateSiteAddress(objtAddress, profile.DBConnection._constr);
                    if (result != 0 && result1 != 0)
                    {
                        WebMsgBox.MsgBox.Show("Record Update successfully");
                    }
                }
                BindGrid();
                clear();
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Site Master", "pageSave");
            }
            finally
            {
            }
        }
Exemple #23
0
        protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e)
        {
            CustomProfile    profile         = CustomProfile.GetProfile();
            iWarehouseClient Warehouseclient = new iWarehouseClient();
            mWarehouseMaster WHDetail        = new mWarehouseMaster();
            tAddress         address         = new tAddress();

            if (hdnstate.Value == "Edit")
            {
                WHDetail = Warehouseclient.GetWarehouseMasterByID(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
                address  = Warehouseclient.GetWarehouseAddress(long.Parse(hdnwarehouseID.Value), profile.DBConnection._constr);
            }
            WHDetail.Code          = txtcode.Text.ToString();
            WHDetail.WarehouseName = txtwarehousename.Text.ToString();
            WHDetail.Type          = ddltype.SelectedItem.Text;
            WHDetail.Description   = txtdescription.Text.ToString();
            WHDetail.Remark        = txtremark.Text.ToString();
            WHDetail.Active        = "No";
            if (rbtYes.Checked == true)
            {
                WHDetail.Active = "Yes";
            }
            WHDetail.CompanyID = long.Parse(hdncompanyid.Value);
            if (hdncustomerid.Value != "")
            {
                WHDetail.CustomerID = long.Parse(hdncustomerid.Value);
            }
            else
            {
                WHDetail.CustomerID = long.Parse(hdnNewCustomerID.Value);
            }
            WHDetail.CreatedBy    = profile.Personal.UserID;
            WHDetail.CreationDate = DateTime.Now;
            address.AddressLine1  = txtCAddress1.Text.ToString();
            address.AddressLine2  = txtAddress2.Text.ToString();
            address.Zipcode       = txtZipCode.Text.ToString();
            address.County        = hdnCountry.Value;
            address.State         = hdncountryState.Value;
            address.City          = txtCity.Text.ToString();
            address.ObjectName    = "Warehouse";
            address.Active        = "Y";
            address.CreatedBy     = profile.Personal.UserID.ToString();
            address.CreationDate  = DateTime.Now;
            address.CompanyID     = long.Parse(hdncompanyid.Value);
            address.AddressType   = "Warehouse";
            if (hdnstate.Value == "Edit")
            {
                WHDetail.ModifiedBy      = profile.Personal.UserID;
                WHDetail.ModifiedDate    = DateTime.Now;
                address.LastModifiedBy   = profile.Personal.UserID.ToString();
                address.LastModifiedDate = DateTime.Now;
                long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID = WarehouseID;
                long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value));
                UCContactPerson1.ClearContactPerson("Warehouse");
                WebMsgBox.MsgBox.Show("Record Updated successfully");
            }
            else
            {
                long WarehouseID = Warehouseclient.SaveWarehouseMaster(WHDetail, profile.DBConnection._constr);
                address.ReferenceID  = WarehouseID;
                hdnwarehouseID.Value = WarehouseID.ToString();
                long AddressID = Warehouseclient.SaveWarehouseAddress(address, profile.DBConnection._constr);
                UCContactPerson1.FinalSaveContactPerson("Warehouse", long.Parse(hdnwarehouseID.Value));
                UCContactPerson1.ClearContactPerson("Warehouse");
                WebMsgBox.MsgBox.Show("Record saved successfully");
            }
            clear();
            Response.Redirect("WarehouseMaster.aspx");
        }
        /// <summary>
        /// This method draws the Communication nodes on the main tree.
        /// </summary>
        private void DrawCommunication()
        {
            // Add a tCommunication object to SCL
            if (this.scl.Communication == null)
            {
                tCommunication communication = new tCommunication();
                this.scl.Communication = communication;
                nodeComm      = new TreeNode();
                nodeComm.Name = "tCommunication";
                nodeComm.Tag  = this.scl.Communication;
                nodeComm.Text = "tCommunication";
                treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes.Add(nodeComm);
            }
            else
            {
                nodeComm = this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"];
            }
            // Add a Subnetwork
            if (this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"] == null)
            {
                nodeSubNetwork      = new TreeNode();
                nodeSubNetwork.Name = "tSubNetwork[]";
                nodeSubNetwork.Tag  = this.scl.Communication.SubNetwork;
                nodeSubNetwork.Text = "SubNetwork";
                treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes.Add(nodeSubNetwork);
            }
            else
            {
                nodeSubNetwork = this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"];
            }
            if (this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[this.nameSubNet.Text] == null &&
                this.GetNodeName(nodeSubNetwork.Nodes, nameSubNet.Text, "name") == null)
            {
                int sni = this.scl.Communication.AddSubNetwork(this.nameSubNet.Text, this.descSubNet.Text);
                if (sni >= 0)
                {
                    nodetSubNetwork      = new TreeNode();
                    nodetSubNetwork.Name = this.scl.Communication.SubNetwork[sni].name;
                    nodetSubNetwork.Text = "tSubNetwork";
                    nodetSubNetwork.Tag  = this.scl.Communication.SubNetwork[sni];
                    treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes.Add(nodetSubNetwork);
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("Subnetwork couldn't be added. Verify if it already exist and try again",
                                                         "Subnetwork wasn't added",
                                                         System.Windows.Forms.MessageBoxButtons.OK,
                                                         System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
            else
            {
                nodetSubNetwork = this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[this.GetNodeName(nodeSubNetwork.Nodes, nameSubNet.Text, "name")];
            }
            if (this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name].Nodes["tConnectedAP[]"] == null)
            {
                nodeComm      = new TreeNode();
                nodeComm.Name = "tConnectedAP[]";
                nodeComm.Tag  = this.scl.Communication.SubNetwork[nodetSubNetwork.Index].ConnectedAP;
                nodeComm.Text = "ConnectedAP";
                treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"]
                .Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name].Nodes.Add(nodeComm);
            }
            else
            {
                nodeComm = this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name].Nodes["tConnectedAP[]"];
            }

            this.treeViewSCL = new TreeViewSCL();
            connap.apName    = this.apName;
            connap.iedName   = this.iedName;
            if (this.treeViewSCL.SeekAssociation(this.treeSCL.TreeView.Nodes["root"]
                                                 .Nodes["SCL"].Nodes["tCommunication"]
                                                 .Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name]
                                                 .Nodes, this.apName, this.iedName) == null)
            {
                // Create tAddress
                tP[]  tp  = new tP[6];
                tP_IP _ip = new tP_IP();
                _ip.Value = this.ip.Text;
                tp[0]     = _ip;

                tP_IPSUBNET _subnet = new tP_IPSUBNET();
                _subnet.Value = this.mask.Text;
                tp[1]         = _subnet;

                tP_IPGATEWAY _gate = new tP_IPGATEWAY();
                _gate.Value = this.gateway.Text;
                tp[2]       = _gate;

                tP_OSITSEL _tsel = new tP_OSITSEL();
                _tsel.Value = this.tsel.Text;
                tp[3]       = _tsel;

                tP_OSISSEL _ssel = new tP_OSISSEL();
                _ssel.Value = this.ssel.Text;
                tp[4]       = _ssel;

                tP_OSIPSEL _psel = new tP_OSIPSEL();
                _psel.Value = this.psel.Text;
                tp[5]       = _psel;

                tAddress addr = new tAddress();
                addr.P = tp;

                tIED ied  = this.scl.IED[this.scl.GetIED(this.iedName)];
                int  api  = ied.GetAP(this.apName);
                int  capi = this.scl.Communication
                            .SubNetwork[nodetSubNetwork.Index].AddConnectedAP(ied, api, addr, null);
                if (capi >= 0)
                {
                    AttributeReferences refe = new AttributeReferences();
                    nodetConnected      = new TreeNode();
                    nodetConnected.Name = "tConnectedAP" + this.iedName + this.apName;
                    nodetConnected.Tag  = this.scl.Communication.SubNetwork[nodetSubNetwork.Index].ConnectedAP[capi];
                    nodetConnected.Text = "tConnectedAP";
                    treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"]
                    .Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name]
                    .Nodes["tConnectedAP[]"].Nodes.Add(nodetConnected);
                    refe.Insert(this.scl.Communication.SubNetwork[nodetSubNetwork.Index].ConnectedAP[capi],
                                this.treeSCL.TreeView.SelectedNode);

                    // Add Nodes for tAddress and tP
                    TreeNode nodeAddress = new TreeNode();
                    nodeAddress.Name = "Adress";
                    nodeAddress.Tag  = address;
                    nodeAddress.Text = "Address";
                    treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"]
                    .Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name]
                    .Nodes["tConnectedAP[]"].Nodes[nodetConnected.Name].Nodes.Add(nodeAddress);
                    nodeP.Name = "tP[]";
                    nodeP.Text = "P";
                    treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"]
                    .Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name]
                    .Nodes["tConnectedAP[]"].Nodes[nodetConnected.Name]
                    .Nodes["Adress"].Nodes.Add(nodeP);

                    Utils.AddTPTreeNode(_ip, nodeP);
                    Utils.AddTPTreeNode(_subnet, nodeP);
                    Utils.AddTPTreeNode(_gate, nodeP);
                    Utils.AddTPTreeNode(_tsel, nodeP);
                    Utils.AddTPTreeNode(_psel, nodeP);
                    Utils.AddTPTreeNode(_ssel, nodeP);
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("ConnectedAP couldn't be added. Verify if it already exist and try again",
                                                         "ConnectedAP wasn't added",
                                                         System.Windows.Forms.MessageBoxButtons.OK,
                                                         System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
            else
            {
                nodetConnected = this.treeViewSCL.SeekAssociation(this.treeSCL.TreeView.Nodes["root"].Nodes["SCL"].Nodes["tCommunication"].Nodes["tSubNetwork[]"].Nodes[nodetSubNetwork.Name].Nodes["tConnectedAP[]"].Nodes, this.apName, this.iedName, "apName", "iedName");
            }
        }