示例#1
0
        public static UserInfo[] GetAllProjectLeads()
        {
            ArrayList al       = new ArrayList();
            int       retValue = -1;

            using (SqlDataReader dr = ProjManagementAdmin.GetAllProjectLeads(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    UserInfo user = new UserInfo();

                    user.UserName      = dr["user_name"].ToString();
                    user.UserId        = Convert.ToInt32(dr["user_id"]);
                    user.UserEmail     = dr["user_email"].ToString();
                    user.ChangedByName = dr["changed_by"].ToString();

                    al.Add(user);
                }
                //dr.Close();
            }

            UserInfo[] allInfo = new UserInfo[al.Count];
            al.CopyTo(allInfo);
            return(allInfo);
        }
示例#2
0
        public static FundInfo[] GetAllFunds()
        {
            ArrayList al = new ArrayList();

            int retValue = -1;


            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetAllFunds(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    FundInfo fund = new FundInfo();
                    fund.FundId       = Convert.ToInt32(dr["fund_id"]);
                    fund.FundDesc     = dr["fund_desc"].ToString();
                    fund.FundAmount   = Convert.ToSingle(dr["fund_amount"]);
                    fund.ReceivedDate = Convert.ToDateTime(dr["received_date"]);
                    fund.ChangedDate  = Convert.ToDateTime(dr["changed_date"]);
                    fund.ChangedBy    = dr["changed_by"].ToString();

                    al.Add(fund);
                }
                //dr.Close();
            }

            FundInfo[] allInfo = new FundInfo[al.Count];
            al.CopyTo(allInfo);
            return(allInfo);
        }
示例#3
0
        public static ProjectInfo GetProjectById(int projectId)
        {
            int         retValue = -1;
            ProjectInfo project  = new ProjectInfo();

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetProjectById(projectId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    project.ProjectId       = Convert.ToInt32(dr["project_id"]);
                    project.ProjectName     = dr["project_name"].ToString();
                    project.ProjectCode     = dr["project_code"].ToString();
                    project.ProjectLeadId   = Convert.ToInt32(dr["project_lead_id"]);
                    project.ProjectLeadName = dr["project_lead_name"].ToString();
                    project.IsActive        = Convert.ToBoolean(dr["is_active"]);
                    project.CreatedDate     = Convert.ToDateTime(dr["created_date"]);
                    project.ChangedDate     = Convert.ToDateTime(dr["changed_date"]);
                    project.ChangedByName   = dr["changed_by"].ToString();
                }
                //dr.Close();
            }

            return(project);
        }
示例#4
0
        public static LocationInfo[] GetAllLocations()
        {
            ArrayList al = new ArrayList();

            int retValue = -1;


            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetAllLocations(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    LocationInfo location = new LocationInfo();
                    location.LocationId    = Convert.ToInt32(dr["location_id"]);
                    location.LocationName  = dr["location_name"].ToString();
                    location.CreatedDate   = Convert.ToDateTime(dr["created_date"]);
                    location.ChangedDate   = Convert.ToDateTime(dr["changed_date"]);
                    location.ChangedByName = dr["changed_by"].ToString();
                    al.Add(location);
                }
                //dr.Close();
            }

            LocationInfo[] allInfo = new LocationInfo[al.Count];
            al.CopyTo(allInfo);
            return(allInfo);
        }
示例#5
0
        public static int RegisterAccount(AccountInfo account)
        {
            int retValue = -1;

            ProjManagementAdmin.RegisterAccount(account, out retValue); //Initialize and retrieve code for Datareader goes here

            return(retValue);
        }
示例#6
0
        public static int AddNewLocation(LocationInfo location)
        {
            if (location == null)
            {
                throw new ArgumentNullException("Location is missing");
            }


            int retValue = -1;

            return(ProjManagementAdmin.AddNewLocation(location, out retValue));
        }
示例#7
0
        public static int AddNewProject(ProjectInfo project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }


            int retValue = -1;

            return(ProjManagementAdmin.AddNewProject(project, out retValue));
        }
