Ejemplo n.º 1
0
        public List <AreaInCity> GetAreasInCity(string cid)
        {
            int cityId = Convert.ToInt32(cid);

            using (HandyBackOfficeEntities entities = new HandyBackOfficeEntities())
            {
                return(entities.AreaInCities.Where(area => area.CityID == cityId).ToList());
            }
        }
Ejemplo n.º 2
0
        public List <ServiceInArea> GetServicesInArea(string areaid)
        {
            int AreadId = Convert.ToInt32(areaid);

            using (HandyBackOfficeEntities entities = new HandyBackOfficeEntities())
            {
                return(entities.ServiceInAreas.Where(Service => (Service.AreaID == AreadId) && Service.Active == "True").ToList());
            }
        }
Ejemplo n.º 3
0
        public List <CustomerRequest> GetCustomerRequests(string email)
        {
            using (HandyBackOfficeEntities entities = new HandyBackOfficeEntities())
            {
                return(entities.CustomerRequests.Where(c => c.CustomerEmail == email).ToList());

                //    CustomerRequest objectCustomers = new CustomerRequest();

                //    foreach (CustomerRequest c in temp)
                //    {
                //        objectCustomers.CustomerRequestFor = c.CustomerRequestFor;
                //    }
                //    return objectCustomers;
            }
        }
Ejemplo n.º 4
0
        public void AddCustomerRequest(string cname, string cmobileno, string cemail, string caddinfo, string cdatetimepref, int ccity, string carea)
        {
            CustomerRequest ctemp = new CustomerRequest();

            ctemp.CustomerName             = cname;
            ctemp.CustomerMobile           = cmobileno;
            ctemp.CustomerRequestFor       = "Pest Control";
            ctemp.CustomerEmail            = cemail;
            ctemp.CustomerAdditionalInfo   = caddinfo;
            ctemp.CustomerDateTimePrefText = cdatetimepref;
            ctemp.City = ccity;
            ctemp.Area = carea;



            using (HandyBackOfficeEntities entities = new HandyBackOfficeEntities())
            {
                entities.Database.Connection.Open();
                entities.CustomerRequests.Add(ctemp);
                entities.SaveChanges();
            }
        }