コード例 #1
0
        public ActionResult ItemsLists()
        {
            TrackerItem ti   = new TrackerItem();
            var         itms = ti.GetAll();

            return(View(itms));
        }
コード例 #2
0
        public async Task <ActionResult <TrackerItem> > PostTrackerItem(TrackerItem trackerItem)
        {
            _context.TrackerItem.Add(trackerItem);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTrackerItem", new { id = trackerItem.Id }, trackerItem));
        }
コード例 #3
0
    public void Start()
    {
        DontDestroyOnLoad(gameObject);
        quit = false;
        ToolTracker.Create();
        TI         = new TrackerItem();
        TI2        = new RawDataItem();
        actionList = "";


        toolMap = new Dictionary <string, ToolData>();
        toolMap.Add("A", new ToolData("Camera Tool", 0, 0));
        toolMap.Add("B", new ToolData("Boolean Tool", 0, 0));
        toolMap.Add("C", new ToolData("Clone Tool", 0, 0));
        toolMap.Add("D", new ToolData("Draw Face Tool", 0, 0));
        toolMap.Add("E", new ToolData("Extrude Face Tool", 0, 0));
        toolMap.Add("F", new ToolData("Loft Tool", 0, 0));
        toolMap.Add("G", new ToolData("Group Tool", 0, 0));
        toolMap.Add("I", new ToolData("Primitive Tool", 0, 0));
        toolMap.Add("K", new ToolData("Clipping Tool", 0, 0));
        toolMap.Add("L", new ToolData("Line Tool", 0, 0));
        toolMap.Add("M", new ToolData("Mirror Tool", 0, 0));
        toolMap.Add("N", new ToolData("Selection Tool", 0, 0));
        toolMap.Add("O", new ToolData("Polygon Tool", 0, 0));
        toolMap.Add("P", new ToolData("Paint Tool", 0, 0));
        toolMap.Add("R", new ToolData("Eraser Tool", 0, 0));
        toolMap.Add("S", new ToolData("Spline Tool", 0, 0));
        toolMap.Add("U", new ToolData("No Tool", 0, 0));
        toolMap.Add("V", new ToolData("Gravity Tool", 0, 0));
        toolMap.Add("X", new ToolData("Extrude Curve Tool", 0, 0));
        toolMap.Add("Z", new ToolData("Measuring Tool", 0, 0));
    }
コード例 #4
0
        public ActionResult Edit(TrackerItem itm)
        {
            TrackerItem ti = new TrackerItem();

            ti.Update(itm);
            return(RedirectToAction("ItemsList"));
        }
