public ActionResult UpdateStream(ContinousIntegration.Models.NewStreamModel tstream, string Command)
        {
            if (!ModelState.IsValid)
            {
                return(PartialView("_EditStream", tstream));
            }
            else
            {
                T_Streams Obj = new T_Streams();
                Obj.C_StreamName   = tstream.C_StreamName;
                Obj.C_ProjectID    = tstream.C_ProjectID;
                Obj.C_StreamID     = tstream.C_StreamID;
                Obj.C_LastModified = DateTime.Now;


                bool IsSuccess = sobjModel.UpdateStream(Obj);
                if (IsSuccess)
                {
                    TempData["OperStatus"] = "Stream updated successfully";
                    ModelState.Clear();
                    return(RedirectToAction("SearchStream", "ManageProjects"));
                }
            }

            return(PartialView("_EditRelease"));
        }
Exemplo n.º 2
0
        public List <NewStreamModel> GetStreamPage(int pageNumber, int pageSize, string searchCriteria)
        {
            if (pageNumber < 1)
            {
                pageNumber = 1;
            }


            var RequiredProjectModel = (from a in entities.T_Projects
                                        join b in entities.T_Streams
                                        on a.C_ProjectID equals b.C_ProjectID
                                        select new { a.C_ProjectName, a.C_ProjectID, b.C_StreamID, b.C_StreamName, b.C_LastModified })
                                       .ToList();

            //Populate NewStreamModel with the required properties

            List <NewStreamModel> streams = new List <NewStreamModel>();

            NewStreamModel newobj;

            foreach (var item in RequiredProjectModel)
            {
                newobj = new NewStreamModel();

                newobj.C_ProjectID    = item.C_ProjectID;
                newobj.C_ProjectName  = item.C_ProjectName;
                newobj.C_StreamID     = item.C_StreamID;
                newobj.C_StreamName   = item.C_StreamName;
                newobj.C_LastModified = item.C_LastModified;

                streams.Add(newobj);
            }

            return(streams);

            // return IEnumerable<>
            //  .OrderBy(m => m.C_StreamID)
            //.Skip((pageNumber - 1) * pageSize)
            //.Take(pageSize)
            //.ToList();
        }
        public List<NewStreamModel> GetStreamPage(int pageNumber, int pageSize, string searchCriteria)
        {
            if (pageNumber < 1)
                pageNumber = 1;

            var RequiredProjectModel = (from a in entities.T_Projects
                                        join b in entities.T_Streams
                                        on a.C_ProjectID equals b.C_ProjectID
                                        select new { a.C_ProjectName, a.C_ProjectID, b.C_StreamID, b.C_StreamName, b.C_LastModified })
                                        .ToList();

            //Populate NewStreamModel with the required properties

            List<NewStreamModel> streams = new List<NewStreamModel>();

            NewStreamModel newobj;
            foreach (var item in RequiredProjectModel)
            {
                newobj = new NewStreamModel();

                newobj.C_ProjectID = item.C_ProjectID;
                newobj.C_ProjectName = item.C_ProjectName;
                newobj.C_StreamID = item.C_StreamID;
                newobj.C_StreamName = item.C_StreamName;
                newobj.C_LastModified = item.C_LastModified;

                streams.Add(newobj);
            }

            return streams;

               // return IEnumerable<>
            //  .OrderBy(m => m.C_StreamID)
            //.Skip((pageNumber - 1) * pageSize)
            //.Take(pageSize)
            //.ToList();
        }
        /// <summary>
        /// Method to populate the edit popup
        /// </summary>
        /// <param name="page"></param>
        /// <param name="sort"></param>
        /// <param name="sortDir"></param>
        /// <returns></returns>
        //Edit Stream
        public ActionResult EditStream(int streamId)
        {
            ContinuousIntegrationEntities ci = new ContinuousIntegrationEntities();
            var data = sobjModel.GetStreamDetails(streamId);

            if (Request.IsAjaxRequest())
            {
                NewStreamModel Obj = new NewStreamModel();
                Obj.C_StreamName = data.C_StreamName;
                Obj.C_ProjectID = data.C_ProjectID;
                Obj.C_StreamID = data.C_StreamID;
                Obj.C_LastModified = data.C_LastModified;

                ViewBag.ProjectName = new SelectList(ci.T_Projects, "C_ProjectID", "C_ProjectName");
                ViewBag.IsUpdate = true;
                return View("_EditStream", Obj);
            }
            else
                return View(data);
        }