public override void DbInsert(OracleTransaction trans) { if (isCal) { return; } //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBXIAOHAO(MC,BAIBAN,ZHONGBAN,YEBAN,LEIJI,GAOLU,BEIZHU,SJ) VALUES(:MC,:BAIBAN,:ZHONGBAN,:YEBAN,:LEIJI,:GAOLU,:BEIZHU,:SJ)"; insertCmd.Parameters.Add(":MC", OracleType.VarChar, 200).Value = this.MC; insertCmd.Parameters.Add(":BAIBAN", OracleType.Double, 22).Value = (object)this.BAIBAN ?? DBNull.Value; insertCmd.Parameters.Add(":ZHONGBAN", OracleType.Double, 22).Value = (object)this.ZHONGBAN ?? DBNull.Value; insertCmd.Parameters.Add(":YEBAN", OracleType.Double, 22).Value = (object)this.YEBAN ?? DBNull.Value; insertCmd.Parameters.Add(":LEIJI", OracleType.Double, 22).Value = (object)this.LEIJI ?? DBNull.Value; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":BEIZHU", OracleType.VarChar, 200).Value = this.BEIZHU; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBLIAOXIAN(LIAOQIAN,LIAOHOU,PISHU,T,GAOLU,JIANGE,JIAJIAO,BC,SJ,XIUGAI,JISHAO,QIUTUAN,JIAOTAN,JIAODING,KUAIKUANG,QITAKUANG) VALUES(:LIAOQIAN,:LIAOHOU,:PISHU,:T,:GAOLU,:JIANGE,:JIAJIAO,:BC,:SJ,:XIUGAI,:JISHAO,:QIUTUAN,:JIAOTAN,:JIAODING,:KUAIKUANG,:QITAKUANG)"; insertCmd.Parameters.Add(":LIAOQIAN", OracleType.Double).Value = (object)this.LIAOQIAN ?? DBNull.Value; insertCmd.Parameters.Add(":LIAOHOU", OracleType.Double).Value = (object)this.LIAOHOU ?? DBNull.Value; insertCmd.Parameters.Add(":PISHU", OracleType.Int32, 22).Value = (object)this.PISHU ?? DBNull.Value; insertCmd.Parameters.Add(":T", OracleType.DateTime, 7).Value = this.T; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":JIANGE", OracleType.Double).Value = (object)this.JIANGE ?? DBNull.Value; insertCmd.Parameters.Add(":JIAJIAO", OracleType.VarChar, 20).Value = this.JIAJIAO ?? ""; insertCmd.Parameters.Add(":BC", OracleType.VarChar, 6).Value = this.BC ?? ""; insertCmd.Parameters.Add(":SJ", OracleType.VarChar, 8).Value = this.SJ ?? ""; insertCmd.Parameters.Add(":XIUGAI", OracleType.Double).Value = (object)this.XIUGAI ?? DBNull.Value; insertCmd.Parameters.Add(":JISHAO", OracleType.Double).Value = (object)this.JISHAO ?? DBNull.Value; insertCmd.Parameters.Add(":QIUTUAN", OracleType.Double).Value = (object)this.QIUTUAN ?? DBNull.Value; insertCmd.Parameters.Add(":JIAOTAN", OracleType.Double).Value = (object)this.JIAOTAN ?? DBNull.Value; insertCmd.Parameters.Add(":JIAODING", OracleType.Double).Value = (object)this.JIAODING ?? DBNull.Value; insertCmd.Parameters.Add(":KUAIKUANG", OracleType.Double).Value = (object)this.KUAIKUANG ?? DBNull.Value; insertCmd.Parameters.Add(":QITAKUANG", OracleType.Double).Value = (object)this.QITAKUANG ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
private void btnExportar_Click(object sender, EventArgs e) { try { ora.Open(); cmd = new OracleCommand("begin CrearTexto; end;", ora); cmd.CommandType = CommandType.Text; da = new OracleDataAdapter(); da.SelectCommand = cmd; // cmd.CommandType = System.Data.CommandType.StoredProcedure; OracleString rowId; cmd.ExecuteOracleNonQuery(out rowId); MessageBox.Show("TABLA EXPORTADA"); replaceString(); ora.Close(); } catch (OracleException ex) { MessageBox.Show(ex.Message); ora.Close(); } }
private void button6_Click(object sender, EventArgs e) { try { ora.Open(); cmd = new OracleCommand("DELETE FROM EMPLEADOS", ora); cmd.CommandType = CommandType.Text; da = new OracleDataAdapter(); da.SelectCommand = cmd; OracleString rowId; cmd.ExecuteOracleNonQuery(out rowId); MessageBox.Show("Datos Eliminados de la DB"); MostrarDatos(); ora.Close(); } catch (OracleException ex) { MessageBox.Show(ex.Message); ora.Close(); } }
public static int InsertSMSMessateToEBankGW_2(string idAlert, string mobile, string message, char msgstat, string smsType) { OracleConnection connection = null; try { connection = OracleDBConnection.OpenConnectionDB("EBANK_GW"); OracleCommand cmd = new OracleCommand("SMS_SCB.PROC_INS_MASTERCARD_KM", connection); cmd.CommandType = CommandType.StoredProcedure; OracleParameter idAlert_p = new OracleParameter("id_alert", idAlert); idAlert_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(idAlert_p); OracleParameter mobile_p = new OracleParameter("mobile", mobile); mobile_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(mobile_p); OracleParameter message_p = new OracleParameter("message", message); message_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(message_p); OracleParameter msgstat_p = new OracleParameter("msgstat", msgstat); msgstat_p.Direction = ParameterDirection.Input; msgstat_p.OracleType = OracleType.Char; cmd.Parameters.Add(msgstat_p); OracleParameter mc_sms_type_p = new OracleParameter("mc_sms_type", smsType); mc_sms_type_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(mc_sms_type_p); OracleString rowID; int insertedRow = 0; insertedRow = cmd.ExecuteOracleNonQuery(out rowID); if (connection != null) { connection.Close(); } return(insertedRow); } catch (Exception ex) { _logSMSNhacNoSaoKe.WriteLog("Error InsertSMSMessateToEBankGW_2() at DataAccess, " + ex.Message); if (connection != null) { connection.Close(); } return(0); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBZLBD(GAOLU,SJ,BC,PICI,JS,SQ,QT,JT,JD,KP,JP,JTFH,PML,ZHFH,ZL,R2,LLJD,ZLSX,LX,BLSJ,BLYY,CLCH,LLTL,BZ,YQ,LLBC,BLJD,LLJB,SJKPB,SLQPB,KKPB,KK,QRPB,RLPW,BY1,BY2) VALUES(:GAOLU,:SJ,:BC,:PICI,:JS,:SQ,:QT,:JT,:JD,:KP,:JP,:JTFH,:PML,:ZHFH,:ZL,:R2,:LLJD,:ZLSX,:LX,:BLSJ,:BLYY,:CLCH,:LLTL,:BZ,:YQ,:LLBC,:BLJD,:LLJB,:SJKPB,:SLQPB,:KKPB,:KK,:QRPB,:RLPW,:BY1,:BY2)"; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.Parameters.Add(":BC", OracleType.VarChar, 10).Value = this.BC; insertCmd.Parameters.Add(":PICI", OracleType.Double, 22).Value = (object)this.PICI ?? DBNull.Value; insertCmd.Parameters.Add(":JS", OracleType.Double, 22).Value = (object)this.JS ?? DBNull.Value; insertCmd.Parameters.Add(":SQ", OracleType.Double, 22).Value = (object)this.SQ ?? DBNull.Value; insertCmd.Parameters.Add(":QT", OracleType.Double, 22).Value = (object)this.QT ?? DBNull.Value; insertCmd.Parameters.Add(":JT", OracleType.Double, 22).Value = (object)this.JT ?? DBNull.Value; insertCmd.Parameters.Add(":JD", OracleType.Double, 22).Value = (object)this.JD ?? DBNull.Value; insertCmd.Parameters.Add(":KP", OracleType.Double, 22).Value = (object)this.KP ?? DBNull.Value; insertCmd.Parameters.Add(":JP", OracleType.Double, 22).Value = (object)this.JP ?? DBNull.Value; insertCmd.Parameters.Add(":JTFH", OracleType.Double, 22).Value = (object)this.JTFH ?? DBNull.Value; insertCmd.Parameters.Add(":PML", OracleType.Double, 22).Value = (object)this.PML ?? DBNull.Value; insertCmd.Parameters.Add(":ZHFH", OracleType.Double, 22).Value = (object)this.ZHFH ?? DBNull.Value; insertCmd.Parameters.Add(":ZL", OracleType.Double, 22).Value = (object)this.ZL ?? DBNull.Value; insertCmd.Parameters.Add(":R2", OracleType.Double, 22).Value = (object)this.R2 ?? DBNull.Value; insertCmd.Parameters.Add(":LLJD", OracleType.Double, 22).Value = (object)this.LLJD ?? DBNull.Value; insertCmd.Parameters.Add(":ZLSX", OracleType.VarChar, 200).Value = this.ZLSX; insertCmd.Parameters.Add(":LX", OracleType.Int32, 22).Value = (object)this.LX ?? DBNull.Value; insertCmd.Parameters.Add(":BLSJ", OracleType.DateTime, 7).Value = (object)this.BLSJ ?? DBNull.Value; insertCmd.Parameters.Add(":BLYY", OracleType.VarChar, 200).Value = this.BLYY; insertCmd.Parameters.Add(":CLCH", OracleType.VarChar, 200).Value = this.CLCH; insertCmd.Parameters.Add(":LLTL", OracleType.Double, 22).Value = (object)this.LLTL ?? DBNull.Value; insertCmd.Parameters.Add(":BZ", OracleType.VarChar, 200).Value = this.BZ; insertCmd.Parameters.Add(":YQ", OracleType.Double, 22).Value = (object)this.YQ ?? DBNull.Value; insertCmd.Parameters.Add(":LLBC", OracleType.Double, 22).Value = (object)this.LLBC ?? DBNull.Value; insertCmd.Parameters.Add(":BLJD", OracleType.VarChar, 300).Value = this.BLJD; insertCmd.Parameters.Add(":LLJB", OracleType.Double, 22).Value = (object)this.LLJB ?? DBNull.Value; insertCmd.Parameters.Add(":SJKPB", OracleType.Double, 22).Value = (object)this.SJKPB ?? DBNull.Value; insertCmd.Parameters.Add(":SLQPB", OracleType.Double, 22).Value = (object)this.SLQPB ?? DBNull.Value; insertCmd.Parameters.Add(":KKPB", OracleType.Double, 22).Value = (object)this.KKPB ?? DBNull.Value; insertCmd.Parameters.Add(":KK", OracleType.Double, 22).Value = (object)this.KK ?? DBNull.Value; insertCmd.Parameters.Add(":QRPB", OracleType.Double, 22).Value = (object)this.QRPB ?? DBNull.Value; insertCmd.Parameters.Add(":RLPW", OracleType.Double, 22).Value = (object)this.RLPW ?? DBNull.Value; insertCmd.Parameters.Add(":BY1", OracleType.Double, 22).Value = (object)this.BY1 ?? DBNull.Value; insertCmd.Parameters.Add(":BY2", OracleType.Double, 22).Value = (object)this.BY2 ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public virtual void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBWENDU(GAOLU,SJ,WD1,WD2,WD3,WD4,WD5,WD6,WD7,WD8,WD9,WD10,WD11,WD12,WD13,WD14,WD15,WD16,WD17,WD18,WD19,WD20,WD21,WD22,WD23,WD24,WD25,WD26,WD27,WD28,WD29,WD30,BZ) VALUES(:GAOLU,:SJ,:WD1,:WD2,:WD3,:WD4,:WD5,:WD6,:WD7,:WD8,:WD9,:WD10,:WD11,:WD12,:WD13,:WD14,:WD15,:WD16,:WD17,:WD18,:WD19,:WD20,:WD21,:WD22,:WD23,:WD24,:WD25,:WD26,:WD27,:WD28,:WD29,:WD30,:BZ)"; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = this.GAOLU; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = this.SJ; insertCmd.Parameters.Add(":WD1", OracleType.Double, 22).Value = (object)this.WD1 ?? DBNull.Value; insertCmd.Parameters.Add(":WD2", OracleType.Double, 22).Value = (object)this.WD2 ?? DBNull.Value; insertCmd.Parameters.Add(":WD3", OracleType.Double, 22).Value = (object)this.WD3 ?? DBNull.Value; insertCmd.Parameters.Add(":WD4", OracleType.Double, 22).Value = (object)this.WD4 ?? DBNull.Value; insertCmd.Parameters.Add(":WD5", OracleType.Double, 22).Value = (object)this.WD5 ?? DBNull.Value; insertCmd.Parameters.Add(":WD6", OracleType.Double, 22).Value = (object)this.WD6 ?? DBNull.Value; insertCmd.Parameters.Add(":WD7", OracleType.Double, 22).Value = (object)this.WD7 ?? DBNull.Value; insertCmd.Parameters.Add(":WD8", OracleType.Double, 22).Value = (object)this.WD8 ?? DBNull.Value; insertCmd.Parameters.Add(":WD9", OracleType.Double, 22).Value = (object)this.WD9 ?? DBNull.Value; insertCmd.Parameters.Add(":WD10", OracleType.Double, 22).Value = (object)this.WD10 ?? DBNull.Value; insertCmd.Parameters.Add(":WD11", OracleType.Double, 22).Value = (object)this.WD11 ?? DBNull.Value; insertCmd.Parameters.Add(":WD12", OracleType.Double, 22).Value = (object)this.WD12 ?? DBNull.Value; insertCmd.Parameters.Add(":WD13", OracleType.Double, 22).Value = (object)this.WD13 ?? DBNull.Value; insertCmd.Parameters.Add(":WD14", OracleType.Double, 22).Value = (object)this.WD14 ?? DBNull.Value; insertCmd.Parameters.Add(":WD15", OracleType.Double, 22).Value = (object)this.WD15 ?? DBNull.Value; insertCmd.Parameters.Add(":WD16", OracleType.Double, 22).Value = (object)this.WD16 ?? DBNull.Value; insertCmd.Parameters.Add(":WD17", OracleType.Double, 22).Value = (object)this.WD17 ?? DBNull.Value; insertCmd.Parameters.Add(":WD18", OracleType.Double, 22).Value = (object)this.WD18 ?? DBNull.Value; insertCmd.Parameters.Add(":WD19", OracleType.Double, 22).Value = (object)this.WD19 ?? DBNull.Value; insertCmd.Parameters.Add(":WD20", OracleType.Double, 22).Value = (object)this.WD20 ?? DBNull.Value; insertCmd.Parameters.Add(":WD21", OracleType.Double, 22).Value = (object)this.WD21 ?? DBNull.Value; insertCmd.Parameters.Add(":WD22", OracleType.Double, 22).Value = (object)this.WD22 ?? DBNull.Value; insertCmd.Parameters.Add(":WD23", OracleType.Double, 22).Value = (object)this.WD23 ?? DBNull.Value; insertCmd.Parameters.Add(":WD24", OracleType.Double, 22).Value = (object)this.WD24 ?? DBNull.Value; insertCmd.Parameters.Add(":WD25", OracleType.Double, 22).Value = (object)this.WD25 ?? DBNull.Value; insertCmd.Parameters.Add(":WD26", OracleType.Double, 22).Value = (object)this.WD26 ?? DBNull.Value; insertCmd.Parameters.Add(":WD27", OracleType.Double, 22).Value = (object)this.WD27 ?? DBNull.Value; insertCmd.Parameters.Add(":WD28", OracleType.Double, 22).Value = (object)this.WD28 ?? DBNull.Value; insertCmd.Parameters.Add(":WD29", OracleType.Double, 22).Value = (object)this.WD29 ?? DBNull.Value; insertCmd.Parameters.Add(":WD30", OracleType.Double, 22).Value = (object)this.WD30 ?? DBNull.Value; insertCmd.Parameters.Add(":BZ", OracleType.VarChar, 200).Value = this.BZ; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO QUERYTEMPLATE(ENTITYNAME,TEMPLATENAME,XMLTEXT) VALUES(:ENTITYNAME,:TEMPLATENAME,:XMLTEXT)"; insertCmd.Parameters.Add(":ENTITYNAME", OracleType.VarChar, 200).Value = this.ENTITYNAME; insertCmd.Parameters.Add(":TEMPLATENAME", OracleType.VarChar, 200).Value = this.TEMPLATENAME; insertCmd.Parameters.Add(":XMLTEXT", OracleType.VarChar, 2000).Value = this.XMLTEXT; insertCmd.ExecuteOracleNonQuery(out RowId); } }
/// <summary> /// 执行SQL语句,返回影响的记录数 /// </summary> /// <param name="SQLString">SQL语句</param> /// <returns>影响的记录数</returns> public static string ExecuteOracleSql(string connectionString, string SQLString) { using (OracleConnection connection = new OracleConnection(connectionString)) { using (OracleCommand cmd = new OracleCommand(SQLString, connection)) { try { connection.Open(); OracleString strRowid = ""; int rows = cmd.ExecuteOracleNonQuery(out strRowid); return(strRowid.Value); } catch (System.Data.OracleClient.OracleException E) { connection.Close(); throw new Exception(E.Message); } } } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBFK(GAOLU,FK1,FK2,FK3,FK4,FK5,FK6,FK7,FK8,FK9,FK10,FK11,FK12,FK13,FK14,YX,GCY,BZ,RQ,SJ,FK15,FK16,FK17,FK18,FK19,FK20) VALUES(:GAOLU,:FK1,:FK2,:FK3,:FK4,:FK5,:FK6,:FK7,:FK8,:FK9,:FK10,:FK11,:FK12,:FK13,:FK14,:YX,:GCY,:BZ,:RQ,:SJ,:FK15,:FK16,:FK17,:FK18,:FK19,:FK20)"; insertCmd.Parameters.Add(":GAOLU", OracleType.Byte, 22).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":FK1", OracleType.VarChar, 4).Value = this.FK1; insertCmd.Parameters.Add(":FK2", OracleType.VarChar, 4).Value = this.FK2; insertCmd.Parameters.Add(":FK3", OracleType.VarChar, 4).Value = this.FK3; insertCmd.Parameters.Add(":FK4", OracleType.VarChar, 4).Value = this.FK4; insertCmd.Parameters.Add(":FK5", OracleType.VarChar, 4).Value = this.FK5; insertCmd.Parameters.Add(":FK6", OracleType.VarChar, 4).Value = this.FK6; insertCmd.Parameters.Add(":FK7", OracleType.VarChar, 4).Value = this.FK7; insertCmd.Parameters.Add(":FK8", OracleType.VarChar, 4).Value = this.FK8; insertCmd.Parameters.Add(":FK9", OracleType.VarChar, 4).Value = this.FK9; insertCmd.Parameters.Add(":FK10", OracleType.VarChar, 4).Value = this.FK10; insertCmd.Parameters.Add(":FK11", OracleType.VarChar, 4).Value = this.FK11; insertCmd.Parameters.Add(":FK12", OracleType.VarChar, 4).Value = this.FK12; insertCmd.Parameters.Add(":FK13", OracleType.VarChar, 4).Value = this.FK13; insertCmd.Parameters.Add(":FK14", OracleType.VarChar, 4).Value = this.FK14; insertCmd.Parameters.Add(":YX", OracleType.VarChar, 10).Value = this.YX; insertCmd.Parameters.Add(":GCY", OracleType.VarChar, 10).Value = this.GCY; insertCmd.Parameters.Add(":BZ", OracleType.VarChar, 100).Value = this.BZ; insertCmd.Parameters.Add(":RQ", OracleType.DateTime, 7).Value = (object)this.RQ ?? DBNull.Value; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.Parameters.Add(":FK15", OracleType.VarChar, 4).Value = this.FK15; insertCmd.Parameters.Add(":FK16", OracleType.VarChar, 4).Value = this.FK16; insertCmd.Parameters.Add(":FK17", OracleType.VarChar, 4).Value = this.FK17; insertCmd.Parameters.Add(":FK18", OracleType.VarChar, 4).Value = this.FK18; insertCmd.Parameters.Add(":FK19", OracleType.VarChar, 4).Value = this.FK19; insertCmd.Parameters.Add(":FK20", OracleType.VarChar, 4).Value = this.FK20; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBXF(GAOLU,MC,KS,ZZ,FL,YY,SJ,JG) VALUES(:GAOLU,:MC,:KS,:ZZ,:FL,:YY,:SJ,:JG)"; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":MC", OracleType.VarChar, 20).Value = this.MC; insertCmd.Parameters.Add(":KS", OracleType.DateTime, 7).Value = (object)this.KS ?? DBNull.Value; insertCmd.Parameters.Add(":ZZ", OracleType.DateTime, 7).Value = (object)this.ZZ ?? DBNull.Value; insertCmd.Parameters.Add(":FL", OracleType.VarChar, 2000).Value = this.FL; insertCmd.Parameters.Add(":YY", OracleType.VarChar, 2000).Value = this.YY; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.Parameters.Add(":JG", OracleType.Double, 22).Value = (object)this.JG ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBBD(BD,SL,DW,FL,SM,GAOLU,RQ,SJ) VALUES(:BD,:SL,:DW,:FL,:SM,:GAOLU,:RQ,:SJ)"; insertCmd.Parameters.Add(":BD", OracleType.VarChar, 20).Value = this.BD; insertCmd.Parameters.Add(":SL", OracleType.Double, 22).Value = (object)this.SL ?? DBNull.Value; insertCmd.Parameters.Add(":DW", OracleType.VarChar, 20).Value = this.DW; insertCmd.Parameters.Add(":FL", OracleType.VarChar, 200).Value = this.FL; insertCmd.Parameters.Add(":SM", OracleType.VarChar, 1000).Value = this.SM; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = (object)this.GAOLU ?? DBNull.Value; insertCmd.Parameters.Add(":RQ", OracleType.DateTime, 7).Value = (object)this.RQ ?? DBNull.Value; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
// TODO: Add Code to call testing functions - for example: // Automation.Start() public static void Log(int id, System.DateTime dateTime, string description, EventType eventType) { string sql = "insert into tst_ranorex_log(ID_LOG, DT_LOG, DESCRIPTION, ID_SEVERITY) values (:id,:dateTime,:description,:eventType)"; string connectionString = "Data Source=BIGENEA; User Id=BIGENEA2; Password=BIGENEA2; Integrated Security = no;"; OracleConnection connection = new OracleConnection(connectionString); try { connection.Open(); OracleCommand command = new OracleCommand(sql, connection); OracleParameter idParameter = new OracleParameter("id", id); command.Parameters.Add(idParameter); OracleParameter dateTimeParameter = new OracleParameter("dateTime", dateTime); command.Parameters.Add(dateTimeParameter); OracleParameter descriptionParameter = new OracleParameter("description", description); command.Parameters.Add(descriptionParameter); OracleParameter eventTypeParameter = new OracleParameter("eventType", (int)eventType); command.Parameters.Add(eventTypeParameter); OracleString rowid; command.ExecuteOracleNonQuery(out rowid); } catch (OracleException e) { Validate.Fail(String.Format("Wystąpił błąd bazy danych: {0}", e.Message)); } catch (System.Exception e) { Validate.Fail(String.Format("Wystąpił błąd: {0}", e.Message)); } finally { connection.Close(); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO DDMF(PZ,SJ,C,HUIFEN,HUIFA,S,SF,FAREZHI,XIDU) VALUES(:PZ,:SJ,:C,:HUIFEN,:HUIFA,:S,:SF,:FAREZHI,:XIDU)"; insertCmd.Parameters.Add(":PZ", OracleType.VarChar, 10).Value = this.PZ; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = this.SJ; insertCmd.Parameters.Add(":C", OracleType.Double, 22).Value = (object)this.C ?? DBNull.Value; insertCmd.Parameters.Add(":HUIFEN", OracleType.Double, 22).Value = (object)this.HUIFEN ?? DBNull.Value; insertCmd.Parameters.Add(":HUIFA", OracleType.Double, 22).Value = (object)this.HUIFA ?? DBNull.Value; insertCmd.Parameters.Add(":S", OracleType.Double, 22).Value = (object)this.S ?? DBNull.Value; insertCmd.Parameters.Add(":SF", OracleType.Double, 22).Value = (object)this.SF ?? DBNull.Value; insertCmd.Parameters.Add(":FAREZHI", OracleType.Double, 22).Value = (object)this.FAREZHI ?? DBNull.Value; insertCmd.Parameters.Add(":XIDU", OracleType.Double, 22).Value = (object)this.XIDU ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { if (CheckPk(trans)) { DataState = DataStateType.Update; DbUpdate(trans); return; } OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBGZ(SJ,BC,JL,GAOLU) VALUES(:SJ,:BC,:JL,:GAOLU)"; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.Parameters.Add(":BC", OracleType.VarChar, 6).Value = this.BC; insertCmd.Parameters.Add(":JL", OracleType.VarChar, 2000).Value = this.JL; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32).Value = this.GAOLU; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public override void DbInsert(OracleTransaction trans) { //InsertSql,InsertPara,AutoSql if (DataState == DataStateType.Add) { OracleConnection con = trans.Connection; OracleCommand insertCmd = new OracleCommand(); insertCmd.Connection = con; insertCmd.Transaction = trans; insertCmd.CommandText = "INSERT INTO RBCAOZUO(FJ,LFLL,FYLL,LFYL,RFYL,RFWD,PML,TQX,LDWD,RSWD,SJFS,GFDN,LDYL,LX,BZ,GAOLU,SJ,HOUR,ZHFH,BANBIE,MIANJI,FYL) VALUES(:FJ,:LFLL,:FYLL,:LFYL,:RFYL,:RFWD,:PML,:TQX,:LDWD,:RSWD,:SJFS,:GFDN,:LDYL,:LX,:BZ,:GAOLU,:SJ,:HOUR,:ZHFH,:BANBIE,:MIANJI,:FYL)"; insertCmd.Parameters.Add(":FJ", OracleType.Int32, 22).Value = (object)this.FJ ?? DBNull.Value; insertCmd.Parameters.Add(":LFLL", OracleType.Double, 22).Value = this.LFLL; insertCmd.Parameters.Add(":FYLL", OracleType.Double, 22).Value = (object)this.FYLL ?? DBNull.Value; insertCmd.Parameters.Add(":LFYL", OracleType.Double, 22).Value = (object)this.LFYL ?? DBNull.Value; insertCmd.Parameters.Add(":RFYL", OracleType.Double, 22).Value = (object)this.RFYL ?? DBNull.Value; insertCmd.Parameters.Add(":RFWD", OracleType.Double, 22).Value = (object)this.RFWD ?? DBNull.Value; insertCmd.Parameters.Add(":PML", OracleType.Double, 22).Value = (object)this.PML ?? DBNull.Value; insertCmd.Parameters.Add(":TQX", OracleType.Double, 22).Value = (object)this.TQX ?? DBNull.Value; insertCmd.Parameters.Add(":LDWD", OracleType.Double, 22).Value = (object)this.LDWD ?? DBNull.Value; insertCmd.Parameters.Add(":RSWD", OracleType.Double, 22).Value = (object)this.RSWD ?? DBNull.Value; insertCmd.Parameters.Add(":SJFS", OracleType.Double, 22).Value = (object)this.SJFS ?? DBNull.Value; insertCmd.Parameters.Add(":GFDN", OracleType.Double, 22).Value = (object)this.GFDN ?? DBNull.Value; insertCmd.Parameters.Add(":LDYL", OracleType.Double, 22).Value = (object)this.LDYL ?? DBNull.Value; insertCmd.Parameters.Add(":LX", OracleType.Double, 22).Value = (object)this.LX ?? DBNull.Value; insertCmd.Parameters.Add(":BZ", OracleType.VarChar, 400).Value = this.BZ; insertCmd.Parameters.Add(":GAOLU", OracleType.Int32, 22).Value = this.GAOLU; insertCmd.Parameters.Add(":SJ", OracleType.DateTime, 7).Value = (object)this.SJ ?? DBNull.Value; insertCmd.Parameters.Add(":HOUR", OracleType.Int32, 22).Value = this.HOUR; insertCmd.Parameters.Add(":ZHFH", OracleType.Double, 22).Value = (object)this.ZHFH ?? DBNull.Value; insertCmd.Parameters.Add(":BANBIE", OracleType.VarChar, 20).Value = this.BANBIE; insertCmd.Parameters.Add(":MIANJI", OracleType.Double, 22).Value = (object)this.MIANJI ?? DBNull.Value; insertCmd.Parameters.Add(":FYL", OracleType.Double, 22).Value = (object)this.FYL ?? DBNull.Value; insertCmd.ExecuteOracleNonQuery(out RowId); } }
public static int InsertReminderPayment_2SMSToDW( string sms_type, string sms_detail, string dest_mobile, //long dest_mobile, DateTime get_trans_datetime, string pan, string card_brn, string card_type, string sms_date, //long sms_date, string closing_balance, string minimum_payment, //long paymented_amt, string due_date, string sms_stat ) { OracleConnection conn = null; try { conn = OracleDBConnection.OpenConnectionDB("CW_DW"); OracleCommand cmd = new OracleCommand("fpt.Insert_Reminder_Payment_1_2", conn); //OracleCommand cmd = new OracleCommand("fpt.Insert_Reminder_Payment_1", connection); cmd.CommandType = CommandType.StoredProcedure; OracleParameter sms_type_p = new OracleParameter("sms_type_p", sms_type); sms_type_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(sms_type_p); OracleParameter sms_detail_p = new OracleParameter("sms_detail_p", sms_detail); sms_detail_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(sms_detail_p); OracleParameter dest_mobile_p = new OracleParameter("dest_mobile_p", dest_mobile); dest_mobile_p.Direction = ParameterDirection.Input; //dest_mobile_p.OracleType = OracleType.Number; cmd.Parameters.Add(dest_mobile_p); OracleParameter get_trans_datetime_p = new OracleParameter("get_trans_datetime_p", get_trans_datetime); get_trans_datetime_p.Direction = ParameterDirection.Input; //get_trans_datetime_p.OracleType = OracleType.DateTime; cmd.Parameters.Add(get_trans_datetime_p); OracleParameter pan_p = new OracleParameter("pan_p", pan); pan_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(pan_p); OracleParameter card_brn_p = new OracleParameter("card_brn_p", card_brn); card_brn_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(card_brn_p); OracleParameter card_type_p = new OracleParameter("card_type_p", card_type); card_type_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(card_type_p); OracleParameter sms_date_p = new OracleParameter("sms_date_p", sms_date); sms_date_p.Direction = ParameterDirection.Input; //sms_date_p.OracleType = OracleType.Number; cmd.Parameters.Add(sms_date_p); OracleParameter closing_balance_p = new OracleParameter("closing_balance_p", closing_balance); closing_balance_p.Direction = ParameterDirection.Input; //sms_date_p.OracleType = OracleType.Number; cmd.Parameters.Add(closing_balance_p); OracleParameter minimum_payment_p = new OracleParameter("minimum_payment_p", minimum_payment); minimum_payment_p.Direction = ParameterDirection.Input; //sms_date_p.OracleType = OracleType.Number; cmd.Parameters.Add(minimum_payment_p); OracleParameter due_date_p = new OracleParameter("due_date_p", due_date); due_date_p.Direction = ParameterDirection.Input; //sms_date_p.OracleType = OracleType.Number; cmd.Parameters.Add(due_date_p); OracleParameter sms_stat_p = new OracleParameter("sms_stat_p", sms_stat); sms_stat_p.Direction = ParameterDirection.Input; cmd.Parameters.Add(sms_stat_p); OracleString rowID; int insertedRow = 0; insertedRow = cmd.ExecuteOracleNonQuery(out rowID); if (conn != null) { conn.Close(); } return(insertedRow); } catch (Exception ex) { _logSMSNhacNoDueDate.WriteLog("Error InsertReminderPayment_2SMSToDW() at DataAccess, " + ex.Message); if (conn != null) { conn.Close(); } return(0); } }