private bool InsertOrderDetails(int OrderId) { bool _result = false; try { OrderDetails objOrderDetails = new OrderDetails(); objOrderDetails.USERID = new Guid(Common.TOKEN); objOrderDetails.ORDERID = OrderId; objOrderDetails.AMOUNT = Convert.ToInt32(ConfigurationManager.AppSettings["REPORTAMOUNT"].ToString()); objTransaction = new Transaction(); int result = objTransaction.InsertUserOrderDetails(objOrderDetails); if (result == Convert.ToInt32(cartCount.InnerText)) { _result = true; } } catch (Exception ex) { objUser.InsertWebsiteLog(Common.TOKEN, "ucUserCart.ascx.cs", "InsertOrderDetails", "OrderId=" + OrderId, ex.ToString()); } return _result; }
public int InsertUserOrderDetails(OrderDetails objRequest) { int objResponse = 0; try { SqlParameter[] sqlParams = new SqlParameter[3]; sqlParams[0] = new SqlParameter("@USERID", SqlDbType.UniqueIdentifier); sqlParams[0].Value = objRequest.USERID; sqlParams[1] = new SqlParameter("@ORDERID", SqlDbType.VarChar); sqlParams[1].Value = objRequest.ORDERID; sqlParams[2] = new SqlParameter("@AMOUNT", SqlDbType.Decimal); sqlParams[2].Value = objRequest.AMOUNT; int result = CExecuteNonQuery("USP_INSERTUSERORDERDETAILS", sqlParams); if (result > 0) { objResponse = result; } } catch (Exception ex) { InsertWebsiteLog(Common.TOKEN, "Transaction.cs", "InsertUserOrderDetails", JsonConvert.SerializeObject(objRequest), ex.ToString()); } return objResponse; }