Пример #1
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (textFee.errorProvider1.GetError(textFee) != "")
            {
                MessageBox.Show(Lan.g(this, "Please fix data entry error first."));
                return;
            }
            DateTime datePrevious = FeeCur.SecDateTEdit;

            if (textFee.Text == "")
            {
                Fees.Delete(FeeCur);
            }
            else
            {
                FeeCur.Amount = PIn.Double(textFee.Text);
                //Fee object always created and inserted externally first
                Fees.Update(FeeCur);
            }
            SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, Lan.g(this, "Procedure") + ": " + ProcedureCodes.GetStringProcCode(FeeCur.CodeNum)
                                      + ", " + Lan.g(this, "Fee: ") + "" + FeeCur.Amount.ToString("c") + ", " + Lan.g(this, "Fee Schedule") + ": " + FeeScheds.GetDescription(FeeCur.FeeSched)
                                      + ". " + Lan.g(this, "Manual edit in Edit Fee window."), FeeCur.CodeNum, DateTime.MinValue);
            SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, Lan.g(this, "Fee Updated"), FeeCur.FeeNum, datePrevious);
            //FeeCur.UseDefaultCov=checkDefCov.Checked;
            //FeeCur.UseDefaultFee=checkDefFee.Checked;
            DialogResult = DialogResult.OK;
        }
Пример #2
0
 private void FormFeeEdit_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         return;
     }
     if (IsNew)
     {
         Fees.Delete(FeeCur);
     }
 }
Пример #3
0
 private void FormFeeEdit_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (DialogResult == DialogResult.OK)
     {
         Signalods.SetInvalid(InvalidType.Fees, KeyType.FeeSched, FeeCur.FeeSched);
         return;
     }
     if (IsNew)
     {
         Fees.Delete(FeeCur);
     }
 }
Пример #4
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textFee.errorProvider1.GetError(textFee) != "")
     {
         MessageBox.Show(Lan.g(this, "Please fix data entry error first."));
         return;
     }
     if (textFee.Text == "")
     {
         Fees.Delete(FeeCur);
     }
     else
     {
         FeeCur.Amount = PIn.Double(textFee.Text);
         //Fee object always created and inserted externally first
         Fees.Update(FeeCur);
     }
     //FeeCur.UseDefaultCov=checkDefCov.Checked;
     //FeeCur.UseDefaultFee=checkDefFee.Checked;
     DialogResult = DialogResult.OK;
 }
Пример #5
0
        ///<summary></summary>
        public static void ImportFees(string fileName, long feeSchedNum, long clinicNum, long provNum)
        {
            List <Fee> listFees = Fees.GetListExact(feeSchedNum, clinicNum, provNum);

            string[] fields;
            int      counter   = 0;
            int      lineCount = File.ReadAllLines(fileName).Length;     //quick and dirty

            using (StreamReader sr = new StreamReader(fileName)) {
                string line = sr.ReadLine();
                while (line != null)
                {
                    fields = line.Split(new string[1] {
                        "\t"
                    }, StringSplitOptions.None);
                    if (fields.Length < 2)                  // && fields[1]!=""){//we no longer skip blank fees
                    {
                        line = sr.ReadLine();
                        continue;
                    }
                    long codeNum = ProcedureCodes.GetCodeNum(fields[0]);
                    if (codeNum == 0)
                    {
                        line = sr.ReadLine();
                        continue;
                    }
                    Fee      fee          = Fees.GetFee(codeNum, feeSchedNum, clinicNum, provNum, listFees);
                    string   feeOldStr    = "";
                    DateTime datePrevious = DateTime.MinValue;
                    if (fee != null)
                    {
                        feeOldStr    = "Old Fee: " + fee.Amount.ToString("c") + ", ";
                        datePrevious = fee.SecDateTEdit;
                    }
                    if (fields[1] == "")                   //an empty entry will delete an existing fee, but not insert a blank override
                    {
                        if (fee == null)                   //nothing to do
                        //counter++;
                        //line=sr.ReadLine();
                        //continue;
                        {
                        }
                        else
                        {
                            //doesn't matter if the existing fee is an override or not.
                            Fees.Delete(fee);
                            SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, "Procedure: " + fields[0] + ", "
                                                      + feeOldStr
                                                      //+", Deleted Fee: "+fee.Amount.ToString("c")+", "
                                                      + "Fee Schedule: " + FeeScheds.GetDescription(feeSchedNum) + ". "
                                                      + "Fee deleted using the Import button in the Fee Tools window.", codeNum,
                                                      DateTime.MinValue);
                            SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, "Fee deleted", fee.FeeNum, datePrevious);
                        }
                    }
                    else                      //value found
                    {
                        if (fee == null)      //no current fee
                        {
                            fee           = new Fee();
                            fee.Amount    = PIn.Double(fields[1]);
                            fee.FeeSched  = feeSchedNum;
                            fee.CodeNum   = codeNum;
                            fee.ClinicNum = clinicNum;                          //Either 0 because you're importing on an HQ schedule or local clinic because the feesched is localizable.
                            fee.ProvNum   = provNum;
                            Fees.Insert(fee);
                        }
                        else
                        {
                            fee.Amount = PIn.Double(fields[1]);
                            Fees.Update(fee);
                        }
                        SecurityLogs.MakeLogEntry(Permissions.ProcFeeEdit, 0, "Procedure: " + fields[0] + ", "
                                                  + feeOldStr
                                                  + ", New Fee: " + fee.Amount.ToString("c") + ", "
                                                  + "Fee Schedule: " + FeeScheds.GetDescription(feeSchedNum) + ". "
                                                  + "Fee changed using the Import button in the Fee Tools window.", codeNum,
                                                  DateTime.MinValue);
                        SecurityLogs.MakeLogEntry(Permissions.LogFeeEdit, 0, "Fee changed", fee.FeeNum, datePrevious);
                    }
                    //FeeSchedEvent.Fire(ODEventType.FeeSched,new ProgressBarHelper("Importing fees...",));
                    double percent = (double)counter * 100d / (double)lineCount;
                    counter++;
                    FeeSchedEvent.Fire(ODEventType.FeeSched, new ProgressBarHelper(
                                           "Importing fees...", ((int)percent).ToString(), blockValue: (int)percent, progressStyle: ProgBarStyle.Continuous));
                    line = sr.ReadLine();
                }
            }
        }