private void btnOk_Click(object sender, EventArgs e) { Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; Atend.Global.Acad.DrawEquips.AcDrawCatOut DrawCatOut = new Atend.Global.Acad.DrawEquips.AcDrawCatOut(); if (Validation()) { if (Convert.ToBoolean(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[2].Value) == false) { DrawCatOut.UseAccess = true; DrawCatOut.ECatOut = Atend.Base.Equipment.ECatOut.AccessSelectByCode(Convert.ToInt32(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[1].Value.ToString())); } else if (Convert.ToBoolean(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[2].Value)) { DrawCatOut.UseAccess = false; DrawCatOut.ECatOut = Atend.Base.Equipment.ECatOut.SelectByXCode(new Guid(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[0].Value.ToString())); } DrawCatOut.Existance = Convert.ToByte(cboIsExist.SelectedValue); DrawCatOut.ProjectCode = Convert.ToInt32(cboProjCode.SelectedValue); DrawCatOut.SelectedObjectId = ObjID; Atend.Base.Design.DPackage dpack = Atend.Base.Design.DPackage.AccessSelectByCode(NodeCode); if (DrawCatOut.UpdateCatOutData(dpack.Code)) { ed.WriteMessage("Update CatOut Success \n"); AllowClose = true; this.Close(); } } }
private void btnOk_Click(object sender, EventArgs e) { Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; Atend.Global.Acad.DrawEquips.AcDrawCatOut DrawCatout = new Atend.Global.Acad.DrawEquips.AcDrawCatOut(); Atend.Base.Design.DKeyStatus keystatus = Atend.Base.Design.DKeyStatus.SelectByNodeCode(NodeCode); if (Validation()) { if (Convert.ToBoolean(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[2].Value) == false) { DrawCatout.UseAccess = true; DrawCatout.ECatOut = Atend.Base.Equipment.ECatOut.AccessSelectByCode(Convert.ToInt32(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[0].Value.ToString())); } else if (Convert.ToBoolean(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[2].Value)) { DrawCatout.UseAccess = false; DrawCatout.ECatOut = Atend.Base.Equipment.ECatOut.SelectByXCode(new Guid(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[1].Value.ToString())); } Atend.Base.Base.BEquipStatus status = Atend.Base.Base.BEquipStatus.SelectByCode(Convert.ToInt32(cboIsExist.SelectedValue)); DrawCatout.Existance = status.ACode; if (rdbClose.Checked) { keystatus.IsClosed = true; } else { keystatus.IsClosed = false; } DrawCatout.DKeyStatus = keystatus; if (cboProjCode.Items.Count == 0) { DrawCatout.ProjectCode = 0; } else { DrawCatout.ProjectCode = Convert.ToInt32(cboProjCode.SelectedValue); } DrawCatout.SelectedObjectId = ObjID; Atend.Base.Design.DPackage dpack = Atend.Base.Design.DPackage.AccessSelectByCode(NodeCode); if (DrawCatout.UpdateCatOutData(dpack.Code)) { ed.WriteMessage("Update Rod Success \n"); AllowClose = true; this.Close(); } } //if (Validation()) //{ // if (Convert.ToBoolean(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[2].Value) == true)//Local // { // Atend.Base.Acad.AcadGlobal.CatOutData.eCatOut = Atend.Base.Equipment.ECatOut.SelectByXCode(new Guid(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[0].Value.ToString())); // Atend.Base.Acad.AcadGlobal.CatOutData.UseAccess = false; // } // else//Access // { // Atend.Base.Acad.AcadGlobal.CatOutData.eCatOut = Atend.Base.Equipment.ECatOut.AccessSelectByCode(Convert.ToInt32(gvCatOut.Rows[gvCatOut.CurrentRow.Index].Cells[1].Value.ToString())); // Atend.Base.Acad.AcadGlobal.CatOutData.UseAccess = true; // } // Atend.Base.Acad.AcadGlobal.CatOutData.Existance =Convert.ToByte(cboIsExist.SelectedValue); // Atend.Base.Acad.AcadGlobal.CatOutData.ProjectCode = Convert.ToInt32(cboProjCode.SelectedValue); // AllowToclose = true; //} //else //{ // AllowToclose = false; //} }