Public voidhebing () {intRowscount; intCellcount; Rowscount=FG1. Rows.Count; Cellcount=FG1. Columns.count; for(intA =0; A < Rowscount; a++) { stringF_onlycode = FG1. Rows[a]. cells[1]. Value.tostring (); stringF_code = FG1. Rows[a]. cells[2]. Value.tostring (); DoubleQuanty =Double. Parse (FG1. Rows[a]. cells[5]. Value.tostring ()); if(Quanty <0) { for(intb =0; b < Rowscount; b++) { stringF_code1 = FG1. ROWS[B]. cells[2]. Value.tostring (); DoubleQuanty1 =Double. Parse (FG1. ROWS[B]. cells[5]. Value.tostring ()); stringF_onlycode = FG1. ROWS[B]. cells[1]. Value.tostring (); if(F_code = = F_code1 && F_onlycode! =F_onlycode) { //Out-of- library billing equals return fee if(Quanty1 = =-quanty) { //FG1. Rows.removeat (a);FG1. Rows[a]. Visible =false; for(intc =0; C < FG1. Rows.Count; C++) { if(FG1. ROWS[C]. cells[2]. value.tostring () = =F_code) {FG1. ROWS[C]. Visible=false; } } } //Out-of-Library charge is greater than refund if(Quanty1 >-quanty && quanty1! =quanty) {FG1. ROWS[B]. cells[5]. Value = (Quanty-(-quanty1)). ToString ("F3"); This. FG1. ROWS[B]. Defaultcellstyle.backcolor =Color.aqua; FG1. Rows[a]. Visible=false; }//Out-of-library charges are less than refunds if(Quanty1 <-quanty && Quanty1! =quanty) { This. FG1. ROWS[B]. cells[5]. Value = ((quanty1) + (Quanty)). ToString ("F3"); //This . FG1. Rows.removeat (a);FG1. Rows[a]. Visible =false; } if(Quanty1 = = Quanty && Quanty <0&& Quanty! =quanty) {FG1. Rows[a]. Defaultcellstyle.backcolor=Color.aqua; } } } } } //only refund information exists for(intU =0; U < Rowscount; u++) { if(Double. Parse (FG1. Rows[u]. cells[5]. Value.tostring ()) <0) { This. FG1. Rows[u]. Defaultcellstyle.backcolor =color.red; } } }
Four types of mergers:
Out-of-Library billing equals back-Library billing
Out-of-library billing is greater than chargeback
Out-of-library billing is less than chargeback
Only fallback billing is present
Merging DataGridView conditional Merge row data