// GET: Sections/ReportViewer
        //public ActionResult ReportViewer(int? projectId)
        //{
        //    if (projectId == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    int siteCoID = base.siteusercompanyid;

        //    // Getting error while updating EF model so use for temporary only.
        //    ViewBag.ProjectList = (from x in db.ProjectInfo
        //                           where x.SiteCoID == siteCoID
        //                           select new SelectListItem
        //                           {
        //                               Text = x.ProjectName,
        //                               Value = x.ProjectID.ToString()
        //                           }).ToList();

        //    var reports = db.GetProjectReportByProjectID(projectId).ToList();
        //    ProjectReportModel projectReportModel = new ProjectReportModel();
        //    projectReportModel.TotalRecord = reports.Count();
        //    if (reports != null)
        //    {
        //        GetProjectReportByProjectID_Result report = reports.FirstOrDefault();
        //        if (report != null)
        //        {
        //            byte[] imagem = (byte[])(report.LOGO);
        //            string base64String = Convert.ToBase64String(imagem);
        //            projectReportModel.ViewID = report.ViewID;
        //            projectReportModel.Logo = String.Format("data:image/jpg;base64,{0}", base64String);
        //            projectReportModel.Company = report.Company;
        //            projectReportModel.CoAddress = report.CoAddress;
        //            projectReportModel.CoAddress2 = report.CoAddress2;
        //            projectReportModel.CoPhone = report.CoPhone;
        //            projectReportModel.Date = report.Date;
        //            projectReportModel.Customer = report.Customer;
        //            projectReportModel.CustomerAddress1 = report.CustomerAddress1;
        //            projectReportModel.CustomerAddress2 = report.CustomerAddress2;
        //            projectReportModel.ProjectName = report.ProjectName;
        //            projectReportModel.ProjectAddress = report.ProjectAddress;
        //            projectReportModel.ProjectAddress2 = report.ProjectAddress2;
        //            projectReportModel.Area = report.Area;
        //            projectReportModel.AreaDescription = string.Empty;
        //            projectReportModel.ProjectReportItemList = new List<ProjectReportItem>();
        //            foreach (var r in reports)
        //            {
        //                ProjectReportItem item = new ProjectReportItem();
        //                item.Division = r.Division;
        //                item.Hrs = r.Hrs;
        //                item.Item = r.Item;
        //                item.ItemDesription = string.Empty;
        //                item.Price = r.Price;
        //                item.Qty = r.Qty;
        //                projectReportModel.ProjectReportItemList.Add(item);
        //            }
        //        }
        //    }

        //    return View(projectReportModel);
        //}
        // GET: Sections/ShortViewer
        public ActionResult ShortViewer(int?projectId)
        {
            if (projectId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            int siteCoID = base.siteusercompanyid;

            // Getting error while updating EF model so use for temporary only.
            ViewBag.ProjectList = (from x in db.ProjectInfo
                                   where x.SiteCoID == siteCoID
                                   select new SelectListItem
            {
                Text = x.ProjectName,
                Value = x.ProjectID.ToString()
            }).ToList();

            var reports = db.GetProjectReportByProjectID(projectId).ToList();
            ProjectReportModel projectReportModel = new ProjectReportModel();

            projectReportModel.TotalRecord = reports.Count();
            if (reports != null)
            {
                GetProjectReportByProjectID_Result report = reports.FirstOrDefault();
                if (report != null)
                {
                    byte[] imagem       = (byte[])(report.LOGO);
                    string base64String = Convert.ToBase64String(imagem);
                    projectReportModel.ViewID                = report.ViewID;
                    projectReportModel.Logo                  = String.Format("data:image/jpg;base64,{0}", base64String);
                    projectReportModel.Company               = report.Company;
                    projectReportModel.CoAddress             = report.CoAddress;
                    projectReportModel.CoAddress2            = report.CoAddress2;
                    projectReportModel.CoPhone               = report.CoPhone;
                    projectReportModel.Date                  = report.Date;
                    projectReportModel.Customer              = report.Customer;
                    projectReportModel.CustomerAddress1      = report.CustomerAddress1;
                    projectReportModel.CustomerAddress2      = report.CustomerAddress2;
                    projectReportModel.ProjectName           = report.ProjectName;
                    projectReportModel.ProjectAddress        = report.ProjectAddress;
                    projectReportModel.ProjectAddress2       = report.ProjectAddress2;
                    projectReportModel.Area                  = report.Area;
                    projectReportModel.AreaDescription       = string.Empty;
                    projectReportModel.ProjectReportItemList = new List <ProjectReportItem>();
                    foreach (var r in reports)
                    {
                        ProjectReportItem item = new ProjectReportItem();
                        item.Division       = r.Division;
                        item.Hrs            = r.Hrs;
                        item.Item           = r.Item;
                        item.ItemDesription = string.Empty;
                        item.Price          = r.Price;
                        item.Qty            = r.Qty;
                        projectReportModel.ProjectReportItemList.Add(item);
                    }
                }
            }

            return(View(projectReportModel));
        }
Exemple #2
0
        public ProjectReportModel GetReportDetail(string admin_login_id, string report_id, string detail_type)
        {
            ProjectReportModel model = new ProjectReportModel();

            model.Report_id     = report_id;
            model.Rpt_name      = GetReportNameByReportId(report_id);
            model.Project_right = GetProjectReportDetailRightList(admin_login_id, report_id, detail_type);
            return(model);
        }
Exemple #3
0
        public IActionResult AddProjectReport(ProjectReportModel model)
        {
            Entity.ProjectReport report;

            if (model.Snapshots?.Any() == true)
            {
                report = _pimsService.ProjectReport.Add(_mapper.Map <Entity.ProjectReport>(model), _mapper.Map <IEnumerable <Entity.ProjectSnapshot> >(model.Snapshots));
            }
            else
            {
                report = _pimsService.ProjectReport.Add(_mapper.Map <Entity.ProjectReport>(model));
            }
            return(CreatedAtAction(nameof(GetProjectReport), new { id = report.Id }, _mapper.Map <ProjectReportModel>(report)));
        }
Exemple #4
0
        public List <ProjectReportModel> GetProjectReportList(string modules, string admin_login_id, int group_id)
        {
            List <ProjectReportModel> result = new List <ProjectReportModel>();
            var ds = ReportRepository.GetReportByGroupID(group_id);

            if (ds != null && ds.Tables.Count != 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ProjectReportModel item = new ProjectReportModel();
                    item.Report_id             = dr["id"].ToString();
                    item.Rpt_name              = dr["rpt_name"].ToString();
                    item.Show_project_item_ind = dr["show_project_item_ind"].ToString();
                    item.Cwrf_recur            = dr["cwrf_recur"].ToString();
                    item.Cnt = ReportNotAccessRepository.GetReportCntByLoginIdRptID(admin_login_id, item.Report_id, modules);
                    result.Add(item);
                }
            }
            return(result);
        }
