Ejemplo n.º 1
0
 public static RankingDto createRankingDTO(Ranking obj)
 {
     RankingDto ran = new RankingDto();
     ran.RankingId = obj.RankingId;
     ran.RankingName = obj.RankingName;
     return ran;
 }
Ejemplo n.º 2
0
 public static Ranking createRanking(String RankingId, String RankingName)
 {
     Ranking obj = new Ranking();
     obj.RankingId = RankingId;
     obj.RankingName = RankingName;
     return obj;
 }
Ejemplo n.º 3
0
 public Ranking selectRankingById(Ranking obj)
 {
     try
     {
         IRankingSvc svc = (IRankingSvc)this.getService(typeof(IRankingSvc).Name);
         return svc.selectRankingById(obj);
     }
     catch (ServiceLoadException ex)
     {
         return null;
     }
 }
Ejemplo n.º 4
0
 public Boolean deleteRanking(Ranking obj)
 {
     try
     {
         IRankingSvc svc = (IRankingSvc)this.getService(typeof(IRankingSvc).Name);
         return svc.deleteRanking(obj);
     }
     catch (ServiceLoadException ex)
     {
         return false;
     }
 }
Ejemplo n.º 5
0
        public Ranking selectRankingById(Ranking obj)
        {
            NewRecruiteeBankContext db = new NewRecruiteeBankContext();

            try
            {

                return db.Rankings.SqlQuery("dbo.SelectRankingById @RankingId='" + obj.RankingId.ToString() + "'").Single();
            }
            catch (Exception ex)
            {
                return null;
            }
        }
Ejemplo n.º 6
0
        public Boolean insertRanking(Ranking obj)
        {
            using (NewRecruiteeBankContext db = new NewRecruiteeBankContext())
            {
                try
                {
                    db.Rankings.Add(obj);
                    db.SaveChanges();
                    return true;
                }
                catch (Exception ex)
                {
                    return false;
                }

            }
        }
Ejemplo n.º 7
0
        public Boolean deleteRanking(Ranking obj)
        {
            using (NewRecruiteeBankContext db = new NewRecruiteeBankContext())
            {
                try
                {
                    Ranking ranking = db.Rankings.SqlQuery("dbo.SelectRankingById @RankingId='" + obj.RankingId.ToString() + "'").Single();

                    if (ranking != null)
                    {
                        db.Rankings.Remove(ranking);
                        #region Database Submission

                        try
                        {
                            db.SaveChanges();
                            return true;
                        }
                        catch (Exception ex)
                        {
                            return false;
                        }

                        #endregion
                    }
                    else
                    {
                        return false;
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
        }