public int OrderAdd(Order or) { int id = 0; DataTable dt = new DataTable(); dt = db.execQuery("Sp_OrderAdd", new object[] { or.supplier_id }); if (dt.Rows.Count > 0) { id = Convert.ToInt16(dt.Rows[0]["id"].ToString()); } return id; }
public string OrderAdd(Order or, List<OrderProduct> orp) { String msg = "Data sucessfully saved"; db.beginTransaction(); try { int id = dao.OrderAdd(or); foreach (OrderProduct prodMod in orp) { dao.OrderProductAdd(id, prodMod); } db.commitTrans(); } catch (Exception ex) { db.rollBackTrans(); msg = ex.Message; } return msg; }
public void OrderModify(Order or) { db.execQuery("Sp_OrderModify", new object[] { or.order_id, or.supplier_id }); }
public string OrderModify(Order or, List<OrderProduct> orp) { String msg = "Data successfully saved"; db.beginTransaction(); try { int id = or.order_id; foreach (OrderProduct prodMod in orp) { dao.OrderProductModify(id, prodMod); } db.commitTrans(); } catch (MyException.OutOfStock ex) { msg = ex.Message; db.rollBackTrans(); } catch (Exception ex) { db.rollBackTrans(); throw ex; } return msg; }