Exemple #5
0
        /// <summary>
        /// Action for generating the project report.
        /// </summary>
        /// <returns></returns>
        public ActionResult ProjectReport()
        {
            ProjectReportModel model = new ProjectReportModel();

            model.Iterations  = QueryHelper.Instance.GetIterations();
            model.UserStories = QueryHelper.Instance.GetStories();
            model.InitCollections();

            if (model.Iterations.Any())
            {
                model.ProjectStartDate   = model.Iterations.First().StartDate;
                model.ProjectReleaseDate = model.Iterations.Last().FinishDate;
            }

            ViewBag.Labels             = (new JavaScriptSerializer()).Serialize(model.getIterationDates());
            ViewBag.CompletedSPValues  = (new JavaScriptSerializer()).Serialize(model.getIterationSPCompletedValues());
            ViewBag.TotalSPValues      = (new JavaScriptSerializer()).Serialize(model.getIterationSPTotalValues());
            ViewBag.ValuesPercentChart = (new JavaScriptSerializer()).Serialize(model.getPercentChartValues());
            ViewBag.DatesPercentChart  = (new JavaScriptSerializer()).Serialize(model.getPercentChartDates());

            return(View(model));
        }
Exemple #6
0
        public IActionResult GetProjectReportSnapshots(int reportId, ProjectReportModel model)
        {
            var snapshots = _pimsService.ProjectReport.GetSnapshots(_mapper.Map <Entity.ProjectReport>(model));

            return(new JsonResult(_mapper.Map <ProjectSnapshotModel[]>(snapshots)));
        }
Exemple #7
0
 public IActionResult DeleteProjectReport(int id, ProjectReportModel model)
 {
     _pimsService.ProjectReport.Remove(_mapper.Map <Entity.ProjectReport>(model));
     return(new JsonResult(model));
 }
Exemple #8
0
        public IActionResult UpdateProjectReport(int id, ProjectReportModel model)
        {
            var report = _pimsService.ProjectReport.Update(_mapper.Map <Entity.ProjectReport>(model));

            return(new JsonResult(_mapper.Map <ProjectReportModel>(report)));
        }
Exemple #9
0
        public IActionResult AddProjectReport(ProjectReportModel model)
        {
            var report = _pimsService.ProjectReport.Add(_mapper.Map <Entity.ProjectReport>(model));

            return(CreatedAtAction(nameof(GetProjectReport), new { id = report.Id }, _mapper.Map <ProjectReportModel>(report)));
        }