本文整理汇总了C#中Dbconn.RollbackTransaction方法的典型用法代码示例。如果您正苦于以下问题:C# Dbconn.RollbackTransaction方法的具体用法?C# Dbconn.RollbackTransaction怎么用?C# Dbconn.RollbackTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dbconn
的用法示例。
在下文中一共展示了Dbconn.RollbackTransaction方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
/// <summary>
/// VEX框架的主入口
/// </summary>
/// <returns></returns>
public DataSet GetData()
{
try
{
string strXML = "";
string filter = "";
m_conn = new Dbconn(m_hzyMessage.Env_SN);
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
ds = Common.Common.GetDSByExcelXML(strXML);
DataTable dt_OPTYPE = ds.Tables["OPTYPE"];
if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "BrandInfo".ToUpper()) //品牌信息查询无分页带模糊查询
{
filter = m_request.Tables[0].Rows[0]["q"].ToString(); // 实时条件,用于下拉框查询数据
Get(filter);
}
if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "BrandInfoForPageList".ToUpper()) //供应商信息查询有分页
{
BrandInfoForPageList();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "EDIT".ToUpper())//供应商新增修改操作
{
EDIT();
}
return ds_Return;
}
catch
{
m_conn.RollbackTransaction();
throw;
}
}
示例2: Execute
/// <summary>
/// 编辑WS信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("WSRR");
try
{
if(m_request == null
|| m_request.Tables.Count==0
|| m_request.Tables[0].Rows.Count == 0)
{
return true;
}
string strParam_ID = m_request.Tables[0].Rows[0]["Param_ID"].ToString();
ArrayList listTable = new ArrayList();
listTable.Add("WS_Param");
conn.BeginTransaction();
conn.TableLock(listTable);
string strWhere = " Param_ID = '" + strParam_ID + "'";
conn.Delete("WS_Param", strWhere);
conn.CommitTransaction();
return true;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例3: Execute
/// <summary>
/// 删除系统权限信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM");
try
{
string strAuthorization_ID = m_request.Tables[0].Rows[0]["Authorization_ID"].ToString();
m_request.Tables[0].Columns.Remove("Authorization_ID");
ArrayList listTable = new ArrayList();
listTable.Add("MDM_System_Authorization");
listTable.Add("MDM_System_Menu_AUZ");
conn.BeginTransaction();
conn.TableLock(listTable);
if (strAuthorization_ID != "")
{
string strWhere = " Authorization_ID=" + strAuthorization_ID;
conn.Delete("MDM_System_Authorization", strWhere);
conn.Delete("MDM_System_Menu_AUZ", strWhere);
}
conn.CommitTransaction();
return true;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例4: Execute
/// <summary>
/// 编辑系统属性信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM");
try
{
string strProperty_ID = m_request.Tables[0].Rows[0]["Property_ID"].ToString();
m_request.Tables[0].Columns.Remove("Property_ID");
ArrayList listTable = new ArrayList();
listTable.Add("MDM_System_Property");
conn.BeginTransaction();
conn.TableLock(listTable);
if (strProperty_ID == "")
{
conn.Insert("MDM_System_Property", m_request.Tables[0]);
}
else
{
string strWhere = " Property_ID=" + strProperty_ID;
conn.Update("MDM_System_Property", m_request.Tables[0], strWhere);
}
conn.CommitTransaction();
return true;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例5: GetData
/// <summary>
/// VEX框架的主入口
/// </summary>
/// <returns></returns>
public DataSet GetData()
{
try
{
string strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
ds = Common.Common.GetDSByExcelXML(strXML);
DataTable dt_OPTYPE = ds.Tables["OPTYPE"];
string strOPTYPE = dt_OPTYPE.Rows[0][0].ToString();
strComp = m_hzyMessage.Env_SN;
conn = new Dbconn(strComp);
switch (strOPTYPE) {
case "cmbGetSupplier": cmbGetSupplier(); break;
case "cmbGetPo": cmbGetPo(); break;
case "cmbGetFailure": cmbGetFailure(); break;
case "cmbGetAP": cmbGetAP(); break;
case "onExpandRow": onExpandRow(); break;
case "Search": Search(); break;
case "winGetDetailOld": winGetDetailOld(); break;
case "winGetDetailNew": winGetDetailNew(); break;
case "Insert": Insert(); break;
case "GetWH": GetWH(); break;
};
return dsReturn;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例6: GetData
/// <summary>
/// VEX框架的主入口
/// </summary>
/// <returns></returns>
public DataSet GetData()
{
try
{
//接收XML的内容
string strXML = "",
strOPTYPE = "";
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
strComp = m_hzyMessage.Env_SN;
conn = new Dbconn(strComp);
m_RequestXML = Common.Common.GetDSByExcelXML(strXML);
DataTable dt_OPTYPE = m_RequestXML.Tables["OPTYPE"];
dt_DefList = m_RequestXML.Tables["List"];
strOPTYPE = dt_OPTYPE.Rows[0][0].ToString();
switch (strOPTYPE)
{
case "GET": Get(); break;
case "GetOnExpandRow": GetOnExpandRow(); break;
case "GetSearch": GetSearch(); break;
case "GetSKC": GetSKC(); break;
case "SetDefective": SetDefective(); break;
case "GetPrintSearch": GetPrintSearch(); break;
};
return m_ReturnData;
}
catch
{
conn.RollbackTransaction();
throw;
};
}
示例7: Execute
/// <summary>
/// 获取系统环境信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM");
try
{
string strEnv_ID = m_request.Tables[0].Rows[0]["Env_ID"].ToString();
string strEnv_SN = m_request.Tables[0].Rows[0]["Env_SN"].ToString();
m_request.Tables[0].Columns.Remove("Env_ID");
ArrayList listTable = new ArrayList();
listTable.Add("MDM_System_Env");
conn.BeginTransaction();
conn.TableLock(listTable);
//核对环境简称是否存在
string strSQL = "SELECT 1 AS a FROM MDM_System_Env where Env_SN='" + strEnv_SN + "'";
if(strEnv_ID != "")
{
strSQL += " AND Env_ID !=" + strEnv_ID;
}
DataTable dtTemp = conn.GetDataTableInTrans(strSQL);
if (dtTemp.Rows.Count > 0)
{
throw new Exception(strEnv_SN + "已存在!");
}
if (strEnv_ID == "")
{
conn.Insert("MDM_System_Env", m_request.Tables[0]);
}
else
{
string strWhere = " Env_ID=" + strEnv_ID;
conn.Update("MDM_System_Env", m_request.Tables[0], strWhere);
}
conn.CommitTransaction();
return true;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例8: Execute
/// <summary>
/// 供销售日报使用
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn_PLM_AS = new Dbconn("F22GP_ForSalesPlan");
DataSet ds = conn_PLM_AS.GetDataSet(
@" SELECT 94 AS Env_ID , --HZY_Sale_Report
null AS VexSSONewID ,
b.userid AS App_UserName ,
RIGHT(sys.fn_VarBinToHexStr(hashbytes('MD5', CONVERT(VARCHAR(100), b.password))), 32) AS App_Password ,
b.password AS App_PasswordSrc ,
b.username AS App_UserName_CN ,
GETDATE() Chang_Password_Time ,
1 Checked ,
'system' Check_User ,
GETDATE() Check_Time ,
GETDATE() Createtime ,
GETDATE() Updatetime
FROM j_depot a ,
j_user b
WHERE a.depotid = b.depotid
AND a.m_type = 11
");
Dbconn connMDM = new Dbconn("VexSSO");
try
{
ArrayList tableList = new ArrayList();
connMDM.BeginTransaction();
tableList.Add("MDM_System_User");
connMDM.TableLock(tableList);
//删除数据
connMDM.ExcuteQuerryByTran(@"DELETE FROM MDM_System_User WHERE ENV_ID=94");
connMDM.InsertBYSQLBC("MDM_System_User", ds.Tables[0]);
connMDM.CommitTransaction();
return true;
}
catch
{
connMDM.RollbackTransaction();
throw;
}
}
示例9: Execute
/// <summary>
/// 编辑系统属性值信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM");
try
{
string strSystem_ID = m_request.Tables[0].Rows[0]["System_ID"].ToString();
string strSystem_Code = m_request.Tables[0].Rows[0]["System_Code"].ToString();
DataTable dt_Add = new DataTable();
dt_Add.Columns.Add("System_ID");
dt_Add.Columns.Add("System_Code");
dt_Add.Columns.Add("Property_ID");
dt_Add.Columns.Add("Property_Text");
for (int i = 2; i < m_request.Tables[0].Columns.Count; i++)
{
string strValue = m_request.Tables[0].Rows[0][i].ToString();
if (strValue != "")
{
dt_Add.Rows.Add(new object[] { strSystem_ID, strSystem_Code, m_request.Tables[0].Columns[i].ToString(),strValue});
}
}
ArrayList listTable = new ArrayList();
listTable.Add("MDM_System_Property_info");
conn.BeginTransaction();
conn.TableLock(listTable);
string strWhere = " System_ID=" + strSystem_ID;
conn.Delete("MDM_System_Property_info", strWhere);
conn.InsertBYSQLBC("MDM_System_Property_info", dt_Add);
conn.CommitTransaction();
return true;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例10: GetData
/// <summary>
/// VEX框架的主入口
/// </summary>
/// <returns></returns>
public DataSet GetData()
{
try
{
string strXML = "";//初始化XML
string filter = "";//初始化模糊查询条件
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
conn = new Dbconn(m_hzyMessage.Env_SN);
ds = Common.Common.GetDSByExcelXML(strXML);
DataTable dt_OPTYPE = ds.Tables["OPTYPE"];
if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GoodsInfo".ToUpper())//商品信息查询无分页带模糊查询
{
filter = m_request.Tables[0].Rows[0]["q"].ToString(); // 实时条件,用于下拉框查询数据
GetGoodsInfo(filter);
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GoodsInfoForPageList".ToUpper())//商品信息查询有分页
{
GoodsInfoForPageList();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "EDITGoods".ToUpper())//商品新增修改操作
{
EDITGoods();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "AddSKU".ToUpper()) //生成SKU
{
AddSKU();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "deleteSKU".ToUpper())
{
deleteSKU();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GetGoodsFromExcel".ToUpper())
{
GetGoodsFromExcel();
}
return ds_Return;
}
catch
{
conn.RollbackTransaction();
throw;
}
}
示例11: Execute
/// <summary>
/// 删除任务参数信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM"); //创建连接类
try
{
if (m_request == null
|| m_request.Tables.Count == 0
|| m_request.Tables[0].Rows.Count == 0)
{
return true;
}
string strParam_ID = m_request.Tables[0].Rows[0]["param_id"].ToString(); //获取参数Param_ID
string strTASK_ID = m_request.Tables[0].Rows[0]["task_id"].ToString(); //获取参数Task_ID
ArrayList listTable = new ArrayList();
listTable.Add("WS_SchedulingParam");
conn.BeginTransaction(); //开启事务
conn.TableLock(listTable); //锁表WS_SchedulingParam
string strWhere = " Param_ID = '" + strParam_ID + "'"; //创建where语句
conn.Delete("WS_SchedulingParam", strWhere); //删除参数
//更新主表
DataTable dtScheduling = new DataTable();
dtScheduling.Columns.Add("UpdateTime");
DataRow drScheduling = dtScheduling.NewRow();
drScheduling["UpdateTime"] = DateTime.Now;
dtScheduling.Rows.Add(drScheduling);
string strSchedulingWhere = " 1=1 AND TASK_ID = '" + strTASK_ID + "'";
conn.Update("WS_Scheduling", dtScheduling, strSchedulingWhere); //更新数据
conn.CommitTransaction(); //提交事务
return true;
}
catch
{
conn.RollbackTransaction(); //回滚
throw;
}
}
示例12: Execute
/// <summary>
/// 删除任务信息
/// </summary>
/// <returns></returns>
public bool Execute()
{
Dbconn conn = new Dbconn("MDM");
try
{
if (m_request == null
|| m_request.Tables.Count == 0
|| m_request.Tables[0].Rows.Count == 0)
{
return true;
}
string strTASK_ID = m_request.Tables[0].Rows[0]["task_id"].ToString(); //获取参数TASK_ID
ArrayList listTable = new ArrayList();
listTable.Add("WS_Scheduling");
conn.BeginTransaction(); //事物事务
conn.TableLock(listTable); //锁表WS_Scheduling
DataTable dt_Add = new DataTable() ;
dt_Add.Columns.Add("IsDeleted");
dt_Add.Columns.Add("Enabled");
dt_Add.Columns.Add("UpdateUser");
dt_Add.Columns.Add("UpdateTime");
DataRow dr = dt_Add.NewRow();
dr["IsDeleted"] = "True"; //将删除标志设为“True”
dr["Enabled"] = "False"; //将可用标志设为“False”
dr["UpdateTime"]=DateTime.Now; //更新时间设为当前时间
dr["UpdateUser"] = hzyMessage.User_Name; //设置更新者
dt_Add.Rows.Add(dr);
string strWhere = " TASK_ID = '" + strTASK_ID + "'";
conn.Update("WS_Scheduling", dt_Add, strWhere); //更新操作
conn.CommitTransaction(); //提交事务
return true;
}
catch
{
conn.RollbackTransaction(); //回滚
throw;
}
}
示例13: GetData
public DataSet GetData()
{
try
{
string strXML = "";
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
ds = Common.Common.GetDSByExcelXML(strXML);
DataTable dtOPTYPE = ds.Tables["OPTYPE"];
DataTable dtList = ds.Tables["List"];
var strzt = dtList.Rows[0]["zt"].ToString();//获取帐套
m_conn = new Dbconn("PLM_AS_" + strzt);
if (dtOPTYPE.Rows[0][0].ToString().ToUpper() == "ImportPlan".ToUpper())
{
ImportPlan();
}
else if (dtOPTYPE.Rows[0][0].ToString().ToUpper() == "DeletePlan".ToUpper())
{
DeletePlan();
}
else if (dtOPTYPE.Rows[0][0].ToString().ToUpper() == "UpdatePlan".ToUpper())
{
UpdatePlan();
}
else if (dtOPTYPE.Rows[0][0].ToString().ToUpper() == "CheckForUserPower".ToUpper())
{
CheckForUserPower();
}
else if (dtOPTYPE.Rows[0][0].ToString().ToUpper() == "GetStyleDetailTable".ToUpper())
{
GetStyleDetailTable();
}
return m_Return;
}
catch
{
m_conn.RollbackTransaction();
throw;
}
}
示例14: GetData
/// <summary>
/// VEX框架的主入口
/// </summary>
/// <returns></returns>
public DataSet GetData()
{
try
{
//接收XML的内容
string strXML = "",
strOPTYPE = "";
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
m_RequestXML = Common.Common.GetDSByExcelXML(strXML);
strComp = m_hzyMessage.Env_SN;
conn = new Dbconn(strComp);
DataTable dt_OPTYPE = m_RequestXML.Tables["OPTYPE"];
strOPTYPE = dt_OPTYPE.Rows[0][0].ToString();
switch (strOPTYPE) {
case "Get": Get(""); break;
case "INSERT": Insert(); break;
case "UPDATE": Update(); break;
case "UPDATEPO": UpdatePO(); break;
case "CheckLink": CheckLink(); break;
case "DELETE": Delete(); break;
case "Audit": Audit(); break;
case "Search": Search(); break;
};
if (strOPTYPE == "GETCONTRACTCOMBOGRID")
{
string strFilter = m_request.Tables[0].Rows[0]["q"].ToString();
GetContractComboGrid(strFilter);
};
return m_ReturnData;
}
catch
{
conn.RollbackTransaction();
throw;
};
}
示例15: GetData
public DataSet GetData()
{
try
{
m_conn = new Dbconn(m_hzyMessage.Env_SN);
string strXML = "";
strXML = m_request.Tables[0].Rows[0]["XML"].ToString();
ds = Common.Common.GetDSByExcelXML(strXML);
DataTable dt_OPTYPE = ds.Tables["OPTYPE"];
if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "EditPaymentRequisit".ToUpper())
{
EditPaymentRequisit();//付款申请单(Hawk2集团版)
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GetPR1_PaymentRequisit".ToUpper())
{
GetPR1_PaymentRequisit();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GetDeposit".ToUpper())
{
GetDeposit();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "GetDepositDetail".ToUpper())
{
GetDepositDetail();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "EditPaymentRequest".ToUpper())
{
EditPaymentRequest();
}
else if (dt_OPTYPE.Rows[0][0].ToString().ToUpper() == "EditPaymentDetail".ToUpper())
{
EditPaymentDetail();
}
return ds_Return;
}
catch
{
m_conn.RollbackTransaction();//事务回滚
throw;
}
}