Пример #1
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);
        }