Ejemplo n.º 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (lvCareRecord.SelectedItems.Count == 1)
            {
                DAO.UDT_CounselCareRecordDef careRec = lvCareRecord.SelectedItems[0].Tag as DAO.UDT_CounselCareRecordDef;
                if (careRec != null)
                {
                    DAO.LogTransfer        logTransfer = new DAO.LogTransfer();
                    K12.Data.StudentRecord studRec     = K12.Data.Student.SelectByID(PrimaryKey);
                    StringBuilder          logData     = new StringBuilder();
                    logData.AppendLine("刪除" + Utility.ConvertString1(studRec));

                    if (FISCA.Presentation.Controls.MsgBox.Show("請問是否確定是刪除優先關懷紀錄?", "刪除優先關懷紀錄", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                    {
                        // log
                        logData.AppendFormat("代號:" + careRec.CodeName);
                        if (careRec.FileDate.HasValue)
                        {
                            logData.AppendLine("立案日期:" + careRec.FileDate.Value.ToShortDateString());
                        }

                        logData.AppendLine("個案類別:" + careRec.CaseCategory);
                        logData.AppendLine("個案類別備註:" + careRec.CaseCategoryRemark);
                        logData.AppendLine("個案來源:" + careRec.CaseOrigin);
                        logData.AppendLine("個案來源備註:" + careRec.CaseOriginRemark);
                        logData.AppendLine("優勢能力及財力:" + careRec.Superiority);
                        logData.AppendLine("弱勢能力及阻力:" + careRec.Weakness);
                        logData.AppendLine("輔導人員輔導目標:" + careRec.CounselGoal);
                        logData.AppendLine("校外協輔機構:" + careRec.OtherInstitute);
                        logData.AppendLine("輔導人員輔導方式:" + careRec.CounselType);
                        logData.AppendLine("協同輔導人員協助導師事項:" + careRec.AssistedMatter);
                        logData.AppendLine("記錄者:" + careRec.AuthorID);
                        logData.AppendLine("記錄者姓名:" + careRec.AuthorName);

                        _UDTTransfer.DeleteCareRecord(careRec);

                        logTransfer.SaveLog("學生.輔導優先關懷-刪除", "刪除", "student", PrimaryKey, logData);

                        _BGRun();
                    }
                }
            }
            else
            {
                FISCA.Presentation.Controls.MsgBox.Show("請選擇資料.");
            }
        }