예제 #1
0
        static void Main()
        {
            Process currentProcess = Process.GetCurrentProcess();
            currentProcess.PriorityClass = ProcessPriorityClass.RealTime;
            //System.Threading.Thread.CurrentThread.CurrentCulture =
            //    new System.Globalization.CultureInfo("sv-SE");

            //System.Threading.Thread.CurrentThread.CurrentUICulture =
            //    new System.Globalization.CultureInfo("sv-SE");

            //AppDomain currentDomain = default(AppDomain);
            //currentDomain = AppDomain.CurrentDomain;
            //// Handler for unhandled exceptions.
            //currentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
            //currentDomain.FirstChanceException += currentDomain_FirstChanceException;
            //currentDomain.ProcessExit += currentDomain_ProcessExit;
            //// Handler for exceptions in threads behind forms.
            //System.Windows.Forms.Application.ThreadException += GlobalThreadExceptionHandler;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new FrmDemo());

            // uncomment to apply skin
            //DevExpress.UserSkins.BonusSkins.Register();
            //DevExpress.UserSkins.OfficeSkins.Register();
            //DevExpress.Skins.SkinManager.EnableFormSkins();
            //Application.Run(new Forms.FrmCampaignBooking(null,null));

            //check for updates
            //System.Timers.Timer aTimer = new System.Timers.Timer();
            //aTimer.Elapsed += new System.Timers.ElapsedEventHandler(aTimer_Elapsed);
            //aTimer.Interval = 5000; // 300000; //5 minutes
            //----------
            try
            {
                BrightSalesFacade.Logger.SoftwareVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
                BrightSalesFacade.Logger.SendInfo("startup_bs", "starting brightsales");
                FrmAppUpdater updater = new FrmAppUpdater();
                if (updater.HasNewUpdate)
                {
                    //aTimer.Enabled = false;
                    updater.ShowDialog();
                }
                else
                {
                    //aTimer.Enabled = true;
                    var controller = new FrmSalesConsultant();
                    EventQueue.Instance.SetController(controller);
                    Application.Run(controller);
                }
                BrightSalesFacade.Logger.SendInfo("close_bs", "starting brightsales");
            }
            catch (Exception ex)
            {
                //BrightSalesFacade.Logger.Error("app_exception", "", ex);
                (new BrightVision.Common.Utilities.RaygunClientLogger()).Send(ex);
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }
            //------------
        }
예제 #2
0
 public void SetController(object objForm)
 {
     Controller = (FrmSalesConsultant) objForm;
 }
예제 #3
0
 public void UpdateSpecificCompany(FrmSalesConsultant.StatusArgs pArgs)
 {
     try {
         int _AcctId = 0;
         if (pArgs != null) {
             for (int i = 0; i < gvCampaignList.RowCount; i++) {
                 _AcctId = ValidationUtility.TryParseInt(gvCampaignList.GetRowCellValue(m_CampaignListSelectedRow, "account_id").ToString());
                 if (_AcctId == pArgs.CompanyId) {
                     gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Status", pArgs.CompanyStatus);
                     gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Last_Contact", pArgs.CompanyLastContact.ToShortDateString());
                     gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Last_User", pArgs.CompanyLastUser);
                     gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Lead_Status", pArgs.CompanyLeadStatus);
                     break;
                 }
             }
         }
         else {
             _AcctId = ValidationUtility.TryParseInt(gvCampaignList.GetRowCellValue(m_CampaignListSelectedRow, "account_id").ToString());
             BrightPlatformEntities _efDbContext = new BrightPlatformEntities(UserSession.EntityConnection);
             int _FinalListId = _efDbContext.final_lists.FirstOrDefault(i => i.sub_campaign_id == SubCampaignId).id;
             //sub_campaign_account_appointments _item = _efDbContext.sub_campaign_account_appointments.FirstOrDefault(i =>
             //    i.final_list_id == _FinalListId &&
             //    i.account_id == _AcctId
             //);
             sub_campaign_account_appointments _item = ObjectSubCampaign.SaveSubCampaignCompanyAppointmentStatus(_AcctId, _FinalListId, "Open", null);
             if (_item != null) {
                 gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Status", _item.status);
                 gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Last_Contact", _item.last_contact.ToShortDateString());
                 gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Last_User", UserSession.CurrentUser.UserFullName);
                 gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Lead_Status", _item.lead_status);
             }
         }
     }
     catch (Exception e) {
         m_EventBus.Notify(new FrmSalesConsultantEvents.Tracer() {
             ErrorMessage = e.Message
         });
     }
 }