public static HttpResponseMessage AddProjectToLocation(ProjectLocationInfo ProjLoc)
 {
     try
     {
         int val = ProjectLocationDal.AddProjectAtLocation(ProjLoc);
         return(new HttpResponseMessage(HttpStatusCode.OK));
     }
     catch (Exception ex)
     {
         Console.WriteLine("EXCEPTION: " + ex);
         return(new HttpResponseMessage(HttpStatusCode.BadRequest));
     }
 }
示例#2
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);
        }
示例#3
0
        public static int AddProjectAtLocation(ProjectLocationInfo ProjLoc)
        {
            int retValue = -1;

            return(ProjManagementAdmin.AddProjectAtLocation(ProjLoc, out retValue));
        }
 public HttpResponseMessage Post(ProjectLocationInfo ProjLoc)
 {
     return(ProjectLocationBl.AddProjectToLocation(ProjLoc));
 }