コード例 #5
0
        public async Task <IActionResult> PutTrackerItem(int id, TrackerItem trackerItem)
        {
            if (id != trackerItem.Id)
            {
                return(BadRequest());
            }

            _context.Entry(trackerItem).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TrackerItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
コード例 #6
0
        public ActionResult Delete(int Id)
        {
            TrackerItem itm = db.TrackerItems.Find(Id);

            db.TrackerItems.Remove(itm);
            db.SaveChanges();
            return(RedirectToAction("ItemsList"));
        }
コード例 #7
0
        public ActionResult DetailsView(int Id)
        {
            List <TrackerItem> itm   = new List <TrackerItem>();
            TrackerItem        tritm = new TrackerItem();

            itm = tritm.GetTrackerItems();
            TrackerItem vm = itm.Where(m => m.ItemId == Id).FirstOrDefault();

            return(View(vm));
        }
コード例 #8
0
        public ActionResult Edit(int ID)
        {
            ViewBag.CategoryVB     = new SelectList(db.ItemCategories.Select(m => m.CategoryId));
            ViewBag.ItemTypeVB     = new SelectList(db.ItemTypes.Select(m => m.ItemTypeId));
            ViewBag.ItemStatusVB   = new SelectList(db.ItemStatuses.Select(m => m.ItemStatusId));
            ViewBag.ItemPriorityVB = new SelectList(db.ItemPriorities.Select(m => m.PriorityId));

            TrackerItem itm = db.TrackerItems.Find(ID);

            return(View(itm));
        }
コード例 #9
0
        public ActionResult ItemsList(TrackerItem ti)
        {
            ViewBag.Project        = new SelectList(db.projects, "ProjectId", "ProjectName");
            ViewBag.CategoryVB     = new SelectList(db.ItemCategories, "CategoryId", "CategoryName");
            ViewBag.ItemTypeVB     = new SelectList(db.ItemTypes, "ItemTypeId", "ItemName");
            ViewBag.ItemStatusVB   = new SelectList(db.ItemStatuses, "ItemStatusId", "ItemStatusName");
            ViewBag.ItemPriorityVB = new SelectList(db.ItemPriorities, "PriorityId", "PriorityName");

            var items = db.TrackerItems.Where(m => m.ItemCategoryId == ti.ItemCategoryId || m.ItemStatusId == ti.ItemStatusId || m.ItemTypeId == ti.ItemTypeId || m.ItemProjectId == ti.ItemProjectId || m.ItemPriorityId == ti.ItemPriorityId);

            return(View(items));
        }
コード例 #10
0
        public ActionResult ItemsList()
        {
            TrackerItem ti = new TrackerItem();

            ViewBag.Project        = new SelectList(db.projects, "ProjectId", "ProjectName");
            ViewBag.CategoryVB     = new SelectList(db.ItemCategories, "CategoryId", "CategoryName");
            ViewBag.ItemTypeVB     = new SelectList(db.ItemTypes, "ItemTypeId", "ItemName");
            ViewBag.ItemStatusVB   = new SelectList(db.ItemStatuses, "ItemStatusId", "ItemStatusName");
            ViewBag.ItemPriorityVB = new SelectList(db.ItemPriorities, "PriorityId", "PriorityName");

            var res = db.TrackerItems.Include(m => m.project).Include(m => m.ItemCategory).Include(m => m.ItemType).Include(m => m.ItemStatus).Include(m => m.ItemPriority).ToList();

            return(View(res));
        }
コード例 #11
0
        public ActionResult ItemsList()
        {
            TrackerItem ti = new TrackerItem();

            ViewBag.Project        = new SelectList(db.projects, "ProjectId", "ProjectName");
            ViewBag.CategoryVB     = new SelectList(db.ItemCategories, "CategoryId", "CategoryName");
            ViewBag.ItemTypeVB     = new SelectList(db.ItemTypes, "ItemTypeId", "ItemName");
            ViewBag.ItemStatusVB   = new SelectList(db.ItemStatuses, "ItemStatusId", "ItemStatusName");
            ViewBag.ItemPriorityVB = new SelectList(db.ItemPriorities, "PriorityId", "PriorityName");
            using (var _dbContext = new ProjectManagementDbContext())
            {
                var itms = _dbContext.TrackerItems.ToList();
                return(View(itms));
            }
        }
コード例 #12
0
        //Standard way of deleting
        //public ActionResult Delete(int ID)
        //{
        //    TrackerItem itmObj = new TrackerItem();
        //    var item = itmObj.GetById(ID);
        //    if (item != null) {
        //    ViewBag.DeleteMessage = item.ItemId + " " + item.ItemType;
        //    ViewBag.ItemId = item.ItemId;
        //}
        //    return View();
        //}
        //[HttpPost]
        //public ActionResult Delete(FormCollection frm)
        //{
        //    TrackerItem itmObj = new TrackerItem();
        //    var item = itmObj.GetById(Convert.ToInt32(frm["ItemId"]));
        //    itmObj.Delete(item);

        //    ViewBag.DeleteConfirmation = "Item deleted successfully  "+ item.ItemId + " " + item.ItemType;

        //    return View();
        //}


        // Another approach of Delete using Ajax
        public JsonResult Delete(int ID)
        {
            int         i      = 0;
            TrackerItem itmObj = new TrackerItem();
            var         item   = itmObj.GetById(ID);

            i = itmObj.Delete(item);

            if
            (i == 1)
            {
                return(Json(new { message = "success" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { message = "failure" }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #13
0
 // this the validation method
 private bool ValidateForm(TrackerItem itm)
 {
     if (itm.ItemId == 0)
     {
         ModelState.AddModelError("ItemId", "Please enter Item Id.");
     }
     else if (itm.ItemSummary == null)
     {
         ModelState.AddModelError("ItemSummary", "Please enter ItemSummary");
     }
     else if (itm.ItemCategory == 0)
     {
         ModelState.AddModelError("ItemCategory", "Please enter ItemCategory");
     }
     else if (itm.ItemType == 0)
     {
         ModelState.AddModelError("ItemType", "Please enter ItemCategory");
     }
     else if (itm.ItemPriority == "0")
     {
         ModelState.AddModelError("Priority", "Please enter Priority");
     }
     else if (itm.ItemCreatedDate == null)
     {
         ModelState.AddModelError("ItemCreatedDate", "Please enter Date");
     }
     else if (itm.CreatedBy == null)
     {
         ModelState.AddModelError("CreatedBy", "Please enter CreatedBy");
     }
     else if (itm.Owner == null)
     {
         ModelState.AddModelError("Owner", "Please enter Owner");
     }
     //else if (itm.Impact == null)
     //    ModelState.AddModelError("Impact", "Please enter Impact");
     //else if (itm.Resolution == null)
     //    ModelState.AddModelError("Resolution", "Please enter Resolution");
     else if (itm.ResolvedDate == null)
     {
         ModelState.AddModelError("Resolved", "Please enter Resolved");
     }
     return(ModelState.IsValid);
 }
コード例 #14
0
        public ActionResult Edit(int ID)
        {
            // To be Loaded in Edit form
            ItemCategory itmCatg = new ItemCategory();
            ItemType     itmTy   = new ItemType();
            ItemStatus   itmSts  = new ItemStatus();
            ItemPriority itmPry  = new ItemPriority();

            TrackerItem itmObj = new TrackerItem();
            var         item   = itmObj.GetById(ID);

            ViewBag.CategoryVB     = new SelectList(itmCatg.GetItemCategories(), "CategoryId", "CategoryName", item.ItemCategory);
            ViewBag.ItemTypeVB     = new SelectList(itmTy.GetItemTypes(), "ItemTypeId", "ItemName", item.ItemType);
            ViewBag.ItemStatusVB   = new SelectList(itmSts.GetItemStatus(), "ItemStatusId", "ItemStatusName", item.ItemStatus);
            ViewBag.ItemPriorityVB = new SelectList(itmPry.GetItemPriority(), "PriorityId", "PriorityName", item.ItemPriority);


            return(View(item));
        }
コード例 #15
0
        public ActionResult CreateItem(TrackerItem itm, HttpPostedFileBase file)
        {
            var fileName = String.Empty;

            if (file != null && file.ContentLength > 0)
            {
                fileName = Path.GetFileName(file.FileName);
                var path = Path.Combine(Server.MapPath("~/Content/upload_attachements"), fileName);
                file.SaveAs(path);
            }
            if (ValidateForm(itm))
            {
                if (ModelState.IsValid)
                {
                    db.TrackerItems.Add(itm);
                    db.SaveChanges();
                    return(RedirectToAction("ItemsList", "Home"));
                }
            }
            return(View());
        }
コード例 #16
0
        public ActionResult CreateItem()
        {
            //ViewBag.ItemId = db.TrackerItems.Max(p => p.ItemId) + 1;
            int dat = db.TrackerItems.Select(m => m.ItemId).Count();

            if (dat == 0)
            {
                ViewBag.ItemId = 1;
            }
            else
            {
                ViewBag.ItemId = db.TrackerItems.Max(p => p.ItemId) + 1;
            }

            ViewBag.Project        = new SelectList(db.projects, "ProjectId", "ProjectName");
            ViewBag.CategoryVB     = new SelectList(db.ItemCategories, "CategoryId", "CategoryName");
            ViewBag.ItemTypeVB     = new SelectList(db.ItemTypes, "ItemTypeId", "ItemName");
            ViewBag.ItemStatusVB   = new SelectList(db.ItemStatuses, "ItemStatusId", "ItemStatusName");
            ViewBag.ItemPriorityVB = new SelectList(db.ItemPriorities, "PriorityId", "PriorityName");
            TrackerItem itm = new TrackerItem();

            return(View(itm));
        }
コード例 #17
0
 public BodyAnalytics()
 {
     Item = new TrackerItem();
 }
コード例 #18
0
        public ActionResult CreateItem(TrackerItem itm, HttpPostedFileBase file)
        {
            //var ItemCategory = frm["ItemCategory"];
            // var CategoryId = frm["CategoryId"];
            //var ItemTypeId = frm["ItemType"];
            //var Priority = frm["Priority"];

            //var ItemCreatedDate = frm["ItemCreatedDate"];
            //var CreatedBy = frm["CreatedBy"];
            //var Owner = frm["Owner"];
            //var Imapct = frm["Imapct"];
            //var Resolution = frm["Resolution"];
            //var Resolved =frm["Resolved"];

            var fileName = String.Empty;

            if (ValidateForm(itm))
            {
                //File Validation
                if (file != null && file.ContentLength > 0)
                {
                    fileName = Path.GetFileName(file.FileName);
                    var path = Path.Combine(Server.MapPath("~/Content/upload_attachements"), fileName);
                    file.SaveAs(path);
                }

                // After data validation Success
                TrackerItem ti = new TrackerItem();
                ti.ItemId = itm.ItemId;

                ti.ProjectName = itm.ProjectName;
                ti.ItemSummary = itm.ItemSummary;


                ti.ItemCategory = itm.ItemCategory;
                ti.ItemPriority = itm.ItemPriority;

                ti.ItemType        = itm.ItemType;
                ti.ItemStatus      = itm.ItemStatus;
                ti.ItemSummary     = itm.ItemSummary;
                ti.CreatedBy       = itm.CreatedBy;
                ti.ItemCreatedDate = itm.ItemCreatedDate;
                ti.ParentId        = itm.ParentId;
                ti.AssignedTo      = itm.AssignedTo;
                ti.AssignedDate    = itm.AssignedDate;
                ti.ItemEndDate     = itm.ItemEndDate;
                ti.Owner           = itm.Owner;
                ti.WorkCompleted   = itm.WorkCompleted;
                ti.ResolvedDate    = itm.ResolvedDate;
                ti.Impact          = itm.Impact;
                ti.Resolution      = itm.Resolution;
                ti.AttachmentPath  = fileName;

                ti.Add(ti);

                //Add button Valid True
                if (ModelState.IsValid)
                {
                    ViewBag.Message = "Item has created successfully.";
                    return(RedirectToAction("ItemsList", "Home"));
                }

                //ViewBag.Message = "Item has created successfully.";
                //RedirectToAction("ItemsList","Home");
            }
            else
            {
                //Error
                ViewBag.Message = "There are errors in creating Item.";
            }


            ItemCategory itmCatg = new ItemCategory();
            ItemType     itmTy   = new ItemType();
            ItemStatus   itmSts  = new ItemStatus();
            ItemPriority itmPry  = new ItemPriority();

            ViewBag.CategoryVB     = new SelectList(itmCatg.GetItemCategories(), "CategoryId", "CategoryName");
            ViewBag.ItemTypeVB     = new SelectList(itmTy.GetItemTypes(), "ItemTypeId", "ItemName");
            ViewBag.ItemStatusVB   = new SelectList(itmSts.GetItemStatus(), "ItemStatusId", "ItemStatusName");
            ViewBag.ItemPriorityVB = new SelectList(itmPry.GetItemPriority(), "PriorityId", "PriorityName");
            return(View());
        }
コード例 #19
0
        public ActionResult ItemsList(TrackerItem ti)
        {
            var items = db.TrackerItems.Where(m => m.ItemCategoryId == ti.ItemCategoryId || m.ItemStatusId == ti.ItemStatusId || m.ItemTypeId == ti.ItemTypeId || m.project == ti.project || m.ItemPriorityId == ti.ItemPriorityId);

            return(View(items));
        }
コード例 #20
0
        protected void jnpTrackerGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            TrackerItemCollection collection = TrackerItem.GetCollectionForUser(CurrentUserID);

            jnpTrackerGrid.DataSource = collection;
        }
コード例 #21
0
 public ActionResult DetailsView(TrackerItem vm)
 {
     return(RedirectToAction("Edit"));
 }
コード例 #22
0
        protected void jnpTrackerGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                HideRefreshButton(e);

                if (e.Item is GridDataItem)
                {
                    GridDataItem gridDataItem = e.Item as GridDataItem;

                    if (gridDataItem.ItemType == GridItemType.Item || gridDataItem.ItemType == GridItemType.AlternatingItem || gridDataItem.ItemType == GridItemType.SelectedItem)
                    {
                        TrackerItem trackerItem            = e.Item.DataItem as TrackerItem;
                        string      checkedoutdt           = string.Empty;
                        string      editedBy               = string.Empty;
                        Image       imgJNPCheckedOutStatus = gridDataItem.FindControl("imgJNPCheckedOutStatus") as Image;
                        Image       scheduleStatusImage    = gridDataItem.FindControl("imgScheduleStatus") as Image;
                        Label       scheduleStatusLabel    = gridDataItem.FindControl("lblScheduleStatus") as Label;
                        imgJNPCheckedOutStatus.Visible = false;

                        if (trackerItem.IsCheckedOut)
                        {
                            if (trackerItem.CheckedOutDate != null)
                            {
                                checkedoutdt = string.Format(trackerItem.CheckedOutDate.ToString(), "d");

                                editedBy = String.Format("Being edited by {0} since {1}", trackerItem.CheckedOutBy, checkedoutdt);
                            }
                            imgJNPCheckedOutStatus.Visible = true;
                            if (trackerItem.CheckedOutByID == CurrentUserID)
                            {
                                imgJNPCheckedOutStatus.ImageUrl = Page.ResolveUrl(String.Format("~/App_Themes/{0}/Images/Icons/icon_unlock.gif", Page.Theme));
                            }
                            else
                            {
                                imgJNPCheckedOutStatus.ImageUrl = Page.ResolveUrl(String.Format("~/App_Themes/{0}/Images/Icons/icon_lock.gif", Page.Theme));
                                imgJNPCheckedOutStatus.ToolTip  = editedBy;
                                gridDataItem.ToolTip            = editedBy;
                            }
                        }


                        RadMenu menuAction = gridDataItem.FindControl("jnpTrackerMenu") as RadMenu;

                        menuAction.Attributes["JNPID"] = trackerItem.JNPID.ToString();

                        RadMenuItem viewMenuItem     = menuAction.FindItemByValue("View");
                        RadMenuItem editMenuItem     = menuAction.FindItemByValue("Edit");
                        RadMenuItem continueMenuItem = menuAction.FindItemByValue("ContinueEdit");
                        RadMenuItem finishMenuItem   = menuAction.FindItemByValue("FinishEdit");

                        viewMenuItem.Visible     = trackerItem.CanViewJNP;
                        editMenuItem.Visible     = trackerItem.CanEditJNP;
                        continueMenuItem.Visible = trackerItem.CanContinueEditJNP;
                        finishMenuItem.Visible   = trackerItem.CanFinishEditJNP;

                        enumScheduleStatus scheduleStatus = trackerItem.JNPScheduleStatus;
                        scheduleStatusImage.ImageUrl = Page.ResolveUrl(ScheduleStatusIconURL(scheduleStatus));
                        string scaduleStatusName = EnumHelper <enumScheduleStatus> .GetEnumDescription(scheduleStatus.ToString());

                        scheduleStatusImage.ToolTip = scaduleStatusName;
                        scheduleStatusLabel.Text    = scaduleStatusName;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionBase.HandleException(ex);
            }
        }
コード例 #23
0
 public ActionResult Edit(TrackerItem itm)
 {
     db.Entry(itm).State = EntityState.Modified;
     db.SaveChanges();
     return(RedirectToAction("ItemsList"));
 }
コード例 #24
0
        public ActionResult DetailsView(int Id)
        {
            TrackerItem itm = db.TrackerItems.Find(Id);

            return(View(itm));
        }