Ejemplo n.º 1
0
        public ActionResult OrganizationChartView(long id)
        {
            var organizationChart_vm = new OrganizationChartViewModel();

            organizationChart_vm.OrganizationsByLevel = GetOrganizationChartData(id);
            return(View(UrlHelpers.View("~/Administration/Views/Organization/_OrganizationChartView.cshtml"), organizationChart_vm));
        }
Ejemplo n.º 2
0
        public ActionResult OrganizationChart()
        {
            OrganizationChartViewModel organizationChart_vm = new OrganizationChartViewModel();

            organizationChart_vm.OrganizationsByLevel = GetOrganizationChartData(1);
            return(View(UrlHelpers.View("~/Administration/Views/Organization/OrganizationChart.cshtml"), organizationChart_vm));
        }
        public ActionResult PrintChartData(String chartData)
        {
            OrganizationChartViewModel datamodel = new OrganizationChartViewModel();

            try
            {
                string newfileName = string.Format("donloadPDF");
                return(new Rotativa.ViewAsPdf("GenerateOrganizationChartPDF", datamodel)
                {
                    PageSize = Size.A4,
                    PageOrientation = Orientation.Landscape,
                    FileName = newfileName
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult OrgChartDetails()
        {
            List <OrganizationChartViewModel> ObjEmp = new List <OrganizationChartViewModel>();
            var data = _OrgChartMethod.GetDetails();

            if (data.Count > 0)
            {
                foreach (var details in data)
                {
                    OrganizationChartViewModel datamodal = new OrganizationChartViewModel();
                    datamodal.EmpId = details.Id;
                    datamodal.Name  = details.FirstName;
                    datamodal.LengthOfEmployeement = _OrgChartMethod.getTotalWorkingDayInfo(Convert.ToInt32(details.Id));
                    datamodal.ReportsTo            = details.Reportsto;
                    datamodal.Value = details.Value;
                    ObjEmp.Add(datamodal);
                }
            }
            return(Json(ObjEmp, JsonRequestBehavior.AllowGet));
        }
        public ActionResult BusiOrgChartDetails(int BusiID, int DivID, int PoolID, int FunID, int EmpTypeId, string futureStater)
        {
            List <OrganizationChartViewModel> ObjEmp = new List <OrganizationChartViewModel>();
            var data = _OrgChartMethod.GetBusinessDetails(BusiID, DivID, PoolID, FunID, EmpTypeId);

            futureStater = futureStater.ToUpper();
            if (futureStater == "ON")
            {
                data = _OrgChartMethod.GetBusinessDetails(BusiID, DivID, PoolID, FunID, EmpTypeId);
            }
            else if (futureStater == "OFF")
            {
                data = _OrgChartMethod.GetBusinessDetails(BusiID, DivID, PoolID, FunID, EmpTypeId).Where(x => x.StartDate >= DateTime.Now).ToList();;
            }

            if (data.Count > 0)
            {
                foreach (var details in data)
                {
                    OrganizationChartViewModel datamodal = new OrganizationChartViewModel();
                    datamodal.EmpId = details.Id;
                    datamodal.Name  = details.FirstName;
                    if (data.Any(x => x.Id == details.Reportsto))
                    {
                        datamodal.ReportsTo = details.Reportsto;
                    }
                    else
                    {
                        datamodal.ReportsTo = null;
                    }
                    datamodal.LengthOfEmployeement = _OrgChartMethod.getTotalWorkingDayInfo(Convert.ToInt32(details.Id));
                    //datamodal.ReportsTo = details.Reportsto==null ?  (details.Reportsto):"Vacant";
                    datamodal.Value      = details.Value;
                    datamodal.ImageUrl   = details.ImageUrl;
                    datamodal.BusinessID = Convert.ToInt32(details.BusinessID);
                    ObjEmp.Add(datamodal);
                }
            }
            return(Json(ObjEmp, JsonRequestBehavior.AllowGet));
        }
        public OrganizationChartViewModel returnList()
        {
            OrganizationChartViewModel datamodel = new OrganizationChartViewModel();

            foreach (var item in _CompanyStructureMethod.getAllBusinessList())
            {
                datamodel.BusinessList.Add(new SelectListItem()
                {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            var ResourceType = _CompanyStructureMethod.getAllSystemValueListByKeyName("Job Role List");

            foreach (var item in ResourceType)
            {
                datamodel.ResourceTypeList.Add(new SelectListItem()
                {
                    Text = @item.Value, Value = @item.Id.ToString()
                });
            }
            //datamodel.BusinessID = (int)data.BusinessID;
            return(datamodel);
        }
        // GET: OrganizationChart
        public ActionResult Index()
        {
            OrganizationChartViewModel datamodel = new OrganizationChartViewModel();
            var BUsinessList = _CompanyStructureMethod.getAllBusinessList();

            //datamodel.BusinessList.Add(new SelectListItem() { Text = "-- Select Project --", Value = "0" });
            foreach (var item in BUsinessList)
            {
                datamodel.BusinessList.Add(new SelectListItem()
                {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            var ResourceType = _CompanyStructureMethod.getAllSystemValueListByKeyName("Job Role List");

            foreach (var item in ResourceType)
            {
                datamodel.ResourceTypeList.Add(new SelectListItem()
                {
                    Text = @item.Value, Value = @item.Id.ToString()
                });
            }
            return(View(datamodel));
        }