Exemplo n.º 1
0
        public void ClearData(List <ScreenImportUIDM> ScreenImportList)
        {
            ImportScreenBIZ bizImportScreen = new ImportScreenBIZ();

            List <string> ScreenCDList = new List <string>();

            foreach (ScreenImportUIDM ScreenImport in ScreenImportList)
            {
                ScreenCDList.Add(ScreenImport.ScreenCD.StrongValue);
            }
            bizImportScreen.ClearData(ScreenCDList);
        }
Exemplo n.º 2
0
        public void ImportData(List <ScreenImportUIDM> ScreenImportList, List <ScreenDetailUIDM> UIDMScreenDetailList)
        {
            LangBIZ bizLang = new LangBIZ();
            LangDTO dtoLang = new LangDTO();

            ScreenDetailBIZ bizScreenDetail = new ScreenDetailBIZ();

            List <ScreenDTO>           screenDTOList           = new List <ScreenDTO>();
            List <ScreenLangDTO>       screenLangDTOList       = new List <ScreenLangDTO>();
            List <ScreenDetailDTO>     screenDetailDTOList     = new List <ScreenDetailDTO>();
            List <ScreenDetailLangDTO> screenDetailLangDTOList = new List <ScreenDetailLangDTO>();
            // count lang detail
            List <LangDTO> langDTOList = bizLang.LoadAll();

            #region Collect Data
            foreach (ScreenImportUIDM ScreenImport in ScreenImportList)
            {
                // check if screen is never been import then import to screen ms
                if (ScreenImport.ImportStatus.StrongValue.ToUpper() == "NOTIMPORT")
                {
                    ScreenDTO dtoScreen = new ScreenDTO();
                    dtoScreen.SCREEN_CD           = ScreenImport.ScreenCD;
                    dtoScreen.SCREEN_NAME         = ScreenImport.ScreenName;
                    dtoScreen.ORIGINAL_TITLE      = ScreenImport.ScreenName;
                    dtoScreen.IMAGE_CD.Value      = "DEFAULT";
                    dtoScreen.SCREEN_TYPE         = ScreenImport.ScreenType;
                    dtoScreen.SCREEN_ACTION.Value = 0;
                    dtoScreen.EXT_PROGRAM.Value   = string.Empty;
                    dtoScreen.CRT_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                    dtoScreen.CRT_DATE.Value    = DateTime.Now;
                    dtoScreen.CRT_MACHINE.Value = Environment.MachineName;
                    dtoScreen.UPD_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                    dtoScreen.UPD_DATE.Value    = DateTime.Now;
                    dtoScreen.UPD_MACHINE.Value = Environment.MachineName;

                    screenDTOList.Add(dtoScreen);

                    if (langDTOList.Count > 0)
                    {
                        foreach (LangDTO langdto in langDTOList)
                        {
                            ScreenLangDTO dtoScreenLang = new ScreenLangDTO();
                            // add multilang for screen name
                            dtoScreenLang.SCREEN_CD         = ScreenImport.ScreenCD;
                            dtoScreenLang.SCREEN_DESC       = ScreenImport.ScreenName;
                            dtoScreenLang.CRT_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                            dtoScreenLang.CRT_DATE.Value    = DateTime.Now;
                            dtoScreenLang.CRT_MACHINE.Value = Environment.MachineName;
                            dtoScreenLang.UPD_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                            dtoScreenLang.UPD_DATE.Value    = DateTime.Now;
                            dtoScreenLang.UPD_MACHINE.Value = Environment.MachineName;
                            dtoScreenLang.LANG_CD           = langdto.LANG_CD;
                            //bizScreenLang.AddNew(dtoScreenLang);
                            screenLangDTOList.Add(dtoScreenLang);
                        }
                    }
                }
            }

            foreach (ScreenDetailUIDM ScreenDetail in UIDMScreenDetailList)
            {
                ScreenDetailDTO dtoScreenDetail = new ScreenDetailDTO();
                dtoScreenDetail.SCREEN_CD         = ScreenDetail.ScreenCD;
                dtoScreenDetail.CONTROL_TYPE      = ScreenDetail.ControlType;
                dtoScreenDetail.ORIGINAL_TITLE    = ScreenDetail.ControlCaption;
                dtoScreenDetail.CRT_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                dtoScreenDetail.CRT_DATE.Value    = DateTime.Now;
                dtoScreenDetail.CRT_MACHINE.Value = Environment.MachineName;
                dtoScreenDetail.UPD_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                dtoScreenDetail.UPD_DATE.Value    = DateTime.Now;
                dtoScreenDetail.UPD_MACHINE.Value = Environment.MachineName;
                dtoScreenDetail.CONTROL_CD        = ScreenDetail.ControlCD;
                screenDetailDTOList.Add(dtoScreenDetail);

                if (langDTOList.Count > 0)
                {
                    foreach (LangDTO langdto in langDTOList)
                    {
                        ScreenDetailLangDTO dtoScreenDetailLang = new ScreenDetailLangDTO();
                        // add spread column to screen detail ms
                        dtoScreenDetailLang.SCREEN_CD         = ScreenDetail.ScreenCD;
                        dtoScreenDetailLang.CRT_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                        dtoScreenDetailLang.CRT_DATE.Value    = DateTime.Now;
                        dtoScreenDetailLang.CRT_MACHINE.Value = Environment.MachineName;
                        dtoScreenDetailLang.UPD_BY            = CommonLib.Common.CurrentUserInfomation.UserCD;
                        dtoScreenDetailLang.UPD_DATE.Value    = DateTime.Now;
                        dtoScreenDetailLang.UPD_MACHINE.Value = Environment.MachineName;
                        // add multilang for spread column
                        dtoScreenDetailLang.CONTROL_CD      = ScreenDetail.ControlCD;      //.Value = fpsspread.Name + ".Column[" + i.ToString() + "]";
                        dtoScreenDetailLang.CONTROL_CAPTION = ScreenDetail.ControlCaption; //.Value = fpsspread.Sheets[0].Columns[i].Label;
                        dtoScreenDetailLang.LANG_CD         = langdto.LANG_CD;
                        screenDetailLangDTOList.Add(dtoScreenDetailLang);
                    }
                }
            }
            #endregion

            ImportScreenBIZ bizImportScreen = new ImportScreenBIZ();
            bizImportScreen.ImportData(screenDTOList, screenLangDTOList, screenDetailDTOList, screenDetailLangDTOList);
        }