private M_Receipt CreateReceipt() { CRUD dbiz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStr, true); try { Receipt r = new Receipt(dbiz); r.Create(this.req.data); dbiz.Commit(); return(r.ety); } catch (Exception) { dbiz.Abort(); throw; } }
private List <Model.M_Sys_Login_Account> GetLogUser() { CRUD biz01 = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, false); try { Clause c = new Clause(); c.Add("trim(LoginName)", this.req.data.userid); List <Model.M_Sys_Login_Account> etyLst = biz01.Retrieve <Model.M_Sys_Login_Account>(c.Get()); biz01.Commit(); return(etyLst); } catch (Exception err) { biz01.Abort(); throw err; } }
private DataTable GetUserInfo() { CRUD biz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, false); try { Clause c = new Clause(); string sql = ""; switch (this.req.data.logintype) //判断登录用户类型 { case "S": sql += "select * from " + M_Sys_Login_System.TableName + " where 1=1 "; sql += " and trim(LoginName)='" + req.data.username + "'"; break; case "L": sql += "select * from " + M_Sys_Login_Lease.TableName + " where 1=1 "; sql += " and trim(LeaseNumber)='" + req.data.username + "'"; break; case "E": case "C": c.Add("trim(LoginName)", req.data.username); break; default: throw new Exception("Unknown login type!"); } DataTable dt = biz.RetrieveDataTable <Model.M_Sys_Login_Account>(c.Get()); biz.Commit(); return(dt); } catch (Exception err) { biz.Abort(); throw err; } }
private void CreateDisribution(string reNum, string reType) { BLL.CRUD dbiz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStr, true); try { COA c = new COA(dbiz); ArrayList al = c.Generate_Distribution(reNum, reType); string strType = "R"; if (reType == "UD") { strType = "U"; } dbiz.ExecuteNonQuery("delete from AR_Line_Distribution where TRANSACTION_NO='" + reNum + "' and TRANSACTION_TYPE='" + strType + "' and post_status<>'P'"); c.Insert_Distribution(al); dbiz.Commit(); } catch (Exception) { dbiz.Abort(); throw; } }
private List <string> GetGroupLease(int userid) { CRUD biz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, false); try { string sql = "select trim(leasenumber) as leasenumber from SYS_USERS_GROUP_LEASE where UserId=" + userid.ToString(); DataTable dt = biz.ExecuteDataTable(sql); biz.Commit(); List <string> leases = new List <string>(); for (int i = 0; i < dt.Rows.Count; i++) { leases.Add(dt.Rows[i][0].ToString()); } return(leases); } catch (Exception) { biz.Abort(); throw; } }
/// <summary> /// 创建receipt后保存支付信息 /// </summary> private void Save() { BLL.CRUD biz = new CRUD(DbVendor.Oracle, Runtime.OracleConnStrLocal, true); try { etyH = new M_T_PAYMENT(); etyH.paymentid = Bizhub.FetchPaymentId(biz) + 1; etyH.amount = this.req.data.actualamount; etyH.leasenumber = this.req.data.leasenum; etyH.paydate = DateTime.Parse(this.req.data.actualpaydate); etyH.paytype = this.req.data.actualpaytype; etyH.status = "0"; // Status取值定义:0=本地保存完成;1=Receipt创建完成;2=分录创建完成。状态必须从0~2顺序转换。 biz.Create(etyH); Model.Req35dataDtl detail = null; etyD = new M_T_PAYMENT_INFO(); for (int i = 0; i < this.req.data.actualpayinfo.Count; i++) { detail = this.req.data.actualpayinfo[i]; etyD.actualpay = detail.actualpay; etyD.amount = detail.amount; etyD.chargecode = detail.chargecode; etyD.invoicenumber = detail.transno; etyD.invoicelinenum = detail.invoicelinenum; etyD.paymentid = etyH.paymentid; biz.Create(etyD); } biz.Commit(); } catch (Exception err) { biz.Abort(); throw err; } }