コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     }
 }