Please try is as below.
Note : I hope your cat entity collection is "AddTogeneral_bills"
public int saveBill(general_bills cat)
{
using (alldbEntities db = new alldbEntities())
{
if (cat.ID > 0)
{
var catObj = (from c in db.AddTogeneral_bills
where c.ID=cat.ID
select c).FirstOrDefault();
catObj.pro1= cat.pro1;
catObj.pro2= cat.pro2;
db.SaveChanges();
}
else
{
db.AddTogeneral_bills.Add(cat);
db.SaveChanges();
}
return (int)cat.ID;
}
}