예제 #1
0
        private void AddInactiveNoc(Document doc, bool pinned = false)
        {
            var inactiveNoc = new Noc(doc, _synchronizer, contextMenuEditor);

            inactiveNoc.Pinned = pinned;

            // let's hook up events
            inactiveNoc.CaretPositionChanged += NocCaretPositionChanged;
            inactiveNoc.Enter           += Noc_Enter;
            inactiveNoc.TokenExpired    += TokenExpiredWhileSaving;
            inactiveNoc.NocTitleChanged += NocTitleChanged;
            inactiveNoc.Status          += Status;
            SettingsChanged             += inactiveNoc.SettingsChanged;

            // let's add the new Noc to tabcontrol
            tabs.Controls.Add(inactiveNoc);

            // let's update the selectedIndex
            var selectedIndex = (tabs.TabCount - 1);

            if (selectedIndex < 0)
            {
                selectedIndex = 0;
            }
            tabs.SelectedIndex = selectedIndex;
            SetMainTitle(doc.Title);

            // let's also make sure "Save to file" is enabled
            menuSaveFileAs.Enabled = true;
        }
예제 #2
0
        private void AddNoc()
        {
            var untitledNoc = new Noc(_synchronizer, contextMenuEditor)
            {
                Name = "Untitled"
            };

            // let's hook up events
            untitledNoc.CaretPositionChanged += NocCaretPositionChanged;
            untitledNoc.Enter           += Noc_Enter;
            untitledNoc.TokenExpired    += TokenExpiredWhileSaving;
            untitledNoc.NocTitleChanged += NocTitleChanged;
            untitledNoc.Status          += Status;
            untitledNoc.Text             = "Untitled";
            SettingsChanged             += untitledNoc.SettingsChanged;

            // let's add the new Noc to tabcontrol
            tabs.Controls.Add(untitledNoc);

            // let's update the selectedIndex
            var selectedIndex = (tabs.TabCount - 1);

            if (selectedIndex < 0)
            {
                selectedIndex = 0;
            }
            tabs.SelectedIndex = selectedIndex;
            SetMainTitle("Untitled");

            // let's also make sure "Save to file" is enabled
            menuSaveFileAs.Enabled = true;
        }
예제 #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Noc noc = db.Nocs.Find(id);

            db.Nocs.Remove(noc);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #4
0
 public ActionResult Edit([Bind(Include = "NocID,DateOfReciept,NameAndAdressAppl,NatOfNoc,DateOfVp,NoOfResolution,IssueOrReject,RejectedReason,DateOfComm,Remarks,RegisterTypeID")] Noc noc)
 {
     ViewBag.RegisterTypeID = noc.RegisterTypeID;
     if (ModelState.IsValid)
     {
         db.Entry(noc).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", new { rt = noc.RegisterTypeID }));
     }
     return(View(noc));
 }
예제 #5
0
        // GET: Nocs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Noc noc = db.Nocs.Find(id);

            if (noc == null)
            {
                return(HttpNotFound());
            }
            return(View(noc));
        }
예제 #6
0
        // GET: Nocs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Noc noc = db.Nocs.Find(id);

            ViewBag.RegisterTypeID = noc.RegisterTypeID;
            if (noc == null)
            {
                return(HttpNotFound());
            }
            return(View(noc));
        }