本文整理汇总了C#中OpenDental.UI.ODGrid.EndUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# ODGrid.EndUpdate方法的具体用法?C# ODGrid.EndUpdate怎么用?C# ODGrid.EndUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenDental.UI.ODGrid
的用法示例。
在下文中一共展示了ODGrid.EndUpdate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawGridHelper
private void DrawGridHelper(Graphics g,int i) {
if(listFields.SelectedIndices.Contains(i)) {
_argsDF.pen=_argsDF.penRed;
_argsDF.brush=_argsDF.brushRed;
}
else {
_argsDF.pen=_argsDF.penBlack;
_argsDF.brush=_argsDF.brushBlue;
}
List<DisplayField> Columns=SheetUtil.GetGridColumnsAvailable(SheetDefCur.SheetFieldDefs[i].FieldName);
//fGrid.Columns=SheetGridDefs.GetColumnsAvailable(fGrid.GridType);
ODGrid odGrid=new ODGrid();
odGrid.Width=0;
for(int c=0;c<Columns.Count;c++){
odGrid.Width+=Columns[c].ColumnWidth;
}
odGrid.HideScrollBars=true;
#region Fill Grid
odGrid.BeginUpdate();
odGrid.Columns.Clear();
ODGridColumn col;
for(int c=0;c<Columns.Count;c++) {
col=new ODGridColumn(Columns[c].Description,Columns[c].ColumnWidth);
odGrid.Columns.Add(col);
}
ODGridRow row=new ODGridRow();//Add dummy row
for(int c=0;c<Columns.Count;c++) {
row.Cells.Add(" ");//add dummy row.
}
odGrid.Rows.Add(row);
odGrid.EndUpdate();//Calls ComputeRows and ComputeColumns, meaning the RowHeights int[] has been filled.
#endregion
int yPosGrid=SheetDefCur.SheetFieldDefs[i].YPos;
if(SheetDefCur.SheetFieldDefs[i].FieldName=="StatementPayPlan") {
SizeF sSize=g.MeasureString("Payment Plans",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold));
g.FillRectangle(Brushes.White,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid,odGrid.Width,odGrid.TitleHeight);
g.DrawString("Payment Plans",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold),new SolidBrush(Color.Black),SheetDefCur.SheetFieldDefs[i].XPos+(SheetDefCur.SheetFieldDefs[i].Width-sSize.Width)/2,yPosGrid);
yPosGrid+=odGrid.TitleHeight;
}
odGrid.PrintHeader(g,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid);
yPosGrid+=odGrid.HeaderHeight;
odGrid.PrintRow(0,g,SheetDefCur.SheetFieldDefs[i].XPos,yPosGrid,false,true);//a single dummy row.
yPosGrid+=odGrid.RowHeights[0]+2;
#region drawFooter
if(SheetDefCur.SheetFieldDefs[i].FieldName=="StatementPayPlan") {
RectangleF rf=new RectangleF(SheetDefCur.Width-SheetDefCur.SheetFieldDefs[i].Width-60,yPosGrid,SheetDefCur.SheetFieldDefs[i].Width,odGrid.TitleHeight);
g.FillRectangle(Brushes.White,rf);
StringFormat sf=new StringFormat();
sf.Alignment=StringAlignment.Far;
g.DrawString("Payment Plan Amount Due: "+"0.00",new Font(FontFamily.GenericSansSerif,10,FontStyle.Bold),new SolidBrush(Color.Black),rf,sf);
}
#endregion
if(listFields.SelectedIndices.Contains(i)) {
g.DrawRectangle(_argsDF.penRedThick,
SheetDefCur.SheetFieldDefs[i].XPos,
SheetDefCur.SheetFieldDefs[i].YPos,
SheetDefCur.SheetFieldDefs[i].Width,
SheetDefCur.SheetFieldDefs[i].Height);
}
//g.DrawRectangle(_argsDF.pen,SheetDefCur.SheetFieldDefs[i].XPos,SheetDefCur.SheetFieldDefs[i].YPos,
// SheetDefCur.SheetFieldDefs[i].Width,SheetDefCur.SheetFieldDefs[i].Height);
//g.DrawString("Grid:"+SheetGridDefs.GetName(SheetDefCur.SheetFieldDefs[i].GridDef),Font,_argsDF.brush,SheetDefCur.SheetFieldDefs[i].XPos,SheetDefCur.SheetFieldDefs[i].YPos);
}
示例2: GetGridForPrinting
//.........这里部分代码省略.........
//if this is the last entry for a given date
if(i==mergedAL.Count-1//if this is the last row
|| GetDateForRow(i+1,mergedAL) != curDate)//or the next row is a different date
{
row.Cells.Add(ClockEvents.Format(daySpan));
daySpan=new TimeSpan(0);
}
else{//not the last entry for the day
row.Cells.Add("");
}
//Weekly-------------------------------------
weeklyTotals[i]=weekSpan;
//if this is the last entry for a given week
if(i==mergedAL.Count-1//if this is the last row
|| cal.GetWeekOfYear(GetDateForRow(i+1,mergedAL),rule,(DayOfWeek)PrefC.GetInt(PrefName.TimeCardOvertimeFirstDayOfWeek))//or the next row has a
!= cal.GetWeekOfYear(clock.TimeDisplayed1.Date,rule,(DayOfWeek)PrefC.GetInt(PrefName.TimeCardOvertimeFirstDayOfWeek)))//different week of year
{
row.Cells.Add(ClockEvents.Format(weekSpan));
weekSpan=new TimeSpan(0);
}
else {
//row.Cells.Add(ClockEvents.Format(weekSpan));
row.Cells.Add("");
}
//Note-----------------------------------------
row.Cells.Add(clock.Note);
}
//adjustment row--------------------------------------------------------------------------------------
else if(type==typeof(TimeAdjust)){
adjust=(TimeAdjust)mergedAL[i];
curDate=adjust.TimeEntry.Date;
if(curDate==previousDate){
row.Cells.Add("");
row.Cells.Add("");
}
else{
row.Cells.Add(curDate.ToShortDateString());
row.Cells.Add(curDate.DayOfWeek.ToString());
}
//altered--------------------------------------
//Deprecated
//status--------------------------------------
//row.Cells.Add("");//3
//in/out------------------------------------------
row.Cells.Add("");//4
//time-----------------------------
row.Cells.Add(adjust.TimeEntry.ToShortTimeString());//5
//total-------------------------------
row.Cells.Add("");//
//Adjust------------------------------
daySpan+=adjust.RegHours;//might be negative
weekSpan+=adjust.RegHours;
periodSpan+=adjust.RegHours;
row.Cells.Add(ClockEvents.Format(adjust.RegHours));//6
//Rate2-------------------------------
row.Cells.Add("");//
//Overtime------------------------------
otspan+=adjust.OTimeHours;
row.Cells.Add(ClockEvents.Format(adjust.OTimeHours));//7
//Daily-----------------------------------
//if this is the last entry for a given date
if(i==mergedAL.Count-1//if this is the last row
|| GetDateForRow(i+1,mergedAL) != curDate)//or the next row is a different date
{
row.Cells.Add(ClockEvents.Format(daySpan));//
daySpan=new TimeSpan(0);
}
else{
row.Cells.Add("");
}
//Weekly-------------------------------------
weeklyTotals[i]=weekSpan;
//if this is the last entry for a given week
if(i==mergedAL.Count-1//if this is the last row
|| cal.GetWeekOfYear(GetDateForRow(i+1,mergedAL),rule,(DayOfWeek)PrefC.GetInt(PrefName.TimeCardOvertimeFirstDayOfWeek))//or the next row has a
!= cal.GetWeekOfYear(adjust.TimeEntry.Date,rule,(DayOfWeek)PrefC.GetInt(PrefName.TimeCardOvertimeFirstDayOfWeek)))//different week of year
{
ODGridCell cell=new ODGridCell(ClockEvents.Format(weekSpan));
cell.ColorText=Color.Black;
row.Cells.Add(cell);
weekSpan=new TimeSpan(0);
}
else {
row.Cells.Add("");
}
//Note-----------------------------------------
row.Cells.Add("(Adjust)"+adjust.Note);//used to indicate adjust rows.
row.Cells[row.Cells.Count-1].ColorText=Color.Red;
}
gridTimeCard.Rows.Add(row);
}
gridTimeCard.EndUpdate();
totalTime=periodSpan.ToStringHmm();
overTime=otspan.ToStringHmm();
rate2Time=rate2span.ToStringHmm();
totalTime2=periodSpan.TotalHours.ToString("n");
overTime2=otspan.TotalHours.ToString("n");
rate2Time2=rate2span.TotalHours.ToString("n");
return gridTimeCard;
}
示例3: CreateDocument
//.........这里部分代码省略.........
gcol=new ODGridColumn(Lan.g(this,"31-60"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"61-90"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"over 90"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
if(PrefC.GetBool(PrefName.BalancesDontSubtractIns")) {//less common
gcol=new ODGridColumn(Lan.g(this,"Balance"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"InsPending"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"AfterIns"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
}
else{//more common
gcol=new ODGridColumn(Lan.g(this,"Total"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"- InsEst"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
gcol=new ODGridColumn(Lan.g(this,"= Balance"),70,HorizontalAlignment.Center);
gridAging.Columns.Add(gcol);
}
gridAging.Rows.Clear();
//Annual max--------------------------
grow=new ODGridRow();
grow.Cells.Add(PatGuar.Bal_0_30.ToString("F"));
grow.Cells.Add(PatGuar.Bal_31_60.ToString("F"));
grow.Cells.Add(PatGuar.Bal_61_90.ToString("F"));
grow.Cells.Add(PatGuar.BalOver90.ToString("F"));
grow.Cells.Add(PatGuar.BalTotal.ToString("F"));
grow.Cells.Add(PatGuar.InsEst.ToString("F"));
grow.Cells.Add((PatGuar.BalTotal-PatGuar.InsEst).ToString("F"));
gridAging.Rows.Add(grow);
gridAging.EndUpdate();
MigraDocHelper.DrawGrid(section,gridAging);
gridAging.Dispose();
*/
#endregion
//Floating Balance, Ins info-------------------------------------------------------------------
#region FloatingBalance
frame=MigraDocHelper.CreateContainer(section,460,380+legendOffset,250,200);
//table=MigraDocHelper.DrawTable(frame,0,0,90);
par = frame.AddParagraph();
parformat = new ParagraphFormat();
parformat.Alignment = ParagraphAlignment.Right;
par.Format = parformat;
font = MigraDocHelper.CreateFont(10,false);
MigraDoc.DocumentObjectModel.Font fontBold=MigraDocHelper.CreateFont(10, true);
if(Stmt.IsInvoice) {
text=Lan.g(this,"Procedures:");
par.AddFormattedText(text,font);
par.AddLineBreak();
text=Lan.g(this,"Adjustments:");
par.AddFormattedText(text,font);
par.AddLineBreak();
text=Lan.g(this,"Total:");
par.AddFormattedText(text,font);
par.AddLineBreak();
}
else if(PrefC.GetBool(PrefName.BalancesDontSubtractIns)){
text = Lan.g(this, "Balance:");
par.AddFormattedText(text, fontBold);
//par.AddLineBreak();
//text = Lan.g(this, "Ins Pending:");
//par.AddFormattedText(text, font);
//par.AddLineBreak();
示例4: CreateDocument
//.........这里部分代码省略.........
row.Cells.Add(textPriMax.Text);
row.Cells.Add(textSecMax.Text);
gridIns.Rows.Add(row);
//Deductible--------------------------
row=new ODGridRow();
row.Cells.Add(Lan.g(this,"Deductible"));
row.Cells.Add(textPriDed.Text);
row.Cells.Add(textSecDed.Text);
gridIns.Rows.Add(row);
//Deductible Remaining--------------------------
row=new ODGridRow();
row.Cells.Add(Lan.g(this,"Deductible Remaining"));
row.Cells.Add(textPriDedRem.Text);
row.Cells.Add(textSecDedRem.Text);
gridIns.Rows.Add(row);
//Insurance Used--------------------------
row=new ODGridRow();
row.Cells.Add(Lan.g(this,"Insurance Used"));
row.Cells.Add(textPriUsed.Text);
row.Cells.Add(textSecUsed.Text);
gridIns.Rows.Add(row);
//Pending--------------------------
row=new ODGridRow();
row.Cells.Add(Lan.g(this,"Pending"));
row.Cells.Add(textPriPend.Text);
row.Cells.Add(textSecPend.Text);
gridIns.Rows.Add(row);
//Remaining--------------------------
row=new ODGridRow();
row.Cells.Add(Lan.g(this,"Remaining"));
row.Cells.Add(textPriRem.Text);
row.Cells.Add(textSecRem.Text);
gridIns.Rows.Add(row);
gridIns.EndUpdate();
//Print Individual Insurance-------------------------
MigraDocHelper.InsertSpacer(section,15);
par=section.AddParagraph();
par.Format.Alignment=ParagraphAlignment.Center;
par.AddFormattedText(Lan.g(this,"Individual Dental Insurance Benefits"),totalFontx);
MigraDocHelper.InsertSpacer(section,2);
MigraDocHelper.DrawGrid(section,gridIns);
gridIns.Dispose();
}
#endregion
//Note------------------------------------------------------------------------------------------------------------
#region printNote
string note="";
if(gridPlans.SelectedIndices[0]==0) {//current TP
note=PrefC.GetString(PrefName.TreatmentPlanNote);
}
else {
note=PlanList[gridPlans.SelectedIndices[0]-1].Note;
}
char nbsp='\u00A0';
//to prevent collapsing of multiple spaces to single spaces. We only do double spaces to leave single spaces in place.
note=note.Replace(" ",nbsp.ToString()+nbsp.ToString());
MigraDocHelper.InsertSpacer(section,20);
par=section.AddParagraph(note);
par.Format.Font=bodyFontx;
par.Format.Borders.Color=Colors.Gray;
par.Format.Borders.DistanceFromLeft=Unit.FromInch(.05);
par.Format.Borders.DistanceFromRight=Unit.FromInch(.05);
par.Format.Borders.DistanceFromTop=Unit.FromInch(.05);
par.Format.Borders.DistanceFromBottom=Unit.FromInch(.05);
#endregion
//Signature-----------------------------------------------------------------------------------------------------------
示例5: CalculateGridHeightHelper
///<summary>Calculates height of grid taking into account page breaks, word wrapping, cell width, font size, and actual data to be used to fill this grid.</summary>
private static int CalculateGridHeightHelper(SheetField field,Sheet sheet,Graphics g,Statement stmt,int topMargin,int bottomMargin,MedLab medLab) {
UI.ODGrid odGrid=new UI.ODGrid();
odGrid.FontForSheets=new Font(field.FontName,field.FontSize,field.FontIsBold?FontStyle.Bold:FontStyle.Regular);
odGrid.Width=field.Width;
odGrid.HideScrollBars=true;
odGrid.YPosField=field.YPos;
odGrid.TopMargin=topMargin;
odGrid.BottomMargin=bottomMargin;
odGrid.PageHeight=sheet.HeightPage;
odGrid.Title=field.FieldName;
if(stmt!=null) {
odGrid.Title+=(stmt.Intermingled?".Intermingled":".NotIntermingled");//Important for calculating heights.
}
DataTable Table=SheetUtil.GetDataTableForGridType(field.FieldName,stmt,medLab);
List<DisplayField> Columns=SheetUtil.GetGridColumnsAvailable(field.FieldName);
#region Fill Grid
odGrid.BeginUpdate();
odGrid.Columns.Clear();
ODGridColumn col;
for(int i=0;i<Columns.Count;i++) {
col=new ODGridColumn(Columns[i].InternalName,Columns[i].ColumnWidth);
odGrid.Columns.Add(col);
}
ODGridRow row;
for(int i=0;i<Table.Rows.Count;i++) {
row=new ODGridRow();
for(int c=0;c<Columns.Count;c++) {//Selectively fill columns from the dataTable into the odGrid.
row.Cells.Add(Table.Rows[i][Columns[c].InternalName].ToString());
}
if(Table.Columns.Contains("PatNum")) {//Used for statments to determine account splitting.
row.Tag=Table.Rows[i]["PatNum"].ToString();
}
odGrid.Rows.Add(row);
}
odGrid.EndUpdate(true);//Calls ComputeRows and ComputeColumns, meaning the RowHeights int[] has been filled.
#endregion
return odGrid.PrintHeight;
}
示例6: drawFieldGrid
public static void drawFieldGrid(SheetField field,Sheet sheet,Graphics g,XGraphics gx,Statement stmt=null,MedLab medLab=null) {
_printMargin.Top=40;
if(sheet.SheetType==SheetTypeEnum.MedLabResults) {
_printMargin.Top=120;
}
UI.ODGrid odGrid=new UI.ODGrid();//Only used for measurements, also contains printing/drawing logic.
odGrid.FontForSheets=new Font(field.FontName,field.FontSize,field.FontIsBold?FontStyle.Bold:FontStyle.Regular);
int _yAdjCurRow=0;//used to adjust for Titles, Headers, Rows, and footers (all considered part of the same row).
odGrid.Width=0;
List<DisplayField> Columns=SheetUtil.GetGridColumnsAvailable(field.FieldName);
foreach(DisplayField Col in Columns) {
odGrid.Width+=Col.ColumnWidth;
}
odGrid.Height=field.Height;
odGrid.HideScrollBars=true;
odGrid.YPosField=field.YPos;
odGrid.Title=field.FieldName;
if(stmt!=null) {
odGrid.Title+=(stmt.Intermingled?".Intermingled":".NotIntermingled");//Important for calculating heights.
}
odGrid.TopMargin=_printMargin.Top;
odGrid.BottomMargin=_printMargin.Bottom;
odGrid.PageHeight=sheet.HeightPage;
DataTable Table=SheetUtil.GetDataTableForGridType(field.FieldName,stmt,medLab);
#region Fill Grid, Set Text Alignment
odGrid.BeginUpdate();
odGrid.Columns.Clear();
ODGridColumn col;
for(int i=0;i<Columns.Count;i++) {
col=new ODGridColumn(Columns[i].Description,Columns[i].ColumnWidth);
switch(field.FieldName+"."+Columns[i].InternalName) {//Unusual switch statement to differentiate similar column names in different grids.
case "StatementMain.charges":
case "StatementMain.credits":
case "StatementMain.balance":
case "StatementPayPlan.charges":
case "StatementPayPlan.credits":
case "StatementPayPlan.balance":
col.TextAlign=HorizontalAlignment.Right;
break;
case "StatementAging.Age00to30":
case "StatementAging.Age31to60":
case "StatementAging.Age61to90":
case "StatementAging.Age90plus":
case "StatementEnclosed.AmountDue":
case "StatementEnclosed.DateDue":
col.TextAlign=HorizontalAlignment.Center;
break;
default:
col.TextAlign=HorizontalAlignment.Left;
break;
}
odGrid.Columns.Add(col);
}
ODGridRow row;
for(int i=0;i<Table.Rows.Count;i++) {
row=new ODGridRow();
for(int c=0;c<Columns.Count;c++) {//Selectively fill columns from the dataTable into the odGrid.
row.Cells.Add(Table.Rows[i][Columns[c].InternalName].ToString());
}
if(Table.Columns.Contains("PatNum")) {//Used for statments to determine account splitting.
row.Tag=Table.Rows[i]["PatNum"].ToString();
}
odGrid.Rows.Add(row);
}
odGrid.EndUpdate(true);//Calls ComputeRows and ComputeColumns, meaning the RowHeights int[] has been filled.
#endregion
for(int i=0;i<odGrid.RowHeights.Length;i++) {
if(_isPrinting
&& (odGrid.PrintRows[i].YPos-_printMargin.Top<_yPosPrint //rows at the end of previous page
|| odGrid.PrintRows[i].YPos-sheet.HeightPage+_printMargin.Bottom>_yPosPrint))
{
continue;//continue because we do not want to draw rows from other pages.
}
_yAdjCurRow=0;
//if(odGrid.PrintRows[i].YPos<_yPosPrint
// || odGrid.PrintRows[i].YPos-_yPosPrint>sheet.HeightPage) {
// continue;//skip rows on previous page and rows on next page.
//}
#region Draw Title
if(odGrid.PrintRows[i].IsTitleRow) {
switch(field.FieldName) {//Draw titles differently for different grids.
case "StatementMain":
Patient pat=Patients.GetPat(PIn.Long(Table.Rows[i]["PatNum"].ToString()));
string patName="";
if(pat!=null) {//should always be true
patName=pat.GetNameFLnoPref();
}
if(gx==null) {
g.FillRectangle(Brushes.White,field.XPos-10,odGrid.PrintRows[i].YPos-_yPosPrint,odGrid.Width,odGrid.TitleHeight);
g.DrawString(patName,new Font("Arial",10,FontStyle.Bold),new SolidBrush(Color.Black),field.XPos-10,odGrid.PrintRows[i].YPos-_yPosPrint);
}
else {
gx.DrawRectangle(Brushes.White,p(field.XPos-10),p(odGrid.PrintRows[i].YPos-_yPosPrint-1),p(odGrid.Width),p(odGrid.TitleHeight));
using(Font _font=new Font("Arial",10,FontStyle.Bold)) {
GraphicsHelper.DrawStringX(gx,Graphics.FromImage(new Bitmap(100,100)),(double)((1d)/p(1)),patName,new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),XBrushes.Black,new XRect(p(field.XPos-10),p(odGrid.PrintRows[i].YPos-_yPosPrint-1),p(300),p(100)),XStringAlignment.Near);
//gx.DrawString(patName,new XFont(_font.FontFamily.ToString(),_font.Size,XFontStyle.Bold),new SolidBrush(Color.Black),field.XPos-10,yPosGrid);
}
}
break;
case "StatementPayPlan":
//.........这里部分代码省略.........