コード例 #1
0
        public void ChangeCellEventHandler(Range Target)
        {
            ExcelSheetInfo currentsheet = appData.eSheetsInfomation.getCurrentSheet();

            if (appData.eSheetsInfomation.getCurrentSheet() == null || appData.eSheetsInfomation.getCurrentSheet().ignoreChangeEvent)
            {
                return;
            }
            if (Target.Column == ExcelColumsDefinition.SCHEMANAMEEXCELCOL + 1 && appData.eSheetsInfomation.getCurrentSheet().sheetType == ExcelSheetInfo.ExcelSheetType.attribute)
            {
                Utils.unprotectSheet(currentsheet);
                currentsheet.excelsheet.Cells[ExcelColumsDefinition.HEADERCOL + 1][Target.Row] = Target.Text == string.Empty ? string.Empty : string.Format("New Field : {0}", Target.Text);
                Utils.protectSheet(currentsheet);
            }
            if (Target.Column == ExcelColumsDefinition.SCHEMANAMEEXCELCOL + 1 && appData.eSheetsInfomation.getCurrentSheet().sheetType == ExcelSheetInfo.ExcelSheetType.entity)
            {
                Utils.unprotectSheet(currentsheet);
                currentsheet.excelsheet.Cells[ExcelColumsDefinition.HEADERCOL + 1][Target.Row] = Target.Text == string.Empty ? string.Empty : string.Format("New entity : {0}", Target.Text);
                Utils.protectSheet(currentsheet);
            }
            if (Target.Column == ExcelColumsDefinition.ATTRIBUTETYPEEXCELCOL + 1 && appData.eSheetsInfomation.getCurrentSheet() != null && Target.Row > ExcelColumsDefinition.FIRSTROW)
            {
                Utils.unprotectSheet(currentsheet);
                excellData.changeCellsColorOnTypeChange(Target, true);
                Utils.protectSheet(currentsheet);
            }
            if ((Target.Column == ExcelColumsDefinition.SCHEMANAMEEXCELCOL + 1 || Target.Column == ExcelColumsDefinition.ATTRIBUTETYPEEXCELCOL + 1 || Target.Column == ExcelColumsDefinition.LOOKUPTARGET + 1) && appData.eSheetsInfomation.getCurrentSheet().sheetType == ExcelSheetInfo.ExcelSheetType.attribute && currentsheet.excelsheet.Cells[Target.Row, ExcelColumsDefinition.ATTRIBUTETYPEEXCELCOL + 1].Text == "Lookup")
            {
                Utils.unprotectSheet(currentsheet);
                String lookUpAttributeName = string.Format("{0}_{1}_{2}_{3}", currentsheet.orgPrefix, currentsheet.excelsheet.Cells[Target.Row, ExcelColumsDefinition.LOOKUPTARGET + 1].Text, currentsheet.objectName, Utils.removeOrgPrefix(currentsheet.excelsheet.Cells[Target.Row, ExcelColumsDefinition.SCHEMANAMEEXCELCOL + 1].Text, currentsheet.objectName));
                currentsheet.excelsheet.Cells[Target.Row, ExcelColumsDefinition.LOOKUPRELATIONSHIPNAME + 1] = lookUpAttributeName;
                Utils.protectSheet(currentsheet);
            }
            if ((Target.Column == ExcelColumsDefinition.VIEWATTRIBUTEENTITY + 1) && appData.eSheetsInfomation.getCurrentSheet().sheetType == ExcelSheetInfo.ExcelSheetType.view)
            {
                Utils.unprotectSheet(currentsheet);
                excellData.ShowRelatedAttributes(Target);
                Utils.protectSheet(currentsheet);
            }
        }