///<summary></summary> public static void Insert(ProcedureCode code) { //must have already checked ADACode for nonduplicate. string command = "INSERT INTO procedurecode (adacode,descript,abbrdesc," + "proctime,proccat,treatarea,RemoveTooth,setrecall," + "nobillins,isprosth,defaultnote,ishygiene,gtypenum,alternatecode1,MedicalCode,IsTaxed," + "PaintType,GraphicColor,LaymanTerm,IsCanadianLab) VALUES(" + "'" + POut.PString(code.ADACode) + "', " + "'" + POut.PString(code.Descript) + "', " + "'" + POut.PString(code.AbbrDesc) + "', " + "'" + POut.PString(code.ProcTime) + "', " + "'" + POut.PInt(code.ProcCat) + "', " + "'" + POut.PInt((int)code.TreatArea) + "', " + "'0', " //No longer used, but remains part of the table so that ordinal values are not upset. //The value is set to 0 here, so that conversion to extraction paint type is not necessary. + "'" + POut.PBool(code.SetRecall) + "', " + "'" + POut.PBool(code.NoBillIns) + "', " + "'" + POut.PBool(code.IsProsth) + "', " + "'" + POut.PString(code.DefaultNote) + "', " + "'" + POut.PBool(code.IsHygiene) + "', " + "'" + POut.PInt(code.GTypeNum) + "', " + "'" + POut.PString(code.AlternateCode1) + "', " + "'" + POut.PString(code.MedicalCode) + "', " + "'" + POut.PBool(code.IsTaxed) + "', " + "'" + POut.PInt((int)code.PaintType) + "', " + "'" + POut.PInt(code.GraphicColor.ToArgb()) + "', " + "'" + POut.PString(code.LaymanTerm) + "', " + "'" + POut.PBool(code.IsCanadianLab) + "')"; General.NonQ(command); ProcedureCodes.Refresh(); //Cur already set //MessageBox.Show(Cur.PayNum.ToString()); }
private void butEditFeeSched_Click(object sender, System.EventArgs e) { //won't even be visible if no permission int selectedSched = 0; if (listFeeSched.SelectedIndex != -1) { selectedSched = DefB.Short[(int)DefCat.FeeSchedNames][listFeeSched.SelectedIndex].DefNum; } FormDefinitions FormD = new FormDefinitions(DefCat.FeeSchedNames); FormD.ShowDialog(); DataValid.SetInvalid(InvalidTypes.Defs | InvalidTypes.Fees); Fees.Refresh(); ProcedureCodes.Refresh(); changed = true; FillFeeSchedules(); for (int i = 0; i < DefB.Short[(int)DefCat.FeeSchedNames].Length; i++) { if (DefB.Short[(int)DefCat.FeeSchedNames][i].DefNum == selectedSched) { listFeeSched.SelectedIndex = i; } } FillGrid(); SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Definitions"); //FillGrid();//will be done automatically because of lines above }
private void FormProcCodeNew_Load(object sender, EventArgs e) { ProcedureCodes.Refresh(); listType.Items.Add(Lan.g(this, "none")); listType.Items.Add(Lan.g(this, "Exam")); listType.Items.Add(Lan.g(this, "Xray")); listType.Items.Add(Lan.g(this, "Prophy")); listType.Items.Add(Lan.g(this, "Fluoride")); listType.Items.Add(Lan.g(this, "Sealant")); listType.Items.Add(Lan.g(this, "Amalgam")); listType.Items.Add(Lan.g(this, "Composite, Anterior")); listType.Items.Add(Lan.g(this, "Composite, Posterior")); listType.Items.Add(Lan.g(this, "Buildup/Post")); listType.Items.Add(Lan.g(this, "Pulpotomy")); listType.Items.Add(Lan.g(this, "RCT")); listType.Items.Add(Lan.g(this, "SRP")); listType.Items.Add(Lan.g(this, "Denture")); listType.Items.Add(Lan.g(this, "RPD")); listType.Items.Add(Lan.g(this, "Denture Repair")); listType.Items.Add(Lan.g(this, "Reline")); listType.Items.Add(Lan.g(this, "Ceramic Inlay")); listType.Items.Add(Lan.g(this, "Metallic Inlay")); listType.Items.Add(Lan.g(this, "Whitening")); listType.Items.Add(Lan.g(this, "All-Ceramic Crown")); listType.Items.Add(Lan.g(this, "PFM Crown")); listType.Items.Add(Lan.g(this, "Full Gold Crown")); listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Ceramic")); listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - PFM")); listType.Items.Add(Lan.g(this, "Bridge Pontic or Retainer - Metal")); listType.Items.Add(Lan.g(this, "Extraction")); listType.Items.Add(Lan.g(this, "Ortho")); listType.Items.Add(Lan.g(this, "Nitrous")); listType.SelectedIndex = 0; for (int i = 0; i < Enum.GetNames(typeof(ToothPaintingType)).Length; i++) { comboPaintType.Items.Add(Enum.GetNames(typeof(ToothPaintingType))[i]); } comboPaintType.SelectedIndex = (int)ToothPaintingType.None; for (int i = 1; i < Enum.GetNames(typeof(TreatmentArea)).Length; i++) { comboTreatArea.Items.Add(Lan.g(this, Enum.GetNames(typeof(TreatmentArea))[i])); } comboTreatArea.SelectedIndex = (int)TreatmentArea.Mouth - 1; for (int i = 0; i < DefB.Short[(int)DefCat.ProcCodeCats].Length; i++) { comboCategory.Items.Add(DefB.Short[(int)DefCat.ProcCodeCats][i].ItemName); } comboCategory.SelectedIndex = 0; textNewCode.Focus(); textNewCode.Select(textNewCode.Text.Length, 1); }
private void butTools_Click(object sender, System.EventArgs e) { FormFeeSchedTools FormF = new FormFeeSchedTools(DefB.Short[(int)DefCat.FeeSchedNames][listFeeSched.SelectedIndex].DefNum); FormF.ShowDialog(); if (FormF.DialogResult == DialogResult.Cancel) { return; } Fees.Refresh(); ProcedureCodes.Refresh(); changed = true; FillGrid(); SecurityLogs.MakeLogEntry(Permissions.Setup, 0, "Fee Schedule Tools"); }
private void butAnother_Click(object sender, EventArgs e) { string previous = textNewCode.Text; if (AddProc()) { ProcedureCodes.Refresh(); if (CultureInfo.CurrentCulture.Name == "en-US" && listType.SelectedIndex != 0) { textNewCode.Text = "D"; } else { textNewCode.Text = ""; } textCodePrevious.Text = previous; } textNewCode.Focus(); textNewCode.Select(textNewCode.Text.Length, 1); }
private void butDownloadClaimform_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; //Application.DoEvents(); string remoteUri = textWebsitePath.Text + textRegClaimform.Text + "/"; WebRequest wr; WebResponse webResp; //int fileSize; //copy image file------------------------------------------------------------------------------- if (BackgroundImg != "") { myStringWebResource = remoteUri + BackgroundImg; WriteToFile = PrefB.GetString("DocPath") + BackgroundImg; if (File.Exists(WriteToFile)) { File.Delete(WriteToFile); } wr = WebRequest.Create(myStringWebResource); int fileSize; try{ webResp = wr.GetResponse(); fileSize = (int)webResp.ContentLength / 1024; } catch (Exception ex) { Cursor = Cursors.Default; MessageBox.Show("Error downloading " + BackgroundImg + ". " + ex.Message); return; //fileSize=0; } if (fileSize > 0) { //start the thread that will perform the download Thread workerThread = new Thread(new ThreadStart(InstanceMethod)); workerThread.Start(); //display the progress dialog to the user: FormP = new FormProgress(); FormP.MaxVal = (double)fileSize / 1024; FormP.NumberMultiplication = 100; FormP.DisplayText = "?currentVal MB of ?maxVal MB copied"; FormP.NumberFormat = "F"; FormP.ShowDialog(); if (FormP.DialogResult == DialogResult.Cancel) { workerThread.Abort(); Cursor = Cursors.Default; return; } MsgBox.Show(this, "Image file downloaded successfully."); } } Cursor = Cursors.WaitCursor; //have to do this again for some reason. //Import ClaimForm.xml---------------------------------------------------------------------------------- myStringWebResource = remoteUri + "ClaimForm.xml"; WriteToFile = PrefB.GetString("DocPath") + "ClaimForm.xml"; if (File.Exists(WriteToFile)) { File.Delete(WriteToFile); } try{ InstanceMethod(); } catch { } int rowsAffected; if (File.Exists(WriteToFile)) { int newclaimformnum = 0; try{ newclaimformnum = FormClaimForms.ImportForm(WriteToFile, true); } catch (ApplicationException ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); return; } finally{ File.Delete(WriteToFile); } if (newclaimformnum != 0) { Prefs.UpdateInt("DefaultClaimForm", newclaimformnum); } //switch all insplans over to new claimform ClaimForm oldform = null; for (int i = 0; i < ClaimForms.ListLong.Length; i++) { if (ClaimForms.ListLong[i].UniqueID == OldClaimFormID) { oldform = ClaimForms.ListLong[i]; } } if (oldform != null) { rowsAffected = InsPlans.ConvertToNewClaimform(oldform.ClaimFormNum, newclaimformnum); MessageBox.Show("Number of insurance plans changed to new form: " + rowsAffected.ToString()); } DataValid.SetInvalid(InvalidTypes.ClaimForms | InvalidTypes.Prefs); } //Import ProcCodes.xml------------------------------------------------------------------------------------ myStringWebResource = remoteUri + "ProcCodes.xml"; WriteToFile = PrefB.GetString("DocPath") + "ProcCodes.xml"; if (File.Exists(WriteToFile)) { File.Delete(WriteToFile); } try { InstanceMethod(); } catch { } if (File.Exists(WriteToFile)) { //move T codes over to a new "Obsolete" category which is hidden ProcedureCodes.TcodesMove(); rowsAffected = 0; try { rowsAffected = FormProcCodes.ImportProcCodes(WriteToFile, false); } catch (ApplicationException ex) { Cursor = Cursors.Default; MessageBox.Show(ex.Message); return; } finally { File.Delete(WriteToFile); } ProcedureCodes.Refresh(); //? MessageBox.Show("Procedure codes inserted: " + rowsAffected.ToString()); //Change all procbuttons and autocodes from T to D. ProcedureCodes.TcodesAlter(); DataValid.SetInvalid(InvalidTypes.AutoCodes | InvalidTypes.Defs | InvalidTypes.ProcCodes | InvalidTypes.ProcButtons); } MsgBox.Show(this, "Done"); Cursor = Cursors.Default; }