当前位置: 首页>>代码示例>>C#>>正文


C# Currency.Save方法代码示例

本文整理汇总了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");
        }
开发者ID:ViniciusConsultor,项目名称:roadmaxweberp,代码行数:48,代码来源:Updater.cs

示例2: Insert

        public void Insert(string Code,string Description)
        {
            Currency item = new Currency();

            item.Code = Code;

            item.Description = Description;

            item.Save(UserName);
        }
开发者ID:freecin,项目名称:dashcommerce-3,代码行数:10,代码来源:CurrencyController.cs

示例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();
     }
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:23,代码来源:EditCurrency.aspx.cs

示例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);
        }
开发者ID:freecin,项目名称:dashcommerce-3,代码行数:13,代码来源:CurrencyController.cs

示例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();
 }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:9,代码来源:EditCurrency.aspx.cs


注:本文中的Currency.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。