示例#1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < ConductorList.Count; i++)
            {
                Atend.Global.Calculation.General.General.AutoCAdConductorList Cond = (Atend.Global.Calculation.General.General.AutoCAdConductorList)ConductorList[i];
                Atend.Base.Design.DBranch          Branch  = Atend.Base.Design.DBranch.AccessSelectByCode(Cond.ConductorGuid);
                Atend.Base.Equipment.EConductorTip condTip = Atend.Base.Equipment.EConductorTip.AccessSelectByCode(Branch.ProductCode);
                //ed.WriteMessage("CondTip.Code= "+condTip.Code+"\n");
                Atend.Base.Acad.AT_INFO at_info = Atend.Base.Acad.AT_INFO.SelectBySelectedObjectId(Cond.ConductorObjectID);
                if (gvConductor.Rows.Count > 0)
                {
                    //Branch.ProductCode = Convert.ToInt32(gvConductor.Rows[gvConductor.CurrentRow.Index].Cells[0].Value.ToString());
                    //Branch.XCode = new Guid(gvConductor.Rows[gvConductor.CurrentRow.Index].Cells[0].Value.ToString());
                    //if (chkIsExist.CheckState == CheckState.Unchecked && cboIsExist.SelectedIndex == 0)
                    //    Branch.IsExist = 0;
                    //if (chkIsExist.Checked && cboIsExist.SelectedIndex == 0)
                    //    Branch.IsExist = 1;
                    //if (chkIsExist.Checked && cboIsExist.SelectedIndex == 1)
                    //    Branch.IsExist = 2;

                    //Branch.IsExist = chkIsExist.Checked;
                    Branch.Number = condTip.Description;
                    //if (Branch.AccessUpdate())
                    //{

                    //    //at_info.ProductCode = Convert.ToInt32(gvConductor.Rows[gvConductor.CurrentRow.Index].Cells[0].Value.ToString());

                    //    //**EDIT**
                    //    ////at_info.ProductCode = Convert.ToInt32(gvConductor.Rows[gvConductor.CurrentRow.Index].Cells[0].Value.ToString());
                    //    ////at_info.Insert();
                    //    //ed.WriteMessage("Branch.Number= " + Branch.Number + "\n");
                    //    //ed.WriteMessage("Branch.OBJID=  " + Cond.ConductorObjectID + "\n");
                    //    Atend.Global.Acad.UAcad.ChangeBranchText(Cond.ConductorObjectID, Branch.Number);
                    //}
                    //else
                    //{
                    //    MessageBox.Show("ويرايش امكان پذير نمي باشد");
                    //}
                }
            }

            AllowClose = true;
            Close();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();

            int ConductorCounter       = 1;
            PromptSelectionOptions pso = new PromptSelectionOptions();

            pso.MessageForAdding = "\n Select Area where you want :";

            PromptSelectionResult psr = ed.GetSelection(pso);
            SelectionSet          ss  = psr.Value;

            ObjectId[] ids = ss.GetObjectIds();

            foreach (ObjectId oi in ids)
            {
                Atend.Global.Calculation.General.General.AutoCAdConductorList Item =
                    new Atend.Global.Calculation.General.General.AutoCAdConductorList();
                Atend.Base.Acad.AT_INFO at_info = Atend.Base.Acad.AT_INFO.SelectBySelectedObjectId(oi);
                //ed.WriteMessage("ProductCode=" + at_info.ProductCode + " nodeType= " + at_info.NodeType + "ParentCode=" + at_info.ParentCode + "\n");
                if (at_info.NodeCode != "NONE" && at_info.NodeType == (int)Atend.Control.Enum.ProductType.Conductor)
                {
                    //ed.WriteMessage("at_info=" + at_info.ParentCode + "\n");
                    Item.ConductorGuid     = new Guid(at_info.NodeCode);
                    Item.ConductorObjectID = at_info.SelectedObjectId;
                    ConductorList.Add(Item);
                    ConductorCounter++;
                }
            }



            this.Show();
            lblSelected.Text = ConductorCounter.ToString();
            //ed.WriteMessage("FinishSelect\n");
        }