public bool saveBillDetail(string Json) { try { JavaScriptSerializer jss = new JavaScriptSerializer(); bill_detail billdt = jss.Deserialize <bill_detail>(Json); DBShopDataContext db = new DBShopDataContext(); db.bill_details.InsertOnSubmit(billdt); db.SubmitChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool saveCustomer(string Json) { try { JavaScriptSerializer jss = new JavaScriptSerializer(); customer customer = jss.Deserialize <customer>(Json); DBShopDataContext db = new DBShopDataContext(); db.customers.InsertOnSubmit(customer); db.SubmitChanges(); return(true); } catch (Exception ex) { return(false); } }