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


C# Supplier.Save方法代码示例

本文整理汇总了C#中Supplier.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Supplier.Save方法的具体用法?C# Supplier.Save怎么用?C# Supplier.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Supplier的用法示例。


在下文中一共展示了Supplier.Save方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Demonstrate_DbReferenceFetch

        public void Demonstrate_DbReferenceFetch()
        {
            var supplier = new Supplier { Name = "Acme" };
            supplier.Save();

            var product = new Product {
                Name = "Shovel",
                Price = "17.50",
                Sku = "a3k4j22je9",
                Weight = "11",
                Supplier = new DbReference<Supplier>(supplier.Id)
            };
            product.Save();

            var fetched = Product.GetById(product.Id);

            Assert.AreEqual(supplier.Id, fetched.GetRef(x => x.Supplier).Id);
        }
开发者ID:thegrubbsian,项目名称:MongoDBCSharpDemo,代码行数:18,代码来源:NoRMaticTests.cs

示例2: GivenManyModelsSavedInSuccession_TheConnectionPool_ShouldHandleAppropriately

        public void GivenManyModelsSavedInSuccession_TheConnectionPool_ShouldHandleAppropriately()
        {
            Supplier.DeleteAll();

            for (var i = 0; i < 100; i++) {
                var supplier = new Supplier {Name = "Supplier" + i, Address = "Address" + i};
                supplier.Save();
            }

            var suppliers = Supplier.All().ToList();
            Assert.AreEqual(100, suppliers.Count());
        }
开发者ID:efbenson,项目名称:NoRMatic,代码行数:12,代码来源:BasicTests.cs

示例3: GivenManyModelsSavedAndReadInSuccession_TheConnectionPool_ShouldHandleAppropriately

        public void GivenManyModelsSavedAndReadInSuccession_TheConnectionPool_ShouldHandleAppropriately()
        {
            Supplier.DeleteAll();
            var allFound = true;

            for (var i = 0; i < 100; i++) {
                var supplier = new Supplier { Name = "Supplier" + i, Address = "Address" + i };
                supplier.Save();
                var fetched = Supplier.GetById(supplier.Id);
                if (fetched == null || fetched.Name != supplier.Name) { allFound = false; }
            }

            Assert.True(allFound);
        }
开发者ID:efbenson,项目名称:NoRMatic,代码行数:14,代码来源:BasicTests.cs

示例4: GivenAModelWithADbReferenceProperty_FetchRef_ShouldReturnTheCorrectEntity

        public void GivenAModelWithADbReferenceProperty_FetchRef_ShouldReturnTheCorrectEntity()
        {
            var supplier = new Supplier { Name = "Acme" };
            supplier.Save();

            var product = new Product {
                Name = "Hammer",
                Price = "10",
                Supplier = new DbReference<Supplier>(supplier.Id)
            };
            product.Save();

            var fetchedRef = product.GetRef(x => x.Supplier);

            Assert.IsNotNull(fetchedRef);
            Assert.AreEqual(fetchedRef.Name, supplier.Name);
        }
开发者ID:efbenson,项目名称:NoRMatic,代码行数:17,代码来源:BasicTests.cs

示例5: btnSupplierSave_Click

 private void btnSupplierSave_Click(object sender, EventArgs e)
 {
     if (supplierValidation.Validate())
     {
         Supplier sup = new Supplier();
         if (supplierId != 0)
             sup.LoadByPrimaryKey(supplierId);
         else
             sup.AddNew();
         sup.CompanyInfo = cboCompanyInfo.EditValue.ToString();
         sup.CompanyName = txtCompanyName.Text;
         sup.Address = txtAddress.Text;
         sup.ContactPerson = txtContactPerson.Text;
         sup.Telephone = txtTelephone.Text;
         sup.IsActive = ckIsActive.Checked;
         sup.Mobile = txtMobile.Text;
         sup.Email = txtEmail.Text;
         sup.Save();
         sup.LoadAll();
         PopulateSupplier(sup);
         ResetSupplier();
     }
     else
     {
         txtCompanyName.BackColor = Color.FromArgb(251, 214, 214);
     }
 }
开发者ID:USAID-DELIVER-PROJECT,项目名称:ethiopia-hcmis-warehouse,代码行数:27,代码来源:DeliverySettings.cs

示例6: Insert

        public void Insert(string CompanyName,string ContactName,string ContactTitle,string Address,string City,string Region,string PostalCode,string Country,string Phone,string Fax,string HomePage)
        {
            Supplier item = new Supplier();

            item.CompanyName = CompanyName;

            item.ContactName = ContactName;

            item.ContactTitle = ContactTitle;

            item.Address = Address;

            item.City = City;

            item.Region = Region;

            item.PostalCode = PostalCode;

            item.Country = Country;

            item.Phone = Phone;

            item.Fax = Fax;

            item.HomePage = HomePage;

            item.Save(UserName);
        }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:28,代码来源:SupplierController.cs

示例7: Update

        public void Update(int SupplierID,string CompanyName,string ContactName,string ContactTitle,string Address,string City,string Region,string PostalCode,string Country,string Phone,string Fax,string HomePage)
        {
            Supplier item = new Supplier();
            item.MarkOld();
            item.IsLoaded = true;

            item.SupplierID = SupplierID;

            item.CompanyName = CompanyName;

            item.ContactName = ContactName;

            item.ContactTitle = ContactTitle;

            item.Address = Address;

            item.City = City;

            item.Region = Region;

            item.PostalCode = PostalCode;

            item.Country = Country;

            item.Phone = Phone;

            item.Fax = Fax;

            item.HomePage = HomePage;

            item.Save(UserName);
        }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:32,代码来源:SupplierController.cs


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