コード例 #1
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     FormReportForRdl FormR=new FormReportForRdl();
     string s=Properties.Resources.ReportAccountingBalanceSheet;
     s=s.Replace("12/31/2007",date1.SelectionStart.ToShortDateString());
     s=s.Replace("2007-12-31",POut.Date(date1.SelectionStart,false));
     FormR.SourceRdlString=s;
     FormR.ShowDialog();
     DialogResult=DialogResult.OK;
 }
コード例 #2
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            FormReportForRdl FormR = new FormReportForRdl();
            string           s     = Properties.Resources.ReportAccountingBalanceSheet;

            s = s.Replace("12/31/2007", date1.SelectionStart.ToShortDateString());
            s = s.Replace("2007-12-31", POut.Date(date1.SelectionStart, false));
            FormR.SourceRdlString = s;
            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
コード例 #3
0
 private void butOK_Click(object sender, System.EventArgs e)
 {
     FormReportForRdl FormR=new FormReportForRdl();
     string s=Properties.Resources.ReportAccountingGenLedger;
     s=s.Replace("1/1/2007 - 12/31/2007",date1.SelectionStart.ToShortDateString()+" - "+date2.SelectionStart.ToShortDateString());
     s=s.Replace("2007-01-01",POut.Date(date1.SelectionStart,false));
     s=s.Replace("2007-12-31",POut.Date(date2.SelectionStart,false));
     s=s.Replace("2006-12-31",POut.Date(date1.SelectionStart.AddDays(-1),false));
     FormR.SourceRdlString=s;
     FormR.ShowDialog();
     DialogResult=DialogResult.OK;
 }
コード例 #4
0
        private void butOK_Click(object sender, System.EventArgs e)
        {
            FormReportForRdl FormR = new FormReportForRdl();
            string           s     = Properties.Resources.ReportAccountingGenLedger;

            s = s.Replace("1/1/2007 - 12/31/2007", date1.SelectionStart.ToShortDateString() + " - " + date2.SelectionStart.ToShortDateString());
            s = s.Replace("2007-01-01", POut.Date(date1.SelectionStart, false));
            s = s.Replace("2007-12-31", POut.Date(date2.SelectionStart, false));
            s = s.Replace("2006-12-31", POut.Date(date1.SelectionStart.AddDays(-1), false));
            FormR.SourceRdlString = s;
            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
コード例 #5
0
ファイル: FormRpPaySheet.cs プロジェクト: nampn/ODental
        private void butOK_Click(object sender, System.EventArgs e)
        {
            if (!checkAllProv.Checked && listProv.SelectedIndices.Count == 0)
            {
                MsgBox.Show(this, "At least one provider must be selected.");
                return;
            }
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                if (!checkAllClin.Checked && listClin.SelectedIndices.Count == 0)
                {
                    MsgBox.Show(this, "At least one clinic must be selected.");
                    return;
                }
            }
            if (!checkAllTypes.Checked && listTypes.SelectedIndices.Count == 0 && !checkIns.Checked)
            {
                MsgBox.Show(this, "At least one type must be selected.");
                return;
            }
            string whereProv = "";

            if (!checkAllProv.Checked)
            {
                for (int i = 0; i < listProv.SelectedIndices.Count; i++)
                {
                    if (i == 0)
                    {
                        whereProv += " AND (";
                    }
                    else
                    {
                        whereProv += "OR ";
                    }
                    whereProv += "claimproc.ProvNum = " + POut.Long(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum) + " ";
                }
                whereProv += ") ";
            }
            string whereClin = "";

            if (!checkAllClin.Checked)
            {
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (i == 0)
                    {
                        whereClin += " AND (";
                    }
                    else
                    {
                        whereClin += "OR ";
                    }
                    if (listClin.SelectedIndices[i] == 0)
                    {
                        whereClin += "claimproc.ClinicNum = 0 ";
                    }
                    else
                    {
                        whereClin += "claimproc.ClinicNum = " + POut.Long(Clinics.List[listClin.SelectedIndices[i] - 1].ClinicNum) + " ";
                    }
                }
                whereClin += ") ";
            }
            string queryIns =
                @"SELECT CONVERT(" + DbHelper.DateFormatColumn("claimproc.DateCP", "%c/%d/%Y") + ",CHAR(25)) DateCP,MAX("
                + DbHelper.Concat("patient.LName", "', '", "patient.FName", "' '", "patient.MiddleI") + @") lfname,