示例#8
0
        public static int AddNewFund(FundInfo fund)
        {
            if (fund == null)
            {
                throw new ArgumentNullException("fund");
            }


            int retValue = -1;

            return(ProjManagementAdmin.AddNewFund(fund, out retValue));
        }
示例#9
0
        public static int AddNewUser(UserInfo user)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }


            int retValue = -1;

            return(ProjManagementAdmin.AddNewUser(user, out retValue));
        }
        public static int AddNewBeneficiary(BeneficiaryProjLocInfo bene)
        {
            if (bene == null)
            {
                throw new ArgumentNullException("bene");
            }


            int retValue = -1;

            return(ProjManagementAdmin.AddNewBeneficiary(bene, out retValue));
        }
示例#11
0
        public static IList <PieUtility> GetReportProjectsFunds() //Parameter list
        {
            int   retValue = -1;
            float sum      = 0;

            IList <PieUtility> ListOfSourceTypes1 = new List <PieUtility>();
            List <PieUtility>  ListOfSourceTypes2 = new List <PieUtility>();

            //List<BarGraphSeriesInfo> standardList = new List<BarGraphSeriesInfo>();

            using (SqlDataReader dr = ProjManagementAdmin.GetAllProjects(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    PieUtility ru = new PieUtility();
                    ru.name = dr["project_name"].ToString();;
                    ru.y    = 0;
                    ListOfSourceTypes1.Add(ru);
                }
                //dr.Close();
            }


            using (SqlDataReader dr = ProjManagementAdmin.GetReportProjectsFunds(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    PieUtility ru = new PieUtility();
                    ru.name = dr["project_name"].ToString();
                    ru.y    = Convert.ToInt32(dr["amount"]);
                    ListOfSourceTypes2.Add(ru);
                    sum += ru.y;
                }
                //dr.Close();
            }

            foreach (PieUtility ru2 in ListOfSourceTypes2)
            {
                foreach (PieUtility ru1 in ListOfSourceTypes1)
                {
                    if (ru1.name == ru2.name)
                    {
                        ru1.y = (ru2.y * 100) / sum;
                    }
                }
            }

            return(ListOfSourceTypes1);
        }
示例#12
0
        public static ProjectLocationInfo[] GetProjectsAtLocation(int LocationId)
        {
            ArrayList al       = new ArrayList();
            int       retValue = -1;

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetProjectsAtLocation(LocationId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    ProjectLocationInfo proj_loc = new ProjectLocationInfo();

                    proj_loc.ProjectLocationId = Convert.ToInt32(dr["project_location_id"]);
                    proj_loc.ProjectId         = Convert.ToInt32(dr["project_id"]);
                    proj_loc.ProjectName       = dr["project_name"].ToString();
                    proj_loc.ProjectCode       = dr["project_code"].ToString();
                    proj_loc.ProjectLeadId     = Convert.ToInt32(dr["project_lead_id"]);
                    proj_loc.ProjectLeadName   = dr["project_lead_name"].ToString();

                    proj_loc.LocationId   = Convert.ToInt32(dr["location_id"]);
                    proj_loc.LocationName = dr["location_name"].ToString();

                    proj_loc.IsActive      = Convert.ToBoolean(dr["is_active"]);
                    proj_loc.CreatedDate   = Convert.ToDateTime(dr["created_date"]);
                    proj_loc.ChangedDate   = Convert.ToDateTime(dr["changed_date"]);
                    proj_loc.ChangedByName = dr["changed_by"].ToString();

                    if (proj_loc.IsActive == true)
                    {
                        proj_loc.OpenClose = "Close";
                    }
                    else
                    {
                        proj_loc.OpenClose = "Open";
                    }
                    al.Add(proj_loc);
                }
                //dr.Close();
            }

            ProjectLocationInfo[] allInfo = new ProjectLocationInfo[al.Count];
            al.CopyTo(allInfo);
            return(allInfo);
        }
示例#13
0
        public static UserInfo GetUserById(int userId)
        {
            int      retValue = -1;
            UserInfo user     = new UserInfo();

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetUserById(userId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    user.UserName      = dr["user_name"].ToString();
                    user.UserId        = Convert.ToInt32(dr["user_id"]);
                    user.UserEmail     = dr["user_email"].ToString();
                    user.ChangedByName = dr["changed_by"].ToString();
                }
                //dr.Close();
            }

            return(user);
        }
