static void Main() { //Access and lock the current document and database Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; DocumentLock lckdoc = doc.LockDocument(); Editor ed = doc.Editor; //Gather all the xrefs from the document, if there are any List <BlockTableRecord> xlist = ProjectSetup.Xref_List(doc); //Get a list of layouts/layoutids List <Layout> listoflayouts = new List <Layout>(); List <ObjectId> listoflayids = Project_Setup.ProjectSetup.Project_ListOfLayoutIds(doc); ed.WriteMessage("\n There are {0} layouts in this model", listoflayids.Count); // The objectIDs for the BlockTableRecords of the Model and PaperSpace layouts var mspace = listoflayids[0]; var pspaces = listoflayids.GetRange(1, (listoflayids.Count() - 1)); using (Transaction tr = db.TransactionManager.StartTransaction()) { foreach (Layout l in listoflayouts) { var l_name = l.LayoutName; var layout_extents = l.Extents; var layout_limits = l.Limits; ObjectId lbtr_id = l.BlockTableRecordId; BlockTableRecord l_btr = tr.GetObject(lbtr_id, OpenMode.ForRead) as BlockTableRecord; List <ObjectId> objs_inLayout = new List <ObjectId>(); foreach (ObjectId x in l_btr) { objs_inLayout.Add(x); } int o = objs_inLayout.Count(); foreach (BlockTableRecord x in xlist) { ObjectIdCollection BlockRefIdsColl = x.GetBlockReferenceIds(true, true); List <ObjectId> BRI_list = new List <ObjectId>(); foreach (ObjectId objid in BlockRefIdsColl) { BRI_list.Add(objid); } ObjectId BlockId = BRI_list[0]; BlockReference blref = tr.GetObject(BlockId, OpenMode.ForRead) as BlockReference; var block_bounds = blref.Bounds; var block_geoextents = blref.GeometricExtents; //var block_xtra = blref.Wb } } } }
public virtual JsonResult Manage(ProjectSetup model) { JOperationResult res = new JOperationResult() { Status = false }; if (ModelState.IsValid) { res = _appConfigBiz.CreateEdit(model).ToJOperationResult(); } return(Json(res, JsonRequestBehavior.AllowGet)); }
public ActionResult EditHead(ProjectSetup model) { if (ModelState.IsValid) { GetProjectIdAsyncByJustBackRequest(); var projectTemp = _context.Projects.FirstOrDefault(c => c.Id == ProjectId); projectTemp.Title = model.Title; projectTemp.DateEnd = model.Date; projectTemp.Price = model.Price; _context.SaveChanges(); return(RedirectToAction("Index", "Home")); } else { return(View(Request.Headers["Referer"])); } }
private void editDataToolStripMenuItem_Click(object sender, EventArgs e) { try { if (this.MdiChildren.Any(x => x.GetType() == typeof(ProjectSetup))) { Form frm = this.MdiChildren.Single(x => x.GetType() == typeof(ProjectSetup)); frm.WindowState = FormWindowState.Normal; frm.BringToFront(); } else { ProjectSetup frm = new ProjectSetup(); frm.Service = this.Service; frm.MdiParent = this; frm.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error while Opening Edit Window."); } }
public async Task <ActionResult> CreateAsync(ProjectSetup model) { if (ModelState.IsValid) { await GetProjectIdAsync(); var projectTemp = _context.Projects.FirstOrDefault(c => c.Id == ProjectId); projectTemp.Title = model.Title; projectTemp.DateEnd = model.Date; projectTemp.DateStart = DateTime.Today; projectTemp.Price = model.Price; projectTemp.Money = "0"; projectTemp.Name_owner = _applicationUser.UserName; projectTemp.Users = ""; projectTemp.Pay = ""; _context.SaveChanges(); return(RedirectToAction("CreateContent", "Project")); } else { return(View(Request.Headers["Referer"])); } }
private void ControlPageTitle() { try { _objProjectSetup = new ProjectSetup(); _objProjectSetup.PageTitle = Page.Title == "" ? null : Page.Title; lblWelcomeMessage.Text = clsMessages.GWelcome; lblLoginEmployeeName.Text = LoginUserInformation.EmployeeFullName; if (_objProjectSetup.PageTitle != null) { lblAt.Text = clsMessages.GYouAreAt; lblPageTitle.Text = _objProjectSetup.PageTitle + clsMessages.GFullStop; } else { lblAt.Text = string.Empty; lblPageTitle.Text = string.Empty; } } catch (Exception msgException) { throw msgException; } }