Link to home
Start Free TrialLog in
Avatar of Sha1395
Sha1395

asked on

passing string value to Data Access Layer

Hi All

Am just stuck to pass my string variable to my Data Access layer.

here is my main console

     class Program
    {
        static void Main(string[] args)
        {  
                String BookingTime="1000345";
                var BookingStart = new SchedSAPEntities.ResourceBookingEntity.ResourceBooking(string Bookingtime);
       }
}

SchedSAPEntities.ResourceBookingEntity.ResourceBooking(string Bookingtime);//Am trying to pass the string variable (1000345) to ResourceBooking method.

Here is my Data access Layer

     public class ResourceBookingEntity
    {
        public class ResourceBooking
        {
            private String _PRJ_ID;
                       
            public ResourceBooking(String APRJ_ID )
            {
                _PRJ_ID = APRJ_ID;
                
            }
            public String PRJ_ID { get { return _PRJ_ID; } }
            }
    }


      public class ResourceBookingList : List<SchedSAPEntities.ResourceBookingEntity.ResourceBooking>
        {
            public ResourceBookingList(SchedwinEntities db)
            {
                    var query =
                    (from PROJECTS in db.PROJECTS
                     join WOes in db.WOes on PROJECTS.PRJ_ID equals WOes.PRJ_ID
                     join SEVT_EX in db.SEVT_EX on SEVTs.SESID equals SEVT_EX.SESID into SEVT_EX_join
                     from SEVT_EX in SEVT_EX_join.DefaultIfEmpty()
                     where
                       (new string[] { "1", "2" }).Contains((PROJECTS.STAT.TrimEnd()).TrimStart()) &&
                       (WOes.STAT.TrimEnd()).TrimStart() == "6" &&
                       ((SEVTs.RESTYPE == 5 ||
                       SEVTs.RESTYPE == 0) &&
                       **SEVTs.T_START.TrimStart() == BookingStart**//Am trying to pass the value here
                     orderby
                       PROJECTS.PRJ_ID,
                       WOes.WONUM
                     select new
                     {
                         PROJECTS.PRJ_ID,
                                                 
                     }).Take(10);
                foreach (var r in query)
                    Add(new SchedSAPEntities.ResourceBookingEntity.ResourceBooking(
                        r.PRJ_ID, r.USER3, r.USER9, r.WONUM));
                        var ResourceBooking = query.ToList();
            }
        }

Open in new window

Avatar of kaufmed
kaufmed
Flag of United States of America image

Are you receiving an error of some sort?
ASKER CERTIFIED SOLUTION
Avatar of Göran Andersson
Göran Andersson
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial