Пример #1
0
 public void UpdateBond(Bond bond)
 {
     var tBondTableAdapter = new t_bondTableAdapter();
     var tBondDataTable = new BondDBDataSet.t_bondDataTable();
     tBondTableAdapter.Fill(tBondDataTable);
     var tBondRow = tBondDataTable.FindByID(bond.Id);
     tBondRow.Owner = bond.Owner;
     tBondRow.Serial = bond.Serial;
     tBondRow.ModifiedDate = bond.ModifiedDate;
     tBondTableAdapter.Update(tBondRow);
 }
Пример #2
0
 private void AddNewBond()
 {
     var bond = new Bond
         {
             Serial = Convert.ToInt64(txtSerial.Text),
             Owner = txtOwner.Text,
             CreatedDate = DateTime.Now,
             ModifiedDate = DateTime.Now
         };
     var dal = new DAL();
     dal.AddBond(bond);
     this.Close();
 }
Пример #3
0
 private static List<Bond> GetBonds(IEnumerable<DataRow> dataRows)
 {
     var bonds = new List<Bond>();
     foreach (DataRow row in dataRows)
     {
         try
         {
             var bond = new Bond
                 {
                     Id = (Int64)row["ID"],
                     Serial = (Int64)row["Serial"],
                     Owner = row["Owner"].ToString(),
                     CreatedDate = (DateTime)row["CreatedDate"],
                     ModifiedDate = (DateTime)row["ModifiedDate"]
                 };
             bonds.Add(bond);
         }
         catch (Exception exception)
         {
             exception.ToString();
         }
     }
     return bonds;
 }
Пример #4
0
 public void SetData(Bond dataBoundItem)
 {
     _updateBondCandidate = dataBoundItem;
     txtOwner.Text = _updateBondCandidate.Owner;
     txtSerial.Text = _updateBondCandidate.Serial.ToString(CultureInfo.InvariantCulture);
 }
Пример #5
0
 public void AddBond(Bond bond)
 {
     var tBondTableAdapter = new t_bondTableAdapter();
     tBondTableAdapter.Insert(bond.Serial, bond.Owner, bond.CreatedDate, bond.ModifiedDate);
 }