public void getFirstAndLastRailBySecID(string sec_id, out AGROUPRAILS first_rail, out AGROUPRAILS last_rail)
 {
     using (DBConnection_EF con = new DBConnection_EF())
     {
         groupRailDAO.getFirstAndLastRailBySecID(con, sec_id, out first_rail, out last_rail);
     }
 }
Ejemplo n.º 2
0
 public void update(DBConnection_EF con, AGROUPRAILS group_rail)
 {
     //bool isDetached = con.Entry(group_rail).State == EntityState.Modified;
     //if (isDetached)
     con.AGROUPRAILS.Attach(group_rail);
     con.SaveChanges();
 }
        public AGROUPRAILS getGroupRailsBySectionID(string sec_id)
        {
            AGROUPRAILS groupRails = null;

            using (DBConnection_EF con = new DBConnection_EF())
            {
                groupRails = groupRailDAO.getByID(con, sec_id);
            }
            return(groupRails);
        }
Ejemplo n.º 4
0
        public void getFirstAndLastRailBySecID(DBConnection_EF con, string sec_id, out AGROUPRAILS first_rail, out AGROUPRAILS last_rail)
        {
            var query = from g in con.AGROUPRAILS
                        where g.SECTION_ID == sec_id
                        orderby g.RAIL_NO
                        select g;

            first_rail = query.FirstOrDefault();
            last_rail  = query.AsEnumerable().LastOrDefault();
        }
Ejemplo n.º 5
0
 public void add(DBConnection_EF con, AGROUPRAILS group_rail)
 {
     con.AGROUPRAILS.Add(group_rail);
     con.SaveChanges();
 }