本文整理汇总了C#中OpenCBS.Manager.OpenCbsCommand.ExecuteNonQuery方法的典型用法代码示例。如果您正苦于以下问题:C# OpenCbsCommand.ExecuteNonQuery方法的具体用法?C# OpenCbsCommand.ExecuteNonQuery怎么用?C# OpenCbsCommand.ExecuteNonQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCBS.Manager.OpenCbsCommand
的用法示例。
在下文中一共展示了OpenCbsCommand.ExecuteNonQuery方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunSQL
public void RunSQL(string sqlText, SqlTransaction tran)
{
using (OpenCbsCommand sqlCommand = new OpenCbsCommand(sqlText, tran.Connection, tran))
{
sqlCommand.ExecuteNonQuery();
}
}
示例2: DeleteInstallmentType
public void DeleteInstallmentType(InstallmentType installmentType)
{
const string q = @"DELETE FROM [InstallmentTypes] WHERE id = @id";
using (SqlConnection conn = GetConnection())
using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
{
c.AddParam("@id", installmentType.Id);
c.ExecuteNonQuery();
}
}
示例3: AddPublicHoliday
public void AddPublicHoliday(DictionaryEntry entry)
{
const string sqlText = "INSERT INTO [PublicHolidays]([date], [name]) VALUES(@date, @name)";
using(SqlConnection connection = GetConnection())
using (OpenCbsCommand cmd = new OpenCbsCommand(sqlText, connection))
{
cmd.AddParam("@date",Convert.ToDateTime(entry.Key));
cmd.AddParam("@name", entry.Value.ToString());
cmd.ExecuteNonQuery();
}
}
示例4: AddCollectionItem
public void AddCollectionItem(int fieldId, string colItem)
{
string sqlListText = @"INSERT INTO [AdvancedFieldsCollections]
([field_id], [value])
VALUES (@field_id, @col_item)";
using (SqlConnection conn = GetConnection())
using (OpenCbsCommand insertCmd = new OpenCbsCommand(sqlListText, conn))
{
insertCmd.AddParam("@field_id", fieldId);
insertCmd.AddParam("@col_item", colItem);
insertCmd.ExecuteNonQuery();
}
}
示例5: AddPaymentMethodToBranch
public void AddPaymentMethodToBranch(PaymentMethod paymentMethod)
{
const string q =
@"INSERT INTO LinkBranchesPaymentMethods (branch_id, payment_method_id, account_id)
VALUES (@branch_id, @payment_method_id, @account_id)";
using (SqlConnection conn = GetConnection())
using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
{
c.AddParam("@branch_id", paymentMethod.Branch.Id);
c.AddParam("@payment_method_id", paymentMethod.Id);
c.AddParam("@account_id", paymentMethod.Account.Id);
c.ExecuteNonQuery();
}
}
示例6: AddAllowedItem
public void AddAllowedItem(int pRoleId, int pActionId, bool pAllowed)
{
const string q = @"INSERT INTO AllowedRoleActions (action_item_id, role_id, allowed)
VALUES (@actionId, @roleId, @allowed)";
using (SqlConnection conn = GetConnection())
{
using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
{
c.AddParam("@allowed", pAllowed);
c.AddParam("@actionId", pActionId);
c.AddParam("@roleId", pRoleId);
c.ExecuteNonQuery();
}
}
}
示例7: CreateMFI
public bool CreateMFI(MFI pMFI)
{
if (SelectMFI().Login == null)
{
string sqlText = "INSERT INTO [MFI] ([name], [login], [password]) VALUES(@name,@login,@password)";
using (SqlConnection connection = GetConnection())
using (OpenCbsCommand cmd = new OpenCbsCommand(sqlText, connection))
{
cmd.AddParam("@name", pMFI.Name);
cmd.AddParam("@login", pMFI.Login);
cmd.AddParam("@password", pMFI.Password);
cmd.ExecuteNonQuery();
return true;
}
}
return false;
}
示例8: DeleteCollateralProduct
public void DeleteCollateralProduct(int colProductId)
{
const string sqlText = @"UPDATE CollateralProducts SET deleted = 1
WHERE [id] = @id";
using (SqlConnection connection = GetConnection())
using (OpenCbsCommand command = new OpenCbsCommand(sqlText, connection))
{
command.AddParam("@id", colProductId);
command.ExecuteNonQuery();
}
}
示例9: UpdatePaymentMethodFromBranch
public void UpdatePaymentMethodFromBranch(PaymentMethod paymentMethod)
{
const string q =
@"UPDATE LinkBranchesPaymentMethods SET account_id = @account_id, payment_method_id = @payment_method_id
WHERE id = @id";
using (SqlConnection conn = GetConnection())
using (OpenCbsCommand c = new OpenCbsCommand(q, conn))
{
c.AddParam("@account_id", paymentMethod.Account.Id);
c.AddParam("@payment_method_id", paymentMethod.Id);
c.AddParam("@id", paymentMethod.LinkId);
c.ExecuteNonQuery();
}
}
示例10: _UpdateFollowUp
private void _UpdateFollowUp(FollowUp pUp, SqlTransaction pTransaction)
{
const string q = @"UPDATE [FollowUp] SET [year] = @year,[CA] = @CA,[Jobs1] = @Jobs1 ,[Jobs2] = @Jobs2
,[PersonalSituation] = @PersonalSituation ,[activity] = @activity ,[comment] = @comment WHERE id = @id";
using (OpenCbsCommand c = new OpenCbsCommand(q, pTransaction.Connection, pTransaction))
{
c.AddParam("@id", pUp.Id);
c.AddParam("@year", pUp.Year);
c.AddParam("@CA", pUp.CA);
c.AddParam("@jobs1", pUp.Jobs1);
c.AddParam("@jobs2", pUp.Jobs2);
c.AddParam("@personalSituation", pUp.PersonalSituation);
c.AddParam("@activity", pUp.Activity);
c.AddParam("@comment", pUp.Comment);
c.ExecuteNonQuery();
}
}
示例11: UpdateProjectStatut
public void UpdateProjectStatut(Project pProject, SqlTransaction pTransaction)
{
const string q = "UPDATE [Projects] SET [status] = @status WHERE id = @id";
using (OpenCbsCommand c = new OpenCbsCommand(q, pTransaction.Connection, pTransaction))
{
c.AddParam("@id", pProject.Id);
c.AddParam("@status", (int) pProject.ProjectStatus);
c.ExecuteNonQuery();
}
}
示例12: UpdateEconomicActivity
/// <summary>
/// Update economic activity name and delete
/// </summary>
/// <param name="pEconomicActivity">EconomicActivity object</param>
public void UpdateEconomicActivity(EconomicActivity pEconomicActivity)
{
const string sqlText = "UPDATE EconomicActivities SET name = @name,deleted = @wasDeleted WHERE id = @id";
using (SqlConnection connection = GetConnection())
using (OpenCbsCommand update = new OpenCbsCommand(sqlText, connection))
{
update.AddParam("@id", pEconomicActivity.Id);
update.AddParam("@name", pEconomicActivity.Name);
update.AddParam("@wasDeleted", pEconomicActivity.Deleted);
update.ExecuteNonQuery();
}
}
示例13: DeleteTiers
public void DeleteTiers()
{
OpenCbsCommand deleteClientBranchHistory = new OpenCbsCommand("DELETE ClientBranchHistory", _connection);
deleteClientBranchHistory.ExecuteNonQuery();
OpenCbsCommand deletePersonGroupBelonging = new OpenCbsCommand("DELETE PersonGroupBelonging", _connection);
deletePersonGroupBelonging.ExecuteNonQuery();
OpenCbsCommand deletePersons = new OpenCbsCommand("DELETE Persons", _connection);
deletePersons.ExecuteNonQuery();
OpenCbsCommand deleteGroups = new OpenCbsCommand("DELETE Groups", _connection);
deleteGroups.ExecuteNonQuery();
OpenCbsCommand deleteProject = new OpenCbsCommand("DELETE Projects", _connection);
deleteProject.ExecuteNonQuery();
OpenCbsCommand deleteSavingEvents = new OpenCbsCommand("DELETE SavingEvents", _connection);
deleteSavingEvents.ExecuteNonQuery();
OpenCbsCommand deleteSavingBookContracts = new OpenCbsCommand("DELETE FROM SavingBookContracts", _connection);
deleteSavingBookContracts.ExecuteNonQuery();
OpenCbsCommand deleteSavingDepositContracts = new OpenCbsCommand("DELETE FROM SavingDepositContracts", _connection);
deleteSavingDepositContracts.ExecuteNonQuery();
OpenCbsCommand deleteSavingContracts = new OpenCbsCommand("DELETE SavingContracts", _connection);
deleteSavingContracts.ExecuteNonQuery();
OpenCbsCommand deleteTiers = new OpenCbsCommand("DELETE Tiers", _connection);
deleteTiers.ExecuteNonQuery();
}
示例14: DeletePackage
public void DeletePackage()
{
OpenCbsCommand delete = new OpenCbsCommand("DELETE Packages", _connection);
delete.ExecuteNonQuery();
}
示例15: DeleteCorporatePerson
public void DeleteCorporatePerson()
{
OpenCbsCommand deleteCorporatePerson = new OpenCbsCommand("DELETE CorporatePersonBelonging", _connection);
deleteCorporatePerson.ExecuteNonQuery();
}