1 Replies - 956 Views - Last Post: 12 April 2019 - 08:30 AM Rate Topic: -----

#1 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6818
  • View blog
  • Posts: 28,229
  • Joined: 12-December 12

BI for the loss

Posted 12 April 2019 - 07:52 AM

Here are just a few fragments of a significant application written by our (as was) Business India:

ManageRibbionButtions();

private void btnRibbonAutoadddetailscurrentQuotetoaJob_Click(


    obj.Col0 = (string.IsNullOrEmpty(obj.Col0)) ? col[0] : "";
    obj.Col0x = (string.IsNullOrEmpty(obj.Col0x)) ? col[1] : "";
    obj.Col1 = (string.IsNullOrEmpty(obj.Col1)) ? col[2] : "";
    obj.Col1x = (string.IsNullOrEmpty(obj.Col1x)) ? col[3] : "";
    obj.Col2 = (string.IsNullOrEmpty(obj.Col2)) ? col[4] : "";
    obj.Col2x = (string.IsNullOrEmpty(obj.Col2x)) ? col[5] : "";
    obj.Col3 = (string.IsNullOrEmpty(obj.Col3)) ? col[6] : "";
    obj.Col3x = (string.IsNullOrEmpty(obj.Col3x)) ? col[7] : "";
    obj.Col4 = (string.IsNullOrEmpty(obj.Col4)) ? col[8] : "";
    obj.Col4x = (string.IsNullOrEmpty(obj.Col4x)) ? col[9] : "";
    obj.Col5 = (string.IsNullOrEmpty(obj.Col5)) ? col[10] : "";
    obj.Col5x = (string.IsNullOrEmpty(obj.Col5x)) ? col[11] : "";
    obj.Col6 = (string.IsNullOrEmpty(obj.Col6)) ? col[12] : "";
    obj.Col6x = (string.IsNullOrEmpty(obj.Col6x)) ? col[13] : "";
    obj.Col7 = (string.IsNullOrEmpty(obj.Col7)) ? col[14] : "";
    obj.Col7x = (string.IsNullOrEmpty(obj.Col7x)) ? col[15] : "";
    obj.Col8 = (string.IsNullOrEmpty(obj.Col8)) ? col[16] : "";
    obj.Col8x = (string.IsNullOrEmpty(obj.Col8x)) ? col[17] : "";
    obj.Col9 = (string.IsNullOrEmpty(obj.Col9)) ? col[18] : "";
    obj.Col9x = (string.IsNullOrEmpty(obj.Col9x)) ? col[19] : "";
    obj.Col10 = (string.IsNullOrEmpty(obj.Col10)) ? col[20] : "";
    obj.Col10x = (string.IsNullOrEmpty(obj.Col10x)) ? col[21] : "";
    obj.Col11 = (string.IsNullOrEmpty(obj.Col11)) ? col[22] : "";
    obj.Col11x = (string.IsNullOrEmpty(obj.Col11x)) ? col[23] : "";
    obj.Col12 = (string.IsNullOrEmpty(obj.Col12)) ? col[24] : "";
    obj.Col12x = (string.IsNullOrEmpty(obj.Col12x)) ? col[25] : "";
    obj.Col13 = (string.IsNullOrEmpty(obj.Col13)) ? col[26] : "";
    obj.Col13x = (string.IsNullOrEmpty(obj.Col13x)) ? col[27] : "";
    obj.Col14 = (string.IsNullOrEmpty(obj.Col14)) ? col[28] : "";
    obj.Col14x = (string.IsNullOrEmpty(obj.Col14x)) ? col[29] : "";
    obj.Col15 = (string.IsNullOrEmpty(obj.Col15)) ? col[30] : "";
    obj.Col15x = (string.IsNullOrEmpty(obj.Col15x)) ? col[31] : "";
    obj.Col16 = (string.IsNullOrEmpty(obj.Col16)) ? col[32] : "";
    obj.Col16x = (string.IsNullOrEmpty(obj.Col16x)) ? col[33] : "";
    obj.Col17 = (string.IsNullOrEmpty(obj.Col17)) ? col[34] : "";
    obj.Col17x = (string.IsNullOrEmpty(obj.Col17x)) ? col[35] : "";
    obj.Col18 = (string.IsNullOrEmpty(obj.Col18)) ? col[36] : "";
    obj.Col18x = (string.IsNullOrEmpty(obj.Col18x)) ? col[37] : "";
    obj.Col19 = (string.IsNullOrEmpty(obj.Col19)) ? col[38] : "";
    obj.Col19x = (string.IsNullOrEmpty(obj.Col19x)) ? col[39] : "";
    obj.Col20 = (string.IsNullOrEmpty(obj.Col20)) ? col[40] : "";
    obj.Col20x = (string.IsNullOrEmpty(obj.Col20x)) ? col[41] : "";
    obj.Col21 = (string.IsNullOrEmpty(obj.Col21)) ? col[42] : "";
    obj.Col21x = (string.IsNullOrEmpty(obj.Col21x)) ? col[43] : "";
    obj.Col22 = (string.IsNullOrEmpty(obj.Col22)) ? col[44] : "";
    obj.Col22x = (string.IsNullOrEmpty(obj.Col22x)) ? col[45] : "";
    obj.Col23 = (string.IsNullOrEmpty(obj.Col23)) ? col[46] : "";
    obj.Col23x = (string.IsNullOrEmpty(obj.Col23x)) ? col[47] : "";


    obj.BackColor0 = string.IsNullOrEmpty(obj.BackColor0) ? backcolor[0] : "";
    obj.BackColor0x = string.IsNullOrEmpty(obj.BackColor0x) ? backcolor[1] : "";
    obj.BackColor1 = string.IsNullOrEmpty(obj.BackColor1) ? backcolor[2] : "";
    obj.BackColor1x = string.IsNullOrEmpty(obj.BackColor1x) ? backcolor[3] : "";
    obj.BackColor2 = string.IsNullOrEmpty(obj.BackColor2) ? backcolor[4] : "";
    obj.BackColor2x = string.IsNullOrEmpty(obj.BackColor2x) ? backcolor[5] : "";
    obj.BackColor3 = string.IsNullOrEmpty(obj.BackColor3) ? backcolor[6] : "";
    obj.BackColor3x = string.IsNullOrEmpty(obj.BackColor3x) ? backcolor[7] : "";
    obj.BackColor4 = string.IsNullOrEmpty(obj.BackColor4) ? backcolor[8] : "";
    obj.BackColor4x = string.IsNullOrEmpty(obj.BackColor4x) ? backcolor[9] : "";
    obj.BackColor5 = string.IsNullOrEmpty(obj.BackColor5) ? backcolor[10] : "";
    obj.BackColor5x = string.IsNullOrEmpty(obj.BackColor5x) ? backcolor[11] : "";
    obj.BackColor6 = string.IsNullOrEmpty(obj.BackColor6) ? backcolor[12] : "";
    obj.BackColor6x = string.IsNullOrEmpty(obj.BackColor6x) ? backcolor[13] : "";
    obj.BackColor7 = string.IsNullOrEmpty(obj.BackColor7) ? backcolor[14] : "";
    obj.BackColor7x = string.IsNullOrEmpty(obj.BackColor7x) ? backcolor[15] : "";
    obj.BackColor8 = string.IsNullOrEmpty(obj.BackColor8) ? backcolor[16] : "";
    obj.BackColor8x = string.IsNullOrEmpty(obj.BackColor8x) ? backcolor[17] : "";
    obj.BackColor9 = string.IsNullOrEmpty(obj.BackColor9) ? backcolor[18] : "";
    obj.BackColor9x = string.IsNullOrEmpty(obj.BackColor9x) ? backcolor[19] : "";
    obj.BackColor10 = string.IsNullOrEmpty(obj.BackColor10) ? backcolor[20] : "";
    obj.BackColor10x = string.IsNullOrEmpty(obj.BackColor10x) ? backcolor[21] : "";
    obj.BackColor11 = string.IsNullOrEmpty(obj.BackColor11) ? backcolor[22] : "";
    obj.BackColor11x = string.IsNullOrEmpty(obj.BackColor11x) ? backcolor[23] : "";
    obj.BackColor12 = string.IsNullOrEmpty(obj.BackColor12) ? backcolor[24] : "";
    obj.BackColor12x = string.IsNullOrEmpty(obj.BackColor12x) ? backcolor[25] : "";
    obj.BackColor13 = string.IsNullOrEmpty(obj.BackColor13) ? backcolor[26] : "";
    obj.BackColor13x = string.IsNullOrEmpty(obj.BackColor13x) ? backcolor[27] : "";
    obj.BackColor14 = string.IsNullOrEmpty(obj.BackColor14) ? backcolor[28] : "";
    obj.BackColor14x = string.IsNullOrEmpty(obj.BackColor14x) ? backcolor[29] : "";
    obj.BackColor15 = string.IsNullOrEmpty(obj.BackColor15) ? backcolor[30] : "";
    obj.BackColor15x = string.IsNullOrEmpty(obj.BackColor15x) ? backcolor[31] : "";
    obj.BackColor16 = string.IsNullOrEmpty(obj.BackColor16) ? backcolor[32] : "";
    obj.BackColor16x = string.IsNullOrEmpty(obj.BackColor16x) ? backcolor[33] : "";
    obj.BackColor17 = string.IsNullOrEmpty(obj.BackColor17) ? backcolor[34] : "";
    obj.BackColor17x = string.IsNullOrEmpty(obj.BackColor17x) ? backcolor[35] : "";
    obj.BackColor18 = string.IsNullOrEmpty(obj.BackColor18) ? backcolor[36] : "";
    obj.BackColor18x = string.IsNullOrEmpty(obj.BackColor18x) ? backcolor[37] : "";
    obj.BackColor19 = string.IsNullOrEmpty(obj.BackColor19) ? backcolor[38] : "";
    obj.BackColor19x = string.IsNullOrEmpty(obj.BackColor19x) ? backcolor[39] : "";
    obj.BackColor20 = string.IsNullOrEmpty(obj.BackColor20) ? backcolor[40] : "";
    obj.BackColor20x = string.IsNullOrEmpty(obj.BackColor20x) ? backcolor[41] : "";
    obj.BackColor21 = string.IsNullOrEmpty(obj.BackColor21) ? backcolor[42] : "";
    obj.BackColor21x = string.IsNullOrEmpty(obj.BackColor21x) ? backcolor[43] : "";
    obj.BackColor22 = string.IsNullOrEmpty(obj.BackColor22) ? backcolor[44] : "";
    obj.BackColor22x = string.IsNullOrEmpty(obj.BackColor22x) ? backcolor[45] : "";
    obj.BackColor23 = string.IsNullOrEmpty(obj.BackColor23) ? backcolor[46] : "";
    obj.BackColor23x = string.IsNullOrEmpty(obj.BackColor23x) ? backcolor[47] : "";

These are colours for a grid??!!

I actually added the IsNullOrEmpty checks because it was failing with nulls. We are required to make minimal, without side-effects, code to maintain the application until it is fully, and sensibly, rewritten in MVC.

These should just be a largely empty structure, defaulting to white or transparent colours, and with the vehicle and timespan determined, change the colours.

[There are also 52 objects that the grid relates to. One would think, naturally, that this might refer to weeks... but it refers (arbitrarily) to vehicles.]

Is This A Good Question/Topic? 0
  • +

Replies To: BI for the loss

#2 DarenR   User is offline

  • D.I.C Lover

Reputation: 634
  • View blog
  • Posts: 4,209
  • Joined: 12-January 10

Re: BI for the loss

Posted 12 April 2019 - 08:30 AM

css not their thing i guess?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1