//------------Save && Cancel private void btnSaveStationRoom_Click(object sender, EventArgs e) { lbmsgAlert.Text = ""; mstroomdtlsBindingSource.EndEdit(); RoomHDRbindingSource1.EndEdit(); dbc.SubmitChanges(); lbmsgAlert.Text = "Save data completed."; LoadRoomEvent(0); }
private void btnNewRoomhdr_Click(object sender, EventArgs e) { RoomHDRbindingSource1.AddNew(); DateTime dtnow = Program.GetServerDateTime(); mst_room_hdr currenthdr = (mst_room_hdr)RoomHDRbindingSource1.Current; if (currenthdr != null) { string username = Program.CurrentUser.mut_username; int mshid = (from t1 in dbc.mst_hpc_sites select t1.mhs_id).FirstOrDefault(); int mzeid = (from t1 in dbc.mst_zones select t1.mze_id).FirstOrDefault(); currenthdr.mhs_id = mshid; currenthdr.mze_id = mzeid; currenthdr.mrm_create_by = username; currenthdr.mrm_create_date = dtnow; currenthdr.mrm_update_by = username; currenthdr.mrm_update_date = dtnow; } }