I found this nugget in a web forms project




  • using System;
    using System.Data;
    using System.Drawing;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Windows.Forms;
    using AjaxControlToolkit;

    <crap deleted>
        switch (report)
        {
            case "contractULO":
                if (ddlULOReports.SelectedValue != "0" || string.IsNullOrEmpty(ddlULOReports.SelectedValue))
                {
                    string reportName = ddlULOReports.SelectedItem.Text;
                    if (ddlULOReports.SelectedValue == "D")
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        exportContract_ULO_Differential();
                        Cursor.Current = Cursors.Default;
                    }
    
    <crap deleted>


  • That really just looks like business rules getting piled on top of one another over time.  When it happens you can get unreachable clauses which you should probably clean up or comment, but it's not really a WTF.



  • This is a "Web Forms" project.

    @theflin said:

    using System;
    using System.Windows.Forms;

                        Cursor.Current = Cursors.WaitCursor;
                        Cursor.Current = Cursors.Default;
    


  • TRWTF is it's not launching Excel, and the cursor isn't behind doors with goats.



  • @theflin said:

    This is a "Web Forms" project.
     

    Recently:

    Boss: "We want to add an attachment when someone clicks on a mailto: link."

    Me: "Can't be done. Browsers aren't allowed file system access like that, and Outlook can't accept incoming attachments like that." (Note: client uses Outlook)

    Boss: "Other developer saw there's a way to do it in C#, using some Office interop thing. I think he should try that code."

    Me: "Let me know how it goes."



  • @Lorne Kates said:

    @theflin said:

    This is a "Web Forms" project.
     

    Recently:

    Boss: "We want to add an attachment when someone clicks on a mailto: link."

    Me: "Can't be done. Browsers aren't allowed file system access like that, and Outlook can't accept incoming attachments like that." (Note: client uses Outlook)

    Boss: "Other developer saw there's a way to do it in C#, using some Office interop thing. I think he should try that code."

    Me: "Let me know how it goes."

    Let us all know how it goes. I know you can generate downloadable documents on the front-end for them to attach themselves, but presumably these are the kind of users which yield this conversation:

    Me: "Download the zip, unzip it, open index.html in a browser."

    Them: "It's not working."

    Me: "Try unzipping the files. Opening index.html inside the zipped file won't work."

    Or, my personal favourite:

    Me: "Download the zip, unzip it, open index.html in a browser."

    Them: "It's not working."

    Me: "Does it give you an error message or a blank screen?"

    Them: "Neither." *doesn't give any details* "Can't you just send it to me in notepad?"

    The second one is actually more complex than I'm letting on, but what it came down to was that the user didn't follow the instructions and lied about not following the instructions.



  • It probably came about because someone was tasked with outsourced porting an existing WinForms app to WebForms. The developer obviously set about doing this by copy-pasting code from the existing WinForms project, fixing the compiler errors (by referencing the missing assembly, just as the compiler told them), then started to worry about making it work as a web-app.

    I wonder what the sysadmin thinks whenever he's working on that webserver "WTF, why does the the damn hourglass keep comming up?". (and before some smartarse points it out, I already know it won't do anything, because it's running in the context of the webserver which cant interact with the desktop blah, blah, blah).



  • Our company built it from scratch, there was no port. Svn reveals that the current dev for that project added it fairly recently. He was not the dev that started the project.



  • This is why you always include diagnostic traps that show when people fail to obey the instructions.



  • @theflin said:


    if (ddlULOReports.SelectedValue != "0" || string.IsNullOrEmpty(ddlULOReports.SelectedValue))
    {
    string reportName = ddlULOReports.SelectedItem.Text;

    looks dodgy to me too. If SelectedValue is null or empty, I would expect there to be a non-zero probability that SelectedItem is null. But that's just a bug rather than a WTF.


  • @Shoreline said:

    Me: "Download the zip, unzip it, open index.html in a browser."

    Them: "It's not working."

    Me: "Try unzipping the files. Opening index.html inside the zipped file won't work."

    Some people think that opening a zip file (i.e. viewing the contents) IS unzipping it, and they get confused when you tell them they didn't.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.