Wednesday 25 April 2012

ASP.NET with some AJAX

Here is the AjaxcontrolToolkit Link
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Default.aspx
This toolkit is an open source project simply does ajax jobs relatively easier way.

Some JQuery and Javascript Links
http://www.dhtmlgoodies.com

Wednesday 18 April 2012

ASP.NET Template Field Command Triggering

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                     OnRowCommand="GridView1_RowCommand">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="ID" Visible="False" />
                            <asp:BoundField HeaderText="Field Name" DataField="CurrencyName" >
                            </asp:BoundField>
                                                   
                             <asp:TemplateField ShowHeader="False">
                                 <ItemTemplate>
                                     <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="false" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ID")%>'
                                         CommandName="ItemDelete" ImageUrl="~/Admin/Img/Delete.png" Text="Button" />
                                 </ItemTemplate>
                                 <ItemStyle Width="18px" />
                            </asp:TemplateField>
                            
                        </Columns>
                  </asp:GridView>


    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
        Dim MyPool As New LogicPool.DB("Conn")
        If (e.CommandName = "ItemDelete") Then

            Dim index As Integer = Convert.ToInt32(e.CommandArgument)
            MyPool.SQLRun("DELETE FROM AppCurrencyRules WHERE ID = " & index)
            FillGrid()
        End If
    End Sub

Tuesday 3 April 2012

Data Types (why?)

Finally in my 19th year in my professional carreer second time I saw another crazy programmer's code.
In the evaluation of computers and development techniques some developers resist to accept new techniques. about 10 years ago I had a collegue. He attented all those system analysis meetings, we built up data structure, process structure, road map together. We decided to use Informix SQL in those time as database. He had a strong background in DOS - Cobol systems. I think it was his first time to use a proper database. He used his own binary files as database until that time.

Then we began development. According to plan I was developing web end, he was developing windows end and we were good until the day we had to integrate both parts. I connected his database and surprised a bit. The data structure was OK but in every table there was one additional field which was binary. I didn't get it and asked him what it was. His answer was killing. He said "after he populates data from the screen he converted all of them to binary and write that field" I asked why didn't he use the all structure? He said he is faster with his way.

Nearly 1 year of analysis and data structure work has gone to rubbish bin. He suggest me to develop an interface to read his data.

In these 10 years it was my stragest memory. Until 5 minutes ago...

While I was examining the most complex code I ever seen I somehow couldn't find where is the problem. I can't debug it because of the arthitecture. I tried to follow the code line by line. In some point I saw there is an image field in database which is possible. There are some images and it can be normal. But the image field there bothered me and tried to find when it's used.

Yes. The same thing happened. Previous developer populated some fields and convert them into binary and wrote that field.

I can't believe this. Guys where did you see this technique ? First guy was Turkish  lives in Istanbul in all his life and second one is British living in UK.

Is it a kind of joke ?