protected void btnSaveSupplier_Click(object sender, EventArgs e) { SqlSupplier.InsertParameters["Name"].DefaultValue = txtSupplierName.Text.ToUpper().Trim(); SqlSupplier.InsertParameters["Address"].DefaultValue = txtSupplierAddress.Text.ToUpper().Trim(); SqlSupplier.Insert(); gvSupplier.DataBind(); PaneladdSupplier.Visible = false; PanelgvSupplier.Visible = true; txtSupplierName.Text = string.Empty; txtSupplierAddress.Text = string.Empty; }
public void FromSupplier_ValidInput_ShouldReturnSqlSupplierWithCopiedValues() { var group = new SupplierGroup(101, "Initial supplier group"); var supplier = SupplierTests.CreateSupplier("*****@*****.**", group); var result = SqlSupplier.FromSupplier(supplier); Assert.NotNull(result); Assert.AreEqual(0, result.Id); Assert.AreEqual("John Doe", result.Name); Assert.AreEqual("Vaclavske Namesti 125", result.Address); Assert.AreEqual("*****@*****.**", result.EmailAddress); Assert.AreEqual("723123456", result.PhoneNumber); Assert.AreEqual(101, result.GroupId); }
public SupplierController(SqlSupplier supRepository) { this._supRepository = supRepository; }
public void FromSupplier_SupplierNull_ShouldThrow() { Assert.Throws <ArgumentNullException>(() => SqlSupplier.FromSupplier(null), "Supplier can't be null."); }