示例#14
0
        public static LocationInfo GetLocationById(int locationId)
        {
            int          retValue = -1;
            LocationInfo location = new LocationInfo();

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetLocationById(locationId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    location.LocationId    = Convert.ToInt32(dr["location_id"]);
                    location.LocationName  = dr["location_name"].ToString();
                    location.IsActive      = Convert.ToBoolean(dr["is_active"]);
                    location.CreatedDate   = Convert.ToDateTime(dr["created_date"]);
                    location.ChangedDate   = Convert.ToDateTime(dr["changed_date"]);
                    location.ChangedByName = dr["changed_by"].ToString();
                }
                //dr.Close();
            }

            return(location);
        }
示例#15
0
        public static FundInfo GetFundById(int fundId)
        {
            int      retValue = -1;
            FundInfo fund     = new FundInfo();

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetFundById(fundId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    fund.FundId       = Convert.ToInt32(dr["fund_id"]);
                    fund.FundDesc     = dr["fund_desc"].ToString();
                    fund.FundAmount   = Convert.ToSingle(dr["fund_amount"]);
                    fund.ReceivedDate = Convert.ToDateTime(dr["received_date"]);
                    fund.ChangedDate  = Convert.ToDateTime(dr["changed_date"]);
                    fund.ChangedBy    = dr["changed_by"].ToString();
                }
                //dr.Close();
            }

            return(fund);
        }
示例#16
0
        public static AccountInfo AuthenticateUser(AccountInfo account)
        {
            int         retValue    = -1;
            AccountInfo accountInfo = new AccountInfo();

            using (SqlDataReader dr = ProjManagementAdmin.AuthenticateUser(account.UserName, account.Password, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                if (dr != null && dr.HasRows)
                {
                    while (dr.Read())
                    {
                        accountInfo.AccountId = Convert.ToInt32(dr["account_id"]);
                        accountInfo.UserName  = dr["user_name"].ToString();
                        accountInfo.Password  = dr["password"].ToString();
                        accountInfo.FirstName = dr["first_name"].ToString();
                        accountInfo.LastName  = dr["last_name"].ToString();
                    }
                }
            }

            return(accountInfo);
        }
        public static BeneficiaryProjLocInfo[] GetBeneficiaryAtProjectLocation(int BeneficiaryId)
        {
            ArrayList al       = new ArrayList();
            int       retValue = -1;

            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetBeneficiaryAtProjectLocation(BeneficiaryId, out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    BeneficiaryProjLocInfo b = new BeneficiaryProjLocInfo();
                    b.BeneficiaryId      = Convert.ToInt32(dr["beneficiary_id"]);
                    b.BeneficiaryName    = dr["beneficiary_name"].ToString();
                    b.BeneficiaryAddress = dr["beneficiary_address"].ToString();
                    b.ProjectLocationId  = Convert.ToInt32(dr["project_location_id"]);
                    b.ProjectId          = Convert.ToInt32(dr["project_id"]);
                    b.ProjectName        = dr["project_name"].ToString();
                    // b.ProjectCode = dr["project_code"].ToString();


                    b.LocationId   = Convert.ToInt32(dr["location_id"]);
                    b.LocationName = dr["location_name"].ToString();

                    b.IsActive    = Convert.ToBoolean(dr["is_active"]);
                    b.CreatedDate = Convert.ToDateTime(dr["created_date"]);
                    b.ChangedDate = Convert.ToDateTime(dr["changed_date"]);

                    b.ChangedBy = dr["changed_by"].ToString();
                    al.Add(b);
                }
                //dr.Close();
            }

            BeneficiaryProjLocInfo[] allInfo = new BeneficiaryProjLocInfo[al.Count];
            al.CopyTo(allInfo);
            return(allInfo);
        }
示例#18
0
        public static int UpdateProject(ProjectInfo project)
        {
            int retValue = -1;

            return(ProjManagementAdmin.UpdateProject(project, out retValue));
        }
示例#19
0
        public static int SoftDeleteProject(int projectId, bool isOpen)
        {
            int retValue = -1;

            return(ProjManagementAdmin.SoftDeleteProject(projectId, isOpen, out retValue));
        }
示例#20
0
        public static int UpdateLocation(LocationInfo location)
        {
            int retValue = -1;

            return(ProjManagementAdmin.UpdateLocation(location, out retValue));
        }
示例#21
0
        public static int SoftDeleteProjectAtLocation(int ProjectLocationId, bool isOpen)
        {
            int retValue = -1;

            return(ProjManagementAdmin.SoftDeleteProjectAtLocation(ProjectLocationId, isOpen, out retValue));
        }
示例#22
0
        public static int AddProjectAtLocation(ProjectLocationInfo ProjLoc)
        {
            int retValue = -1;

            return(ProjManagementAdmin.AddProjectAtLocation(ProjLoc, out retValue));
        }
示例#23
0
        public static int SoftDeleteUser(int userId, bool isOpen)
        {
            int retValue = -1;

            return(ProjManagementAdmin.SoftDeleteUser(userId, isOpen, out retValue));
        }
        public static int UpdateBeneficiary(BeneficiaryProjLocInfo bene)
        {
            int retValue = -1;

            return(ProjManagementAdmin.UpdateBeneficiary(bene, out retValue));
        }
        public static int SoftDeleteBeneficiary(int beneficiaryId, bool isOpen)
        {
            int retValue = -1;

            return(ProjManagementAdmin.SoftDeleteBeneficiary(beneficiaryId, isOpen, out retValue));
        }
示例#26
0
        public static int UpdateUser(UserInfo user)
        {
            int retValue = -1;

            return(ProjManagementAdmin.UpdateUser(user, out retValue));
        }
示例#27
0
        public static HighChartsBarGraphInfo GetReportProjectFundsAtLocation() //Parameter list
        {
            int retValue = -1;


            IList <string>             projects  = new List <string>();
            IList <string>             locations = new List <string>();
            IList <BarGraphSeriesInfo> series    = new List <BarGraphSeriesInfo>();
            HighChartsBarGraphInfo     result    = new HighChartsBarGraphInfo();

            result.categories = new List <string>();
            IList <ReportData> data = new List <ReportData>();

            using (SqlDataReader dr = ProjManagementAdmin.GetAllLocations(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    string locationName = dr["location_name"].ToString();
                    locations.Add(locationName);
                }

                //dr.Close();
            }
            using (SqlDataReader dr = ProjManagementAdmin.GetAllProjects(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    string projectName = dr["project_name"].ToString();
                    projects.Add(projectName);
                }

                //dr.Close();
            }
            using (SqlDataReader dr = ProjManagementAdmin.GetReportProjectsFunds(out retValue)) //Initialize and retrieve code for Datareader goes here
            {
                while (dr.Read())
                {
                    ReportData d = new ReportData();
                    d.LocationName = dr["location_name"].ToString();
                    d.ProjectName  = dr["project_name"].ToString();
                    d.FundAmount   = Convert.ToInt32(dr["amount"]);
                    data.Add(d);
                }
            }
            result.series = new List <BarGraphSeriesInfo>();
            foreach (string l in locations)
            {
                BarGraphSeriesInfo b = new BarGraphSeriesInfo();
                b.data = new List <int>();
                b.name = l;
                foreach (string p in projects)
                {
                    bool flag = false;

                    for (int i = 0; i < data.Count; i++)
                    {
                        if (data[i].ProjectName.Equals(p) && data[i].LocationName.Equals(l))
                        {
                            b.data.Add(data[i].FundAmount);
                            flag = true;
                        }
                    }
                    if (flag == false)
                    {
                        b.data.Add(0);
                    }
                }
                result.series.Add(b);
            }
            result.categories = projects;
            return(result);
        }
示例#28
0
        public static int UpdateFund(FundInfo fund)
        {
            int retValue = -1;

            return(ProjManagementAdmin.UpdateFund(fund, out retValue));
        }
示例#29
0
        public static int SoftDeleteFund(int fundId)
        {
            int retValue = -1;

            return(ProjManagementAdmin.SoftDeleteFund(fundId, out retValue));
        }