public bool AddOutsourcingCompany(HiringCompanyData.OutsourcingCompany oCompany)
        {
            using (var access = new AccessDB())
            {
                HiringCompanyData.OutsourcingCompany oc = access.OcActions.FirstOrDefault(f => f.Name.Equals(oCompany.Name));
                if (oc == null)
                {
                    access.OcActions.Add(oCompany);

                    int i = access.SaveChanges();

                    if (i > 0)
                    {
                        Log.Info("Successfully added outsourcing company into DB");
                        return(true);
                    }
                    return(false);
                }
                else
                {
                    Log.Warn("Outsourcing company already exists in DB");
                    return(false);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     INTERFACE IHcContract
        /// </summary>
        public bool RegisterOutsourcingCompany(WcfCommon.Data.OutsourcingCompany oc)
        {
            HiringCompanyData.OutsourcingCompany oc_data = new HiringCompanyData.OutsourcingCompany();
            try
            {
                oc_data.IdFromOutSourcingDB = oc.IdFromOutSourcingDB;
                oc_data.Name = oc.Name;
            }
            catch (Exception e)
            {
                Log.Error("Attempt to register outsourcing company that doesn't have Id or Name.");
                return(false);
            }

            bool ret = OCompanyDB.Instance.AddOutsourcingCompany(oc_data);

            if (ret)
            {
                Log.Info("Successfully added Outsourcing company to DB");
            }
            else
            {
                Log.Warn("Failed to add Outsourcing company to DB");
            }

            return(ret);
        }
Ejemplo n.º 3
0
        public bool AcceptPartnership(WcfCommon.Data.HiringCompany hc, WcfCommon.Data.OutsourcingCompany oc)
        {
            Log.Info("AddPartnershipToDB...");
            HiringCompanyData.HiringCompany      hc_data = new HiringCompanyData.HiringCompany();
            HiringCompanyData.OutsourcingCompany oc_data = new HiringCompanyData.OutsourcingCompany();

            hc_data = HiringCompanyDB.Instance.GetCompany(hc.IdFromHiringCompanyDB);
            oc_data = OCompanyDB.Instance.GetOutsourcingCompany(oc.Name);

            return(PartnershipDB.Instance.AddPartnership(hc_data, oc_data));
        }
 public bool AddOutsourcingCompany(HiringCompanyData.OutsourcingCompany oc)
 {
     try
     {
         return(proxy.AddOutsourcingCompany(oc));
     }
     catch (Exception e)
     {
         Console.WriteLine("ERROR: AddOutsourcingCompany: \n{0}", e.Message);
         return(false);
     }
 }
 public bool AddPartnershipToDB(HiringCompany hc, HiringCompanyData.OutsourcingCompany oc)
 {
     try
     {
         return(proxy.AddPartnershipToDB(hc, oc));
     }
     catch (Exception e)
     {
         Console.WriteLine("ERROR: AddPartnershipToDB: \n{0}", e.Message);
         return(false);
     }
 }
        public OutsourcingCompany GetOutsourcingCompany(string name)
        {
            using (var access = new AccessDB())
            {
                HiringCompanyData.OutsourcingCompany oc = access.OcActions.FirstOrDefault(f => f.Name.Equals(name));

                if (oc == null)
                {
                    Log.Warn("Requestet Outsourcing company doesn't exists in DB.");
                }
                else
                {
                    Log.Info("Successfully returned Outsourcing company with specified name.");
                }

                return(oc);
            }
        }
Ejemplo n.º 7
0
 public bool AddOutsourcingCompany(HiringCompanyData.OutsourcingCompany oc)
 {
     Log.Info("AddOutsourcingCompany...");
     return(OCompanyDB.Instance.AddOutsourcingCompany(oc));
 }
Ejemplo n.º 8
0
        //public List<HiringCompanyData.UserStory> GetUserStoryes(string projectName)
        //{
        //    log.Info("Successfully returned User storyes for defined project name");
        //    return UserStoryDB.Instance.GetUserStory(projectName);
        //}

        public bool AddPartnershipToDB(HiringCompanyData.HiringCompany hc, HiringCompanyData.OutsourcingCompany oc)
        {
            Log.Info("AddPartnershipToDB...");
            return(PartnershipDB.Instance.AddPartnership(hc, oc));
        }