本文整理汇总了C#中Currency.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Currency.Save方法的具体用法?C# Currency.Save怎么用?C# Currency.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Currency
的用法示例。
在下文中一共展示了Currency.Save方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateDatabaseAfterUpdateSchema
public override void UpdateDatabaseAfterUpdateSchema()
{
base.UpdateDatabaseAfterUpdateSchema();
Employee userAdmin = Session.FindObject<Employee>(new BinaryOperator("UserName", "Admin"));
if (new XPCollection<Company>(Session).Count == 0)
{
using (Role administratorRole = new Role(Session) { Name = "Administrator role" })
{
administratorRole.AddPermission(new EditModelPermission());
administratorRole.AddPermission(new ObjectAccessPermission(typeof(object), ObjectAccess.AllAccess));
administratorRole.Save();
using (Role userRole = new Role(Session) { Name = "User" })
{
userRole.AddPermission(new ObjectAccessPermission(typeof(object), ObjectAccess.Navigate));
userRole.AddPermission(new ObjectAccessPermission(typeof(object), ObjectAccess.Read));
userRole.Save();
}
userAdmin = new Employee(Session);
userAdmin.UserName = "Admin";
userAdmin.FirstName = "Admin";
userAdmin.LastName = "";
userAdmin.Roles.Add(administratorRole);
userAdmin.Save();
using (Branch branch1 = new Branch(Session) { Acronym = "WTPR", Branchname = "Roadmax Head Office" })
{
using (Company company1 = new Company(Session) { CompanyName = "Roadmax Marketing Inc.", Acronym = "WTPR" })
{
company1.Employees.Add(userAdmin);
company1.Branches.Add(branch1);
company1.Save();
ImportData(company1);
}
}
}
using (Currency curr = new Currency(Session) { CurrencyName = "Peso", CurrencyRate = 1 })
{
curr.Save();
}
using (VatCategory vat = new VatCategory(Session) { Acronym = "VAT", Description = "Vatable", Rate = 12 })
{
vat.Save();
}
}
//importReport("SOHeaderPrintOut");
}
示例2: Insert
public void Insert(string Code,string Description)
{
Currency item = new Currency();
item.Code = Code;
item.Description = Description;
item.Save(UserName);
}
示例3: uiGridViewCurrency_RowCommand
protected void uiGridViewCurrency_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EditCurrency")
{
Currency objData = new Currency();
objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
uiTextBoxEnName.Text = objData.EnName;
uiTextBoxArName.Text = objData.ArName;
uiTextBoxCode.Text = objData.Code;
uiPanelViewCurrency.Visible = false;
uiPanelEdit.Visible = true;
CurrentCurrency = objData;
}
else if (e.CommandName == "DeleteCurrency")
{
Currency objData = new Currency();
objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()));
objData.MarkAsDeleted();
objData.Save();
CurrentCurrency = null;
BindData();
}
}
示例4: Update
public void Update(int CodeID,string Code,string Description)
{
Currency item = new Currency();
item.CodeID = CodeID;
item.Code = Code;
item.Description = Description;
item.MarkOld();
item.Save(UserName);
}
示例5: AddNewRecord
private void AddNewRecord()
{
Currency objData = new Currency();
objData.AddNew();
objData.EnName = uiTextBoxEnName.Text;
objData.ArName = uiTextBoxArName.Text;
objData.Code = uiTextBoxCode.Text;
objData.Save();
}