carrier.CarrierName,provider.Abbr,
clinic.Description clinicDesc,
claimpayment.CheckNum,FORMAT(SUM(claimproc.InsPayAmt),2) amt,claimproc.ClaimNum 
FROM claimproc
LEFT JOIN insplan ON claimproc.PlanNum = insplan.PlanNum 
LEFT JOIN patient ON claimproc.PatNum = patient.PatNum
LEFT JOIN carrier ON carrier.CarrierNum = insplan.CarrierNum
LEFT JOIN provider ON provider.ProvNum=claimproc.ProvNum
LEFT JOIN claimpayment ON claimproc.ClaimPaymentNum = claimpayment.ClaimPaymentNum
LEFT JOIN clinic ON clinic.ClinicNum=claimproc.ClinicNum
WHERE (claimproc.Status=1 OR claimproc.Status=4) "//received or supplemental
                + whereProv
                + whereClin
                + "AND claimpayment.CheckDate >= " + POut.Date(date1.SelectionStart) + " "
                + "AND claimpayment.CheckDate <= " + POut.Date(date2.SelectionStart) + " "
                + @"GROUP BY CONVERT(" + DbHelper.DateFormatColumn("claimproc.DateCP", "%c/%d/%Y") + @",CHAR(25)),
claimproc.ClaimPaymentNum,provider.ProvNum,
claimproc.ClinicNum,carrier.CarrierName,provider.Abbr,
clinic.Description,claimpayment.CheckNum";

            if (radioPatient.Checked)
            {
                queryIns += ",patient.PatNum";
            }
            queryIns += " ORDER BY claimproc.DateCP,lfname";
            if (!checkIns.Checked)
            {
                queryIns = DbHelper.LimitOrderBy(queryIns, 0);
            }
            //patient payments-----------------------------------------------------------------------------------------
            whereProv = "";
            if (!checkAllProv.Checked)
            {
                for (int i = 0; i < listProv.SelectedIndices.Count; i++)
                {
                    if (i == 0)
                    {
                        whereProv += " AND (";
                    }
                    else
                    {
                        whereProv += "OR ";
                    }
                    whereProv += "paysplit.ProvNum = " + POut.Long(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum) + " ";
                }
                whereProv += ") ";
            }
            whereClin = "";
            if (!checkAllClin.Checked)
            {
                for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                {
                    if (i == 0)
                    {
                        whereClin += " AND (";
                    }
                    else
                    {
                        whereClin += "OR ";
                    }
                    if (listClin.SelectedIndices[i] == 0)
                    {
                        whereClin += "payment.ClinicNum = 0 ";
                    }
                    else
                    {
                        whereClin += "payment.ClinicNum = " + POut.Long(Clinics.List[listClin.SelectedIndices[i] - 1].ClinicNum) + " ";
                    }
                }
                whereClin += ") ";
            }
            string queryPat =
                @"SELECT CONVERT(" + DbHelper.DateFormatColumn("payment.PayDate", "%c/%d/%Y") + ",CHAR(25)) AS DatePay,MAX("
                + DbHelper.Concat("patient.LName", "', '", "patient.FName", "' '", "patient.MiddleI") + @") AS lfname,
payment.PayType,provider.Abbr,
clinic.Description clinicDesc,
payment.CheckNum,
FORMAT(SUM(paysplit.SplitAmt),2) amt, payment.PayNum,ItemName 
FROM payment
LEFT JOIN paysplit ON payment.PayNum=paysplit.PayNum
LEFT JOIN patient ON payment.PatNum=patient.PatNum
LEFT JOIN provider ON paysplit.ProvNum=provider.ProvNum
LEFT JOIN definition ON payment.PayType=definition.DefNum 
LEFT JOIN clinic ON payment.ClinicNum=clinic.ClinicNum
WHERE 1 "
                + whereProv
                + whereClin
                + "AND paysplit.DatePay >= " + POut.Date(date1.SelectionStart) + " "
                + "AND paysplit.DatePay <= " + POut.Date(date2.SelectionStart) + " ";

            if (listTypes.SelectedIndices.Count > 0)
            {
                queryPat += "AND (";
                for (int i = 0; i < listTypes.SelectedIndices.Count; i++)
                {
                    if (i > 0)
                    {
                        queryPat += "OR ";
                    }
                    queryPat += "payment.PayType = " + POut.Long(DefC.Short[(int)DefCat.PaymentTypes][listTypes.SelectedIndices[i]].DefNum) + " ";
                }
                queryPat += ") ";
            }
            queryPat += @"GROUP BY "
                        + "payment.PayNum,payment.PayDate,provider.ProvNum,payment.ClinicNum"
                        + ",provider.Abbr,clinic.Description,payment.CheckNum,definition.ItemName";
            if (radioPatient.Checked)
            {
                queryPat += ",patient.PatNum";
            }
            queryPat += " ORDER BY paysplit.DatePay,lfname";
            if (!checkAllTypes.Checked && listTypes.SelectedIndices.Count == 0)
            {
                queryPat = DbHelper.LimitOrderBy(queryPat, 0);
            }
            DataTable tableIns  = Reports.GetTable(queryIns);
            DataTable tablePat  = Reports.GetTable(queryPat);
            DataTable tablePref = Reports.GetTable("SELECT ValueString FROM preference WHERE PrefName='PracticeTitle'");
            DataRow   row       = tablePref.NewRow();

            if (checkAllProv.Checked)
            {
                row[0] = Lan.g(this, "All Providers");
            }
            else
            {
                string provNames = "";
                for (int i = 0; i < listProv.SelectedIndices.Count; i++)
                {
                    if (i > 0)
                    {
                        provNames += ", ";
                    }
                    provNames += ProviderC.ListShort[listProv.SelectedIndices[i]].Abbr;
                }
                row[0] = provNames;
            }
            tablePref.Rows.Add(row);
            if (!PrefC.GetBool(PrefName.EasyNoClinics))
            {
                row = tablePref.NewRow();
                if (checkAllClin.Checked)
                {
                    row[0] = Lan.g(this, "All Clinics");
                }
                else
                {
                    string clinNames = "";
                    for (int i = 0; i < listClin.SelectedIndices.Count; i++)
                    {
                        if (i > 0)
                        {
                            clinNames += ", ";
                        }
                        if (listClin.SelectedIndices[i] == 0)
                        {
                            clinNames += Lan.g(this, "Unassigned");
                        }
                        else
                        {
                            clinNames += Clinics.List[listClin.SelectedIndices[i] - 1].Description;
                        }
                    }
                    row[0] = clinNames;
                }
                tablePref.Rows.Add(row);
            }
            FormReportForRdl FormR = new FormReportForRdl();

            FormR.SourceRdlString = Properties.Resources.PaymentsRDL;
            FormR.RdlReport.DataSets["Data"].SetData(tableIns);
            FormR.RdlReport.DataSets["DataPatPay"].SetData(tablePat);
            FormR.RdlReport.DataSets["DataPracticeTitle"].SetData(tablePref);
            FormR.ShowDialog();
            DialogResult = DialogResult.OK;
        }
コード例 #6
0
		private void butOK_Click(object sender, System.EventArgs e) {
			if(!checkAllProv.Checked && listProv.SelectedIndices.Count==0) {
				MsgBox.Show(this,"At least one provider must be selected.");
				return;
			}
			if(!PrefC.GetBool(PrefName.EasyNoClinics)) {
				if(!checkAllClin.Checked && listClin.SelectedIndices.Count==0) {
					MsgBox.Show(this,"At least one clinic must be selected.");
					return;
				}
			}
			if(!checkAllTypes.Checked && listTypes.SelectedIndices.Count==0 && !checkIns.Checked) {
				MsgBox.Show(this,"At least one type must be selected.");
				return;
			}
			string whereProv="";
			if(!checkAllProv.Checked) {
				for(int i=0;i<listProv.SelectedIndices.Count;i++) {
					if(i==0) {
						whereProv+=" AND (";
					}
					else {
						whereProv+="OR ";
					}
					whereProv+="claimproc.ProvNum = "+POut.Long(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum)+" ";
				}
				whereProv+=") ";
			}
			string whereClin="";
			if(!checkAllClin.Checked) {
				for(int i=0;i<listClin.SelectedIndices.Count;i++) {
					if(i==0) {
						whereClin+=" AND (";
					}
					else {
						whereClin+="OR ";
					}
					if(listClin.SelectedIndices[i]==0) {
						whereClin+="claimproc.ClinicNum = 0 ";
					}
					else {
						whereClin+="claimproc.ClinicNum = "+POut.Long(Clinics.List[listClin.SelectedIndices[i]-1].ClinicNum)+" ";
					}
				}
				whereClin+=") ";
			}
			string queryIns=
				@"SELECT CONVERT("+DbHelper.DateFormatColumn("claimproc.DateCP","%c/%d/%Y")+",CHAR(25)) DateCP,MAX("
+DbHelper.Concat("patient.LName","', '","patient.FName","' '","patient.MiddleI")+@") lfname,
carrier.CarrierName,provider.Abbr,
clinic.Description clinicDesc,
claimpayment.CheckNum,FORMAT(SUM(claimproc.InsPayAmt),2) amt,claimproc.ClaimNum 
FROM claimproc
LEFT JOIN insplan ON claimproc.PlanNum = insplan.PlanNum 
LEFT JOIN patient ON claimproc.PatNum = patient.PatNum
LEFT JOIN carrier ON carrier.CarrierNum = insplan.CarrierNum
LEFT JOIN provider ON provider.ProvNum=claimproc.ProvNum
LEFT JOIN claimpayment ON claimproc.ClaimPaymentNum = claimpayment.ClaimPaymentNum
LEFT JOIN clinic ON clinic.ClinicNum=claimproc.ClinicNum
WHERE (claimproc.Status=1 OR claimproc.Status=4) "//received or supplemental
				+whereProv
				+whereClin
				+"AND claimpayment.CheckDate >= "+POut.Date(date1.SelectionStart)+" "
				+"AND claimpayment.CheckDate <= "+POut.Date(date2.SelectionStart)+" "
+@"GROUP BY CONVERT("+DbHelper.DateFormatColumn("claimproc.DateCP","%c/%d/%Y")+@",CHAR(25)),
claimproc.ClaimPaymentNum,provider.ProvNum,
claimproc.ClinicNum,carrier.CarrierName,provider.Abbr,
clinic.Description,claimpayment.CheckNum";
			if(radioPatient.Checked){
				queryIns+=",patient.PatNum";
			}
			queryIns+=" ORDER BY claimproc.DateCP,lfname";
			if(!checkIns.Checked){
				queryIns=DbHelper.LimitOrderBy(queryIns,0);
			}
			//patient payments-----------------------------------------------------------------------------------------
			whereProv="";
			if(!checkAllProv.Checked) {
				for(int i=0;i<listProv.SelectedIndices.Count;i++) {
					if(i==0) {
						whereProv+=" AND (";
					}
					else {
						whereProv+="OR ";
					}
					whereProv+="paysplit.ProvNum = "+POut.Long(ProviderC.ListShort[listProv.SelectedIndices[i]].ProvNum)+" ";
				}
				whereProv+=") ";
			}
			whereClin="";
			if(!checkAllClin.Checked) {
				for(int i=0;i<listClin.SelectedIndices.Count;i++) {
					if(i==0) {
						whereClin+=" AND (";
					}
					else {
						whereClin+="OR ";
					}
					if(listClin.SelectedIndices[i]==0) {
						whereClin+="payment.ClinicNum = 0 ";
					}
					else {
						whereClin+="payment.ClinicNum = "+POut.Long(Clinics.List[listClin.SelectedIndices[i]-1].ClinicNum)+" ";
					}
				}
				whereClin+=") ";
			}
			string queryPat=
				@"SELECT CONVERT("+DbHelper.DateFormatColumn("payment.PayDate","%c/%d/%Y")+",CHAR(25)) AS DatePay,MAX("
+DbHelper.Concat("patient.LName","', '","patient.FName","' '","patient.MiddleI")+@") AS lfname,
payment.PayType,provider.Abbr,
clinic.Description clinicDesc,
payment.CheckNum,
FORMAT(SUM(paysplit.SplitAmt),2) amt, payment.PayNum,ItemName 
FROM payment
LEFT JOIN paysplit ON payment.PayNum=paysplit.PayNum
LEFT JOIN patient ON payment.PatNum=patient.PatNum
LEFT JOIN provider ON paysplit.ProvNum=provider.ProvNum
LEFT JOIN definition ON payment.PayType=definition.DefNum 
LEFT JOIN clinic ON payment.ClinicNum=clinic.ClinicNum
WHERE 1 "
				+whereProv
				+whereClin
				+"AND paysplit.DatePay >= "+POut.Date(date1.SelectionStart)+" "
				+"AND paysplit.DatePay <= "+POut.Date(date2.SelectionStart)+" ";
			if(listTypes.SelectedIndices.Count>0){
				queryPat+="AND (";
				for(int i=0;i<listTypes.SelectedIndices.Count;i++) {
					if(i>0) {
						queryPat+="OR ";
					}
					queryPat+="payment.PayType = "+POut.Long(DefC.Short[(int)DefCat.PaymentTypes][listTypes.SelectedIndices[i]].DefNum)+" ";
				}
				queryPat+=") ";
			}
			queryPat+=@"GROUP BY "
				+"payment.PayNum,payment.PayDate,provider.ProvNum,payment.ClinicNum"
				+",provider.Abbr,clinic.Description,payment.CheckNum,definition.ItemName";
			if(radioPatient.Checked){
				queryPat+=",patient.PatNum";
			}
			queryPat+=" ORDER BY paysplit.DatePay,lfname";
			if(!checkAllTypes.Checked && listTypes.SelectedIndices.Count==0){
				queryPat=DbHelper.LimitOrderBy(queryPat,0);
			}
			DataTable tableIns=Reports.GetTable(queryIns);
			DataTable tablePat=Reports.GetTable(queryPat);
			DataTable tablePref=Reports.GetTable("SELECT ValueString FROM preference WHERE PrefName='PracticeTitle'");
			DataRow row=tablePref.NewRow();
			if(checkAllProv.Checked) {
				row[0]=Lan.g(this,"All Providers");
			}
			else {
				string provNames="";
				for(int i=0;i<listProv.SelectedIndices.Count;i++) {
					if(i>0) {
						provNames+=", ";
					}
					provNames+=ProviderC.ListShort[listProv.SelectedIndices[i]].Abbr;
				}
				row[0]=provNames;
			}
			tablePref.Rows.Add(row);
			if(!PrefC.GetBool(PrefName.EasyNoClinics)) {
				row=tablePref.NewRow();
				if(checkAllClin.Checked) {
					row[0]=Lan.g(this,"All Clinics");
				}
				else {
					string clinNames="";
					for(int i=0;i<listClin.SelectedIndices.Count;i++) {
						if(i>0) {
							clinNames+=", ";
						}
						if(listClin.SelectedIndices[i]==0) {
							clinNames+=Lan.g(this,"Unassigned");
						}
						else {
							clinNames+=Clinics.List[listClin.SelectedIndices[i]-1].Description;
						}
					}
					row[0]=clinNames;
				}
				tablePref.Rows.Add(row);
			}
			FormReportForRdl FormR=new FormReportForRdl();
			FormR.SourceRdlString=Properties.Resources.PaymentsRDL;
			FormR.RdlReport.DataSets["Data"].SetData(tableIns);
			FormR.RdlReport.DataSets["DataPatPay"].SetData(tablePat);
			FormR.RdlReport.DataSets["DataPracticeTitle"].SetData(tablePref);
			FormR.ShowDialog();
			DialogResult=DialogResult.OK;		
		}