Esempio n. 1
0
 private bool CheckUpdateLocation()
 {
     foreach (BL.Configuration.RegisteredCompany company in config.RegisteredCompanies)
     {
         //If there is and update and you are not logging into the Company set as update site then return
         if (company.UpdateSite == true && company.Name != config.RegisteredCompanies[grvCompany.FocusedRowHandle].Name)
         {
             return(BaseAlert.ShowAlert("Wrong Update Site", "You are logging into a site that has a update but is not the default update site.\n" +
                                        "Do you want to continue ?", BaseAlert.Buttons.OkCancel, BaseAlert.Icons.Warning) == System.Windows.Forms.DialogResult.OK);
         }
     }
     return(true);
 }
Esempio n. 2
0
        int SendMail(string strSubject, string strBody, int how)
        {
            MapiMessage msg = new MapiMessage();

            msg.subject  = strSubject;
            msg.noteText = strBody;

            msg.recips = GetRecipients(out msg.recipCount);
            msg.files  = GetAttachments(out msg.fileCount);

            m_lastError = MAPISendMail(new IntPtr(0), new IntPtr(0), msg, how,
                                       0);
            if (m_lastError > 1)
            {
                BaseAlert.ShowAlert("Mail send failure", GetLastError(), BaseAlert.Buttons.Ok, BaseAlert.Icons.Error);
            }

            Cleanup(ref msg);
            return(m_lastError);
        }
Esempio n. 3
0
        /// <summary>
        /// Checks if Code exists.
        /// </summary>
        /// <returns>Boolean values indicating weather conditions have been met.</returns>
        /// <remarks>Created: Werner Scheffer 23/05/2012</remarks>
        private bool IsCodeValid()
        {
            try
            {
                bool isValid = true;
                isValid = !DataContext.EntitySecurityContext.SEC_Role.Any(n => n.Id != ((DB.SEC_Role)BindingSource.DataSource).Id && n.Code == ((DB.SEC_Role)BindingSource.DataSource).Code);
                if (!isValid)
                {
                    BaseAlert.ShowAlert("Invalid Code", "The code you have entered already exists enter another Code.", BaseAlert.Buttons.Ok, BaseAlert.Icons.Error);
                }

                return(isValid);
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
                return(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnRemove_Click(object sender, EventArgs e)
        {
            try
            {
                if (BaseAlert.ShowAlert("Remove Company Connection", "You are about to permanently remove the selected Company Connection.\nAre you certain you wish to continue?", BaseAlert.Buttons.OkCancel, BaseAlert.Icons.Warning) == System.Windows.Forms.DialogResult.OK)
                {
                    Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
                    BL.Configuration.CompleteDistributionConfig section = config.GetSection("CompleteDistributionConfig") as BL.Configuration.CompleteDistributionConfig;

                    section.RegisteredCompanies.RemoveCompany(SelectedCompanyName);
                    config.Save(ConfigurationSaveMode.Modified);

                    // Refresh Connection list
                    Application.Restart();
                }
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }