protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { paymentInfo = new TradeInfo(); Sn.Text = paymentInfo.Sn; } }
public void delete(TradeInfo persistentInstance) { try { } catch { throw; } }
public TradeInfo findById(String id) { string select = "SELECT * FROM T_BIZ_TRADEINFO WHERE SN=:1"; OracleConnection conn = new OracleConnection(connectionString); OracleDataReader reader = null; try { OracleParameter[] selectParms = { OracleHelper.NewOracleParameter(":1", OracleType.VarChar, 50, id) }; reader = OracleHelper.ExecuteReader(conn, CommandType.Text, select, selectParms); if (reader.Read()) { TradeInfo _TradeInfo = new TradeInfo() { Sn = Convert.ToString(reader["sn"]), GoodsName = Convert.ToString(reader["goods_name"]), UnitPrice = Convert.ToDouble(reader["unit_price"]), Quantity = Convert.ToInt64(reader["quantity"]), Amount = Convert.ToDouble(reader["amount"]), CustomerName = Convert.ToString(reader["customer_name"]), CustomerMobile = Convert.ToString(reader["customer_mobile"]), CustomerPhoneFax = Convert.ToString(reader["customer_phone_fax"]) }; return _TradeInfo; } } catch { throw; } finally { if (reader != null) reader.Close(); if (conn.State != ConnectionState.Closed) { conn.Close(); conn.Dispose(); } } return null; }
public void Save_Click(object sender, AjaxEventArgs e) { // 一、执行业务业务操作,保存业务数据 paymentInfo = new TradeInfo() { Sn = Sn.Text, GoodsName = GoodsName.SelectedItem.Value, UnitPrice = UnitPrice.Number, Quantity = (long)Quantity.Number, Amount = Amount.Number, CustomerName = CustomerName.Text, CustomerMobile = CustomerMobile.Text, CustomerPhoneFax = CustomerPhoneFax.Text }; tradeInfoDao.save(paymentInfo); // 二、开始执行流程操作 IWorkflowSession workflowSession = RuntimeContextExamples.GetRuntimeContext().getWorkflowSession();//.workflowRuntimeContext.getWorkflowSession(); try { // 1、创建流程实例 IProcessInstance procInst = workflowSession.createProcessInstance("Goods_Deliver_Process", this.User.Identity.Name); // 2、设置流程变量/业务属性字段 procInst.setProcessInstanceVariable("sn", paymentInfo.Sn);// 设置交易顺序号 procInst.setProcessInstanceVariable("goodsName", paymentInfo.GoodsName);// 货物名称 procInst.setProcessInstanceVariable("quantity", paymentInfo.Quantity);// 数量 procInst.setProcessInstanceVariable("mobile", paymentInfo.CustomerMobile);// 客户电话 procInst.setProcessInstanceVariable("customerName", paymentInfo.CustomerName); // 3、启动流程实例,run()方法启动实例并创建第一个环节实例、分派任务 procInst.run(); } catch { throw; } paymentInfo = new TradeInfo(); }
public bool save(TradeInfo transientInstance) { transientInstance.Id = Guid.NewGuid().ToString().Replace("-", ""); string insert = "INSERT INTO T_BIZ_TRADEINFO (" + "ID, SN, GOODS_NAME, GOODS_TYPE, QUANTITY, " + "UNIT_PRICE, AMOUNT, CUSTOMER_NAME, CUSTOMER_MOBILE, CUSTOMER_PHONE_FAX, " + "CUSTOMER_ADDRESS, STATE, PAYED_TIME, DELIVERED_TIME )VALUES(:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14)"; OracleParameter[] insertParms = { OracleHelper.NewOracleParameter(":1", OracleType.VarChar, 50, transientInstance.Id), OracleHelper.NewOracleParameter(":2", OracleType.VarChar, 50, transientInstance.Sn), OracleHelper.NewOracleParameter(":3", OracleType.VarChar, 100, transientInstance.GoodsName), OracleHelper.NewOracleParameter(":4", OracleType.VarChar, 50, transientInstance.GoodsType), OracleHelper.NewOracleParameter(":5", OracleType.Number, transientInstance.Quantity), OracleHelper.NewOracleParameter(":6", OracleType.Double, 22, transientInstance.UnitPrice), OracleHelper.NewOracleParameter(":7", OracleType.Double, 22, transientInstance.Amount), OracleHelper.NewOracleParameter(":8", OracleType.VarChar, 50, transientInstance.CustomerName), OracleHelper.NewOracleParameter(":9", OracleType.VarChar, 30, transientInstance.CustomerMobile), OracleHelper.NewOracleParameter(":10", OracleType.VarChar, 30, transientInstance.CustomerPhoneFax), OracleHelper.NewOracleParameter(":11", OracleType.VarChar, 150, transientInstance.CustomerAddress), OracleHelper.NewOracleParameter(":12", OracleType.VarChar, 15, transientInstance.State), OracleHelper.NewOracleParameter(":13", OracleType.Timestamp, 11, transientInstance.PayedTime), OracleHelper.NewOracleParameter(":14", OracleType.Timestamp, 11, transientInstance.DeliveredTime) }; if (OracleHelper.ExecuteNonQuery(connectionString, CommandType.Text, insert, insertParms) != 1) return false; else return true; }