public override PagedData ProcessRequest(HttpContext context, CookDBDataContext db)
        {
            if (context.Request.Params.Count == 0)
            {
                return(new PagedData("Can't call RemoveBusinessUnit.ashx without parameters"));
            }

            if (context.Request.Params.Get("name") == null)
            {
                return(new PagedData("Name is null"));
            }

            BusinessUnit bu = db.BusinessUnits.Single(a => a.name.Equals(context.Request.Params.Get("name")));

            db.BusinessUnits.DeleteOnSubmit(bu);
            db.SubmitChanges();

            return(new PagedData(""));
        }
        public override PagedData ProcessRequest(HttpContext context, CookDBDataContext db)
        {
            if (context.Request.Params.Count == 0)
                return new PagedData("Can't call AddBusinessUnit.ashx without parameters");

            if (context.Request.Params.Get("name") == null)
                return new PagedData("Name is null");
            if (context.Request.Params.Get("company_name") == null)
                return new PagedData("Company is null");

            BusinessUnit bu = new BusinessUnit();
            Company company = db.Companies.Single(a => a.company_name.Equals(context.Request.Params.Get("company_name")));

            bu.name = context.Request.Params.Get("name");
            bu.Company = company;
            db.BusinessUnits.InsertOnSubmit(bu);

            db.SubmitChanges();

            return new PagedData("");
        }
 partial void DeleteBusinessUnit(BusinessUnit instance);
 partial void UpdateBusinessUnit(BusinessUnit instance);
 partial void InsertBusinessUnit(BusinessUnit instance);
		private void detach_BusinessUnits(BusinessUnit entity)
		{
			this.SendPropertyChanging();
			entity.Company = null;
		}