コード例 #1
0
 private void btnExport_Click(object sender, EventArgs e)
 {
     try
     {
         var expColInfo = SysvarUtils.GetVarValue(SYSVAR.GRNAME_SYS, SYSVAR.VARNAME_EXPORT_BY_COLUMN);
         if (expColInfo == CONSTANTS.Yes)
         {
             var ucColumnEx = (ucColumnExport)FIS.AppClient.Utils.MainProcess.CreateModuleInstance("CLEXP");
             ucColumnEx.gcMain = gcMain;
             ucColumnEx.MID    = ModuleInfo.ModuleID;
             ucColumnEx.LastSearchResultKey = BufferResult.LastSearchResultKey;
             ucColumnEx.LastSearchTime      = BufferResult.LastSearchTime;
             var groupColumnFieldSupportedModule = this as IGroupColumnFieldSupportedModule;
             if (groupColumnFieldSupportedModule.GroupLayoutStoredData != null)
             {
                 var sr         = new StringReader(groupColumnFieldSupportedModule.GroupLayoutStoredData);
                 var serializer = new XmlSerializer(typeof(List <string[]>));
                 var listLayout = (List <string[]>)serializer.Deserialize(sr);
                 ucColumnEx.listLayout = listLayout;
                 ucColumnEx.Bands      = Bands;
             }
             ucColumnEx.ShowDialogModule(this);
         }
         else
         {
             var expInfo    = SysvarUtils.GetVarValue(SYSVAR.GRNAME_SYS, SYSVAR.VARNAME_EXPORT);
             var exportInfo = ModuleUtils.GetModuleInfo(ModuleInfo.ModuleID, CODES.DEFMOD.SUBMOD.SEARCH_EXPORT);
             var ucExport   = (ucSearchExport)MainProcess.CreateModuleInstance(exportInfo.ModuleID, exportInfo.SubModule, "CALL_MODULE");
             if (expInfo == CONSTANTS.Yes)
             {
                 ucExport.LastSearchResultKey = BufferResult.LastSearchResultKey;
                 ucExport.LastSearchTime      = BufferResult.LastSearchTime;
                 ucExport.PrintGrid           = gcMain;
                 ucExport.ShowDialogModule(this);
             }
             else
             {
                 var saveDialog = new SaveFileDialog
                 {
                     Filter = IMPORTMASTER.EXPORT_FILE_EXTENSIONS
                 };
                 if (saveDialog.ShowDialog() == DialogResult.OK)
                 {
                     ucExport.FileName            = saveDialog.FileName;
                     ucExport.LastSearchResultKey = BufferResult.LastSearchResultKey;
                     ucExport.LastSearchTime      = BufferResult.LastSearchTime;
                     ucExport.PrintGrid           = gcMain;
                     ucExport.Execute();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         ShowError(ex);
     }
 }
コード例 #2
0
        public frmAddIn()
        {
            InitializeComponent();
            using (var ctrlSA = new SAController())
            {
                User userInfo = new User();
                ctrlSA.GetSessionUserInfo(out userInfo);
                List <string> users = new List <string>();
                users.Add(userInfo.Username);

                DataContainer dc;
                ctrlSA.ExecuteProcedureFillDataset(out dc, "SP_GET_PASS_BY_USER", users);
                DataTable dt = dc.DataTable;
                if (dt.Rows.Count > 0)
                {
                    string strUserName = ""; //= EnCryptDecryptLibrary.CryptorEngine.Encrypt(userInfo.Username, true);
                    string strPassword = ""; //= EnCryptDecryptLibrary.CryptorEngine.Encrypt(dt.Rows[0][0].ToString(), true);
                    string sUrl        = SysvarUtils.GetVarValue(SYSVAR.GRNAME_SYS, SYSVAR.VARNAME_LINKNDTNN);
                    sUrl = string.Format(sUrl, strUserName, strPassword);
                    wbNDTNN.Navigate(sUrl);
                }
            }
        }