public int Delete(TC_OA_LingYongMoneyDetailModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new TC_OA_LingYongMoneyDetailBLL().Delete(ObjModel.Code, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public TC_OA_LingYongMoneyDetailModel GetTC_OA_LingYongMoneyDetail(int Code) { TC_OA_LingYongMoneyDetailModel model = new TC_OA_LingYongMoneyDetailModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new TC_OA_LingYongMoneyDetailBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public int Update(TC_OA_LingYongMoneyDetailModel ObjModel, SqlTransaction Transaction) { TC_OA_LingYongMoneyDetailDAL ldal = new TC_OA_LingYongMoneyDetailDAL(Transaction); return(ldal.Update(ObjModel)); }