OracleCommand cmd = new OracleCommand();
protected void btn__Save_Click(object sender, EventArgs e)
{
OracleTransaction trans = null;
if (P_Connection.State != ConnectionState.Open)
P_Connection.Open();
try
{
trans = con.BeginTransaction();
Save_header(con, trans);
Save_details(con, trans);
trans.Commit();
}
catch (Exception ex)
{
trans.Rollback();
}
}
private void Save_header(OracleConnection cn, OracleTransaction trn)
{
cmd.Connection = cn;
cmd.Transaction = trn;
try
{
int maxCH_ID = CommonClass.Get_MaxID(" CH_ID", " id_corp_courtsey_call_header", " ");
cmd.CommandText = "insert into id__headear(columnNames) values (---------)";
cmd.ExecuteNonQuery();
cmd.Dispose();
}
catch (Exception)
{
throw;
}
}
private void Save_details(OracleConnection cn, OracleTransaction trn)
{
cmd.Connection = cn;
cmd.Transaction = trn;
try
{
cmd.CommandText = "insert into id_details(columnNames) values (---------)";
cmd.ExecuteNonQuery();
cmd.Dispose();
}
catch (Exception)
{
throw;
}
}
protected void btn__Save_Click(object sender, EventArgs e)
{
OracleTransaction trans = null;
if (P_Connection.State != ConnectionState.Open)
P_Connection.Open();
try
{
trans = con.BeginTransaction();
Save_header(con, trans);
Save_details(con, trans);
trans.Commit();
}
catch (Exception ex)
{
trans.Rollback();
}
}
private void Save_header(OracleConnection cn, OracleTransaction trn)
{
cmd.Connection = cn;
cmd.Transaction = trn;
try
{
int maxCH_ID = CommonClass.Get_MaxID(" CH_ID", " id_corp_courtsey_call_header", " ");
cmd.CommandText = "insert into id__headear(columnNames) values (---------)";
cmd.ExecuteNonQuery();
cmd.Dispose();
}
catch (Exception)
{
throw;
}
}
private void Save_details(OracleConnection cn, OracleTransaction trn)
{
cmd.Connection = cn;
cmd.Transaction = trn;
try
{
cmd.CommandText = "insert into id_details(columnNames) values (---------)";
cmd.ExecuteNonQuery();
cmd.Dispose();
}
catch (Exception)
{
throw;
}
}
No comments:
Post a Comment