示例#1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDunMessage.Text == "" && textMessageBold.Text == "" &&
         textEmailSubject.Text == "" && textEmailBody.Text == "")
     {
         MsgBox.Show(this, "All messages cannot be blank.");
         return;
     }
     if (listBillType.SelectedIndex == 0)
     {
         DunningCur.BillingType = 0;
     }
     else
     {
         DunningCur.BillingType = DefC.Short[(int)DefCat.BillingTypes][listBillType.SelectedIndex - 1].DefNum;
     }
     if (radioAny.Checked)
     {
         DunningCur.AgeAccount = 0;
     }
     else if (radio30.Checked)
     {
         DunningCur.AgeAccount = 30;
     }
     else if (radio60.Checked)
     {
         DunningCur.AgeAccount = 60;
     }
     else if (radio90.Checked)
     {
         DunningCur.AgeAccount = 90;
     }
     if (radioU.Checked)
     {
         DunningCur.InsIsPending = YN.Unknown;
     }
     else if (radioY.Checked)
     {
         DunningCur.InsIsPending = YN.Yes;
     }
     else if (radioN.Checked)
     {
         DunningCur.InsIsPending = YN.No;
     }
     DunningCur.DunMessage   = textDunMessage.Text;
     DunningCur.MessageBold  = textMessageBold.Text;
     DunningCur.EmailBody    = textEmailBody.Text;
     DunningCur.EmailSubject = textEmailSubject.Text;
     if (IsNew)
     {
         Dunnings.Insert(DunningCur);
     }
     else
     {
         Dunnings.Update(DunningCur);
     }
     DialogResult = DialogResult.OK;
 }
        private void FillDunning()
        {
            dunningList = Dunnings.Refresh();
            gridDun.BeginUpdate();
            gridDun.Columns.Clear();
            ODGridColumn col = new ODGridColumn("Billing Type", 100);

            gridDun.Columns.Add(col);
            col = new ODGridColumn("Aging", 70);
            gridDun.Columns.Add(col);
            col = new ODGridColumn("Ins", 40);
            gridDun.Columns.Add(col);
            col = new ODGridColumn("Message", 356);
            gridDun.Columns.Add(col);
            gridDun.Rows.Clear();
            OpenDental.UI.ODGridRow row;
            //string text;
            for (int i = 0; i < dunningList.Length; i++)
            {
                row = new OpenDental.UI.ODGridRow();
                if (dunningList[i].BillingType == 0)
                {
                    row.Cells.Add(Lan.g(this, "all"));
                }
                else
                {
                    row.Cells.Add(DefB.GetName(DefCat.BillingTypes, dunningList[i].BillingType));
                }
                if (dunningList[i].AgeAccount == 0)
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                else
                {
                    row.Cells.Add(Lan.g(this, "Over ") + dunningList[i].AgeAccount.ToString());
                }
                if (dunningList[i].InsIsPending == YN.Unknown)
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                else if (dunningList[i].InsIsPending == YN.Yes)
                {
                    row.Cells.Add(Lan.g(this, "Y"));
                }
                else if (dunningList[i].InsIsPending == YN.No)
                {
                    row.Cells.Add(Lan.g(this, "N"));
                }
                row.Cells.Add(dunningList[i].DunMessage);
                gridDun.Rows.Add(row);
            }
            gridDun.EndUpdate();
        }
示例#3
0
 private void butDelete_Click(object sender, System.EventArgs e)
 {
     if (IsNew)
     {
         DialogResult = DialogResult.Cancel;
     }
     else
     {
         Dunnings.Delete(DunningCur);
         DialogResult = DialogResult.OK;
     }
 }
示例#4
0
        private void butDuplicate_Click(object sender, EventArgs e)
        {
            if (gridDunning.SelectedIndices.Count() == 0)
            {
                MsgBox.Show(this, "Please select a message to duplicate first.");
                return;
            }
            Dunning dun = ((Dunning)gridDunning.ListGridRows[gridDunning.GetSelectedIndex()].Tag).Copy();

            Dunnings.Insert(dun);
            FillGrids(true);
            gridDunning.SetSelected(gridDunning.ListGridRows.OfType <GridRow>().ToList().FindIndex(x => ((Dunning)x.Tag).DunningNum == dun.DunningNum), true);
        }
示例#5
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDaysInAdvance.errorProvider1.GetError(textDaysInAdvance) != "")
     {
         MsgBox.Show(this, "Please fix data entry errors first.");
         return;
     }
     if (textDunMessage.Text == "" && textMessageBold.Text == "" &&
         textEmailSubject.Text == "" && textEmailBody.Text == "")
     {
         MsgBox.Show(this, "All messages cannot be blank.");
         return;
     }
     _dunningCur.BillingType = 0;
     if (listBillType.SelectedIndex > 0)
     {
         _dunningCur.BillingType = _listBillingTypeDefs[listBillType.SelectedIndex - 1].DefNum;
     }
     _dunningCur.AgeAccount   = (byte)(30 * new List <RadioButton> {
         radioAny, radio30, radio60, radio90
     }.FindIndex(x => x.Checked));                                                                                                      //0, 30, 60, or 90
     _dunningCur.InsIsPending = (YN) new List <RadioButton> {
         radioU, radioY, radioN
     }.FindIndex(x => x.Checked);            //0=Unknown, 1=Yes, 2=No
     _dunningCur.DaysInAdvance = 0;          //default will be 0
     if (!radioAny.Checked)
     {
         _dunningCur.DaysInAdvance = PIn.Int(textDaysInAdvance.Text);              //blank=0
     }
     _dunningCur.DunMessage    = textDunMessage.Text;
     _dunningCur.MessageBold   = textMessageBold.Text;
     _dunningCur.EmailBody     = textEmailBody.Text;
     _dunningCur.EmailSubject  = textEmailSubject.Text;
     _dunningCur.IsSuperFamily = checkSuperFamily.Checked;
     if (PrefC.HasClinicsEnabled)
     {
         _dunningCur.ClinicNum = _listClinics[comboClinics.SelectedIndex].ClinicNum;
     }
     if (IsNew)
     {
         Dunnings.Insert(_dunningCur);
     }
     else
     {
         Dunnings.Update(_dunningCur);
     }
     DialogResult = DialogResult.OK;
 }
示例#6
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     if (textDunMessage.Text == "")
     {
         MessageBox.Show(Lan.g(this, "Message cannot be blank."));
         return;
     }
     if (listBillType.SelectedIndex == 0)
     {
         DunningCur.BillingType = 0;
     }
     else
     {
         DunningCur.BillingType = DefB.Short[(int)DefCat.BillingTypes][listBillType.SelectedIndex - 1].DefNum;
     }
     if (radioAny.Checked)
     {
         DunningCur.AgeAccount = 0;
     }
     else if (radio30.Checked)
     {
         DunningCur.AgeAccount = 30;
     }
     else if (radio60.Checked)
     {
         DunningCur.AgeAccount = 60;
     }
     else if (radio90.Checked)
     {
         DunningCur.AgeAccount = 90;
     }
     if (radioU.Checked)
     {
         DunningCur.InsIsPending = YN.Unknown;
     }
     else if (radioY.Checked)
     {
         DunningCur.InsIsPending = YN.Yes;
     }
     else if (radioN.Checked)
     {
         DunningCur.InsIsPending = YN.No;
     }
     DunningCur.DunMessage = textDunMessage.Text;
     Dunnings.InsertOrUpdate(DunningCur, IsNew);
     DialogResult = DialogResult.OK;
 }
示例#7
0
        private void FillGrids(bool doRefreshList = false)
        {
            if (doRefreshList)
            {
                _listAllDunnings = Dunnings.Refresh(_listClinics.Select(x => x.ClinicNum).ToList());
            }
            List <Dunning> listSubDunnings = _listAllDunnings.FindAll(x => ValidateDunningFilters(x));

            if (!PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
            {
                listSubDunnings.RemoveAll(x => x.IsSuperFamily);
            }
            gridDunning.BeginUpdate();
            gridDunning.ListGridColumns.Clear();
            gridDunning.ListGridColumns.Add(new GridColumn("Billing Type", 80));
            gridDunning.ListGridColumns.Add(new GridColumn("Aging", 70));
            gridDunning.ListGridColumns.Add(new GridColumn("Ins", 40));
            gridDunning.ListGridColumns.Add(new GridColumn("Message", 150));
            gridDunning.ListGridColumns.Add(new GridColumn("Bold Message", 150));
            gridDunning.ListGridColumns.Add(new GridColumn("Email", 35, HorizontalAlignment.Center));
            if (PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
            {
                gridDunning.ListGridColumns.Add(new GridColumn("SF", 30, HorizontalAlignment.Center));
            }
            if (PrefC.HasClinicsEnabled)
            {
                gridDunning.ListGridColumns.Add(new GridColumn("Clinic", 50));
            }
            gridDunning.ListGridRows.Clear();
            GridRow row;

            foreach (Dunning dunnCur in listSubDunnings)
            {
                row = new GridRow();
                if (dunnCur.BillingType == 0)
                {
                    row.Cells.Add(Lan.g(this, "all"));
                }
                else
                {
                    row.Cells.Add(Defs.GetName(DefCat.BillingTypes, dunnCur.BillingType));
                }
                if (dunnCur.AgeAccount == 0)
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                else
                {
                    row.Cells.Add(Lan.g(this, "Over ") + dunnCur.AgeAccount.ToString());
                }
                if (dunnCur.InsIsPending == YN.Yes)
                {
                    row.Cells.Add(Lan.g(this, "Y"));
                }
                else if (dunnCur.InsIsPending == YN.No)
                {
                    row.Cells.Add(Lan.g(this, "N"));
                }
                else                  //YN.Unknown
                {
                    row.Cells.Add(Lan.g(this, "any"));
                }
                row.Cells.Add(dunnCur.DunMessage);
                row.Cells.Add(new GridCell(dunnCur.MessageBold)
                {
                    Bold = YN.Yes, ColorText = Color.DarkRed
                });
                row.Cells.Add((!string.IsNullOrEmpty(dunnCur.EmailBody) || !string.IsNullOrEmpty(dunnCur.EmailSubject))?"X":"");
                if (PrefC.GetBool(PrefName.ShowFeatureSuperfamilies))
                {
                    row.Cells.Add(dunnCur.IsSuperFamily?"X":"");
                }
                if (PrefC.HasClinicsEnabled)
                {
                    row.Cells.Add(_listClinics.Find(x => x.ClinicNum == dunnCur.ClinicNum)?.Abbr ?? "");
                }
                row.Tag = dunnCur;
                gridDunning.ListGridRows.Add(row);
            }
            gridDunning.EndUpdate();
        }