コード例 #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     var unitToDelete = new Unit
     {
         Id = UnitId
     };
     _unitManager.Delete(unitToDelete);
     Response.Redirect("UnitManagementPanel.aspx");
 }
コード例 #2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     var unit = new Unit
     {
        Code = txtUnitCode.Text,
        DepartmentId = int.Parse(DDLDepartments.SelectedValue),
        Description = txtUnitDescription.Text,
        UniqueId = Guid.NewGuid(),
        Id = UnitId
     };
     _unitManager.Save(unit);
     Response.Redirect("UnitManagementPanel.aspx");
 }