Exemplo n.º 1
0
        public DashboardVM GetDashboardSiteVM(string ParentFilter, string ChildFilter, DateTime fromDate, DateTime toDate, string Panel1Option, Int64 Panel1Value, string Panel2Option, Int64 Panel2Value, Int64 UserId, string FilterOption, int Offset, int PageSize, string CountryId, string Client = null, string Scopes = null, string Projects = null)
        {
            try
            {
                DashboardDL db = new DashboardDL();
                DataSet     ds = db.GetDashboardSites(ParentFilter, ChildFilter, fromDate, toDate, Panel1Option, Panel1Value, Panel2Option, Panel2Value, UserId, FilterOption, Offset, PageSize, CountryId, Client, Scopes, Projects);
                // DataTable TotalSites =;
                DataTable   DashboardData = ds.Tables[0];
                DashboardVM vm            = new DashboardVM();

                ClientSitesVM ClientSites = new ClientSitesVM();
                ClientSites.Sites = GetSitesFromTable(ds.Tables[0]);

                vm.ClientSites = ClientSites;
                if (ds.Tables.Count == 2)
                {
                    DataTable Count = ds.Tables[1];
                    vm.Count = (!string.IsNullOrEmpty(Count.Rows[0]["Count"].ToString())) ? Convert.ToInt32(Count.Rows[0]["Count"].ToString()) : 0;
                }

                return(vm);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
        public List <SitesVM> GetSiteLocationsForSchedule(string ParentFilter, string ChildFilter, DateTime fromDate, DateTime toDate, string Panel1Option, Int64 Panel1Value, string Panel2Option, Int64 Panel2Value, Int64 UserId, string CountryId, string Client, string Scopes, string Markets)
        {
            List <SitesVM> lstSites = new List <SitesVM>();
            DashboardDL    db       = new DashboardDL();
            DataTable      dt       = db.GetSiteLocationsForSchedule(ParentFilter, ChildFilter, fromDate, toDate, Panel1Option, Panel1Value, Panel2Option, Panel2Value, UserId, CountryId, Client, Scopes, Markets);

            lstSites = GetSitesFromTable(dt);

            return(lstSites);
        }
Exemplo n.º 3
0
        public DashboardVM GetDashboardVM(string ParentFilter, string ChildFilter, DateTime fromDate, DateTime toDate, DataTable dtCiteies, string Panel1Option, Int64 Panel1Value, string Panel2Option, Int64 Panel2Value, Int64 UserId, string CountryId, string Client, string Scopes, string Markets, string Projects)
        {
            try
            {
                DashboardDL db = new DashboardDL();
                DataSet     ds = db.GetDashboardData(ParentFilter, ChildFilter, fromDate, toDate, dtCiteies, Panel1Option, Panel1Value, Panel2Option, Panel2Value, UserId, CountryId, Client, Scopes, Markets, Projects);
                // DataTable TotalSites =;
                DataTable   DashboardData = ds.Tables[1];
                DashboardVM vm            = new DashboardVM();

                ClientSitesVM ClientSites = new ClientSitesVM();
                ClientSites.Sites = GetSitesFromTable(ds.Tables[0]);

                vm.ClientSites = ClientSites;

                ClientSites.Markers = GetSitesFromTable(ds.Tables[4]);



                DashboardStatusVM SiteStatuses = new DashboardStatusVM();

                SiteStatuses.TotalSites        = Convert.ToInt32(DashboardData.Rows[0]["TotalSites"] is DBNull ? 0 : DashboardData.Rows[0]["TotalSites"]);
                SiteStatuses.PendingSites      = Convert.ToInt32(DashboardData.Rows[0]["PendingSites"] is DBNull ? 0 : DashboardData.Rows[0]["PendingSites"]);
                SiteStatuses.InProcessSites    = Convert.ToInt32(DashboardData.Rows[0]["InProcessSites"] is DBNull ? 0 : DashboardData.Rows[0]["InProcessSites"]);
                SiteStatuses.CompletedSites    = Convert.ToInt32(DashboardData.Rows[0]["CompletedSites"] is DBNull ? 0 : DashboardData.Rows[0]["CompletedSites"]);
                SiteStatuses.DriveCompleted    = Convert.ToInt32(DashboardData.Rows[0]["DriveCompletedSites"] is DBNull ? 0 : DashboardData.Rows[0]["DriveCompletedSites"]);
                SiteStatuses.PendingWithIssues = Convert.ToInt32(DashboardData.Rows[0]["PendingWithIssuesSites"] is DBNull ? 0 : DashboardData.Rows[0]["PendingWithIssuesSites"]);
                SiteStatuses.InProgress        = Convert.ToInt32(DashboardData.Rows[0]["InProgress"] is DBNull ? 0 : DashboardData.Rows[0]["InProgress"]);
                SiteStatuses.ReportSubmitted   = Convert.ToInt32(DashboardData.Rows[0]["ReportSubmitted"] is DBNull ? 0 : DashboardData.Rows[0]["ReportSubmitted"]);

                vm.SiteStatuses = SiteStatuses;

                List <RegionsVM> regionVm = GetRegionalSitesFromTable(ds.Tables[2]);
                List <RegionsVM> testerVm = GetTesterSitesFromTable(ds.Tables[3]);

                //  List<RegionsVM> driveTesterVm = GetTesterSitesFromTable(ds.Tables[3]);// GetDriveTesterSitesFromTable(ds.Tables[4]);

                vm.Regions          = regionVm;
                vm.TesterSites      = testerVm;
                vm.DriveTesterSites = testerVm;


                return(vm);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        public DashboardVM GetProjectDashboardVM(string ParentFilter, string ChildFilter, DateTime fromDate, DateTime toDate, DataTable dtCiteies, string Panel1Option, Int64 Panel1Value, string Panel2Option, Int64 Panel2Value, Int64 UserId, string CountryId, string Client, string Scopes, string Markets)
        {
            try
            {
                DashboardDL db = new DashboardDL();
                DataSet     ds = db.GetProjectDashboardData(ParentFilter, ChildFilter, fromDate, toDate, dtCiteies, Panel1Option, Panel1Value, Panel2Option, Panel2Value, UserId, CountryId, Client, Scopes, Markets);

                DashboardVM vm = new DashboardVM();

                DataTable DashboardData = ds.Tables[0];
                DataTable dtSiteWO      = ds.Tables[1];


                DashboardStatusVM SiteStatuses = new DashboardStatusVM();
                SiteStatuses.TotalSites        = Convert.ToInt32(DashboardData.Rows[0]["TotalSites"] is DBNull ? 0 : DashboardData.Rows[0]["TotalSites"]);
                SiteStatuses.PendingSites      = Convert.ToInt32(DashboardData.Rows[0]["PendingSites"] is DBNull ? 0 : DashboardData.Rows[0]["PendingSites"]);
                SiteStatuses.InProcessSites    = Convert.ToInt32(DashboardData.Rows[0]["InProcessSites"] is DBNull ? 0 : DashboardData.Rows[0]["InProcessSites"]);
                SiteStatuses.CompletedSites    = Convert.ToInt32(DashboardData.Rows[0]["CompletedSites"] is DBNull ? 0 : DashboardData.Rows[0]["CompletedSites"]);
                SiteStatuses.DriveCompleted    = Convert.ToInt32(DashboardData.Rows[0]["DriveCompletedSites"] is DBNull ? 0 : DashboardData.Rows[0]["DriveCompletedSites"]);
                SiteStatuses.PendingWithIssues = Convert.ToInt32(DashboardData.Rows[0]["PendingWithIssuesSites"] is DBNull ? 0 : DashboardData.Rows[0]["PendingWithIssuesSites"]);
                SiteStatuses.InProgress        = Convert.ToInt32(DashboardData.Rows[0]["InProgress"] is DBNull ? 0 : DashboardData.Rows[0]["InProgress"]);
                SiteStatuses.ReportSubmitted   = Convert.ToInt32(DashboardData.Rows[0]["ReportSubmitted"] is DBNull ? 0 : DashboardData.Rows[0]["ReportSubmitted"]);
                vm.SiteStatuses = SiteStatuses;


                if (dtSiteWO != null && dtSiteWO.Rows.Count > 0)
                {
                    for (int i = 0; i < dtSiteWO.Rows.Count; i++)
                    {
                        SitesVM sv = new SitesVM();
                        sv.SubmittedOn = Convert.ToDateTime(dtSiteWO.Rows[i]["Date"].ToString());
                        sv.SiteCount   = int.Parse(dtSiteWO.Rows[i]["SiteCount"].ToString());
                        vm.lstSiteWO.Add(sv);
                    }
                }
                return(vm);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public List <RegionsVM> GetPartialDriveTesterSites(string ParentFilter, string ChildFilter, DateTime StartDate, DateTime EndDate, string RegionFilter, Int64 UserId, Int64 FilterValue, string FilterType2, string FilterValue2)
        {
            List <RegionsVM> lstSites = new List <RegionsVM>();

            try
            {
                DashboardDL db            = new DashboardDL();
                DataTable   dtTestersites = db.GetPartialRegionalSites(ParentFilter, ChildFilter, StartDate, EndDate, RegionFilter, UserId, FilterValue, FilterType2, FilterValue2);

                if (dtTestersites.Rows.Count > 0)
                {
                    RegionsVM loSite;
                    for (int i = 0; i < dtTestersites.Rows.Count; i++)
                    {
                        loSite                   = new RegionsVM();
                        loSite.ID                = Convert.ToInt64(dtTestersites.Rows[i]["TesterId"]);
                        loSite.RegionName        = dtTestersites.Rows[i]["TesterName"].ToString();
                        loSite.TesterImage       = dtTestersites.Rows[i]["Picture"].ToString();
                        loSite.TotalSites        = Convert.ToInt32(dtTestersites.Rows[i]["TesterTotalSites"]);
                        loSite.PendingSites      = Convert.ToInt32(dtTestersites.Rows[i]["TesterPendingSites"]);
                        loSite.InProcessSites    = Convert.ToInt32(dtTestersites.Rows[i]["TesterInProcessSites"]);
                        loSite.CompletedSites    = Convert.ToInt32(dtTestersites.Rows[i]["TesterCompletedSites"]);
                        loSite.DriveCompleted    = Convert.ToInt32(dtTestersites.Rows[i]["TesterDriveCompletedSites"]);
                        loSite.PendingWithIssues = Convert.ToInt32(dtTestersites.Rows[i]["TesterPendingWithIssuesSites"]);
                        loSite.InProgress        = Convert.ToInt32(dtTestersites.Rows[i]["TesterInProgress"]);
                        loSite.ReportSubmited    = Convert.ToInt32(dtTestersites.Rows[i]["TesterReportSubmitted"]);
                        lstSites.Add(loSite);
                    }
                }
                return(lstSites);
            }
            catch (Exception)
            {
            }

            return(lstSites);
        }
Exemplo n.º 6
0
        public List <RegionsVM> GetPartialRegionalSites(string ParentFilter, string ChildFilter, DateTime StartDate, DateTime EndDate, string RegionFilter, Int64 UserId, Int64 FilterValue, string FilterType2, string FilterValue2)
        {
            List <RegionsVM> lstRegions = new List <RegionsVM>();

            try
            {
                DashboardDL db         = new DashboardDL();
                DataTable   TotalSites = db.GetPartialRegionalSites(ParentFilter, ChildFilter, StartDate, EndDate, RegionFilter, UserId, FilterValue, FilterType2, FilterValue2);

                if (TotalSites.Rows.Count > 0)
                {
                    RegionsVM loRegion;
                    for (int i = 0; i < TotalSites.Rows.Count; i++)
                    {
                        loRegion                   = new RegionsVM();
                        loRegion.RegionName        = TotalSites.Rows[i]["Region"].ToString();
                        loRegion.ID                = Convert.ToInt64(TotalSites.Rows[i]["RegionId"].ToString());
                        loRegion.TotalSites        = Convert.ToInt32(TotalSites.Rows[i]["RegionTotalSites"]);
                        loRegion.PendingSites      = Convert.ToInt32(TotalSites.Rows[i]["RegionPendingSites"]);
                        loRegion.InProcessSites    = Convert.ToInt32(TotalSites.Rows[i]["RegionInProcessSites"]);
                        loRegion.CompletedSites    = Convert.ToInt32(TotalSites.Rows[i]["RegionCompletedSites"]);
                        loRegion.DriveCompleted    = Convert.ToInt32(TotalSites.Rows[i]["RegionDriveCompletedSites"]);
                        loRegion.PendingWithIssues = Convert.ToInt32(TotalSites.Rows[i]["RegionPendingWithIssuesSites"]);
                        loRegion.InProgress        = Convert.ToInt32(TotalSites.Rows[i]["RegionInProgress"]);
                        loRegion.ReportSubmited    = Convert.ToInt32(TotalSites.Rows[i]["RegionReportSubmitted"]);
                        lstRegions.Add(loRegion);
                    }
                }
                return(lstRegions);
            }
            catch (Exception)
            {
            }

            return(lstRegions);
        }