コード例 #1
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            _rt          = rtbo.GetRecord(_rt.RecordId);
            _rt.RoomName = txtRoomName.Text;
            var newAllotment = int.Parse(txtDefaultAllotment.Text);

            if (_rt.RecordId == 0)
            {
                _rt.DefaultAllotment = newAllotment;
                rtbo.Add(_rt);
            }
            else
            {
                if (newAllotment < _rt.DefaultAllotment)
                {
                    var arbo = new BO.AllotmentRecordBO();
                    arbo.ExecuteSql(@"DELETE FROM AllotmentRecords WHERE AllotmentRoomTypeId={0} AND
                        CurrentAllotment>={1}", new object[] { _rt.RecordId, newAllotment });
                }
                _rt.DefaultAllotment   = newAllotment;
                _rt.IgnoreThisRoomType = cxIgnoreThis.Checked;
                rtbo.Save();
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
コード例 #2
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow row in dgRecords.Rows)
     {
         var rw     = (BindingItem)row.DataBoundItem;
         var record = rbo.GetRecord(rw.RecordId);
         if (record.Acknowledged != rw.Acknowledged)
         {
             record.Acknowledged = rw.Acknowledged;
             rtbo.Save();
         }
     }
     BindData();
 }