示例#1
0
        // Residents
        private void btnCreate_Click(object sender, EventArgs e)
        {
            MissionAddResident addResident = new MissionAddResident(new ResidentMission());

            if (addResident.ShowDialog() == DialogResult.OK)
            {
                addResident.Mission.CreatedTime = DateTime.Now;
                addResident.Mission.Resident    = ResidentService.Get(CurrentUser.UserId);
                addResident.Mission.State       = MissionStatus.未接受;
                ResidentMissionService.Add(addResident.Mission);
                QueryAll(CurrentUser);
            }
        }
示例#2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            EmergencyAddResident addResident = new EmergencyAddResident(new Emergency());

            if (addResident.ShowDialog() == DialogResult.OK)
            {
                addResident.emergency.RaiseTime  = DateTime.Now;
                addResident.emergency.resident   = ResidentService.Get(CurrentUser.UserId);
                addResident.emergency.EmergState = EmergencyStatus.未处理;
                EmergencyService.Add(addResident.emergency);
                QueryAll(CurrentUser);
            }
        }
示例#3
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            HealthStatus HealthStatus = ResidentService.Get(txtId.Text).HealthStatus;

            if (HealthStatus == HealthStatus.Health)
            {
                MessageBox.Show("该居民健康,可以放行");
            }
            else if (HealthStatus == HealthStatus.quarantine)
            {
                MessageBox.Show("该居民隔离,不建议放行");
            }
            else if (HealthStatus == HealthStatus.sick)
            {
                MessageBox.Show("该居民患病,不能放行");
            }
        }
示例#4
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            Resident resident = InfoBindingSource.Current as Resident;

            if (resident == null)
            {
                MessageBox.Show("请选择一个信息进行修改");
                return;
            }
            resident = ResidentService.Get(resident.ResidentId);
            InformationEdit informationEdit = new InformationEdit(resident);

            if (informationEdit.ShowDialog() == DialogResult.OK)
            {
                ResidentService.Update(informationEdit.Resident);
                InfoBindingSource.DataSource = ResidentService.QueryByUser(CurrentUser.UserId);
                InfoBindingSource.ResetBindings(false);
            }
        }