예제 #1
0
		private void butRunAllocatorTool_Click(object sender,EventArgs e) {
			if(!rbutIHaveRead.Checked) {
				PU.MB = Lan.g(this,"You must indicate that you have read the text in the box!");
				return;
			}

			if(MessageBox.Show("Do you want to run the batch allocation?","Please Respond",MessageBoxButtons.YesNo) == DialogResult.Yes) {
				FormWarnToCloseComputers fwc = new FormWarnToCloseComputers();
				if(fwc.ShowDialog() == DialogResult.Yes) {
					Reporting.Allocators.MyAllocator1_ProviderPayment allocator1 = new OpenDental.Reporting.Allocators.MyAllocator1_ProviderPayment();
					SecurityLogs.MakeLogEntry(OpenDentBusiness.Permissions.Setup,0,"Started Batch Allocation For Provider Allocation Tool");
					allocator1.StartBatchAllocation();
					SecurityLogs.MakeLogEntry(OpenDentBusiness.Permissions.Setup,0,"Finished Batch Allocation For Provider Allocation Tool");

					List<string> commands = new List<string>();
					if(!PrefC.ContainsKey(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun)) {
						commands.Add("INSERT INTO preference VALUES ('"
							+ MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun + "','0')");
					}
					if(!PrefC.ContainsKey(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use)) {
						commands.Add("INSERT INTO preference VALUES ('"
							+ MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use + "','0')");
					}
					if(commands.Count != 0) {
						Db.NonQOld(commands.ToArray());
						Cache.Refresh(InvalidType.Prefs);
					}
					Prefs.UpdateRaw(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun,"1");
					Prefs.UpdateRaw(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use,"1");
				}
			}
			RefreshForm();

		}
        private void butRunAllocatorTool_Click(object sender, EventArgs e)
        {
            if (!rbutIHaveRead.Checked)
            {
                PU.MB = Lan.g(this, "You must indicate that you have read the text in the box!");
                return;
            }

            if (MessageBox.Show("Do you want to run the batch allocation?", "Please Respond", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                FormWarnToCloseComputers fwc = new FormWarnToCloseComputers();
                if (fwc.ShowDialog() == DialogResult.Yes)
                {
                    Reporting.Allocators.MyAllocator1_ProviderPayment allocator1 = new OpenDental.Reporting.Allocators.MyAllocator1_ProviderPayment();
                    SecurityLogs.MakeLogEntry(OpenDentBusiness.Permissions.Setup, 0, "Started Batch Allocation For Provider Allocation Tool");
                    allocator1.StartBatchAllocation();
                    SecurityLogs.MakeLogEntry(OpenDentBusiness.Permissions.Setup, 0, "Finished Batch Allocation For Provider Allocation Tool");

                    List <string> commands = new List <string>();
                    if (!PrefC.ContainsKey(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun))
                    {
                        commands.Add("INSERT INTO preference VALUES ('"
                                     + MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun + "','0')");
                    }
                    if (!PrefC.ContainsKey(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use))
                    {
                        commands.Add("INSERT INTO preference VALUES ('"
                                     + MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use + "','0')");
                    }
                    if (commands.Count != 0)
                    {
                        Db.NonQOld(commands.ToArray());
                        Cache.Refresh(InvalidType.Prefs);
                    }
                    Prefs.UpdateRaw(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_ToolHasRun, "1");
                    Prefs.UpdateRaw(MyAllocator1_ProviderPayment.Pref_AllocatorProvider1_Use, "1");
                }
            }
            RefreshForm();
        }