Friday, August 10, 2018

✈TRIP REPORT | Air Serbia | Thessaloniki - London via Belgrade | Airbus A319 | Business Class

Hello everyone -

Welcome to my trip report from Thessaloniki to London via Belgrade using Air Serbia A319 and their discontinued business class cabin.

The trip  took place in April 2017.

You can check the video report at this link:



Some more pictures from my trip can be seen below.

Business class lounge in Thessaloniki:


Prosecco for welcome drink once onboard:



Selection of Serbian newspapers:



Nice view of the Aegean Sea after takeoff:



Business class meal on 55 minute flight:



Landed in Belgrade:



Next morning, breakfast in Air Serbia lounge:



Meal on the leg to London:



Thanks for watching and stay tuned for the return leg report.



Thursday, November 22, 2012

Sql Server Increment Field Value in a Query

I had a need to increment a field in a database table on each execution of a stored procedure. At 1st, was planning to increment that in the C# code but once I thinked twice I knew there's an option to do that in sql query.
So, what I did is this:

DECLARE @ViewsCount int
SELECT @ViewsCount = [Views] FROM Project WHERE Oid='FAD06A96-ABE8-4A8F-81ED-07235EE813FC' AND ProjectName='My Project'
UPDATE Project
SET [Views] = (@ViewsCount + 1)
WHERE Oid='FAD06A96-ABE8-4A8F-81ED-07235EE813FC' AND ProjectName='My Project'


I am declaring int variable and then setting the value of that variable with a select query.
Once the variable has the value I am updating the field in the table.
That's all!
The field is now incremented each time that SP will be called.
Thanks for reading.

Monday, November 14, 2011

asp.net smtp email configuration for localhost testing

I had a opportunity to work on a project where the client wanted to send email to his clients once the data is inserted in the database.
Once I started working on that portion of the code, the client still didn't had the smtp settings he'll use for his website online, so I needed to test my code in local envionment and make sure that everything works fine.
First thing I did was to add a system.net node in the web.config file and configure that accordingly to the localhost envionment:

<system.net>
<mailsettings>
<smtp from="arnaudovangel@yahoo.com" deliverymethod="SpecifiedPickupDirectory">
<specifiedpickupdirectory pickupdirectorylocation="C:\TempWebService\">
<network host="localhost">
</network></specifiedpickupdirectory></smtp>
</mailsettings>
</system.net>

Once I had that done, I created a method to send the email, with a parameter for the outgoing email address. The method was looking something like this:

public void sendEmail(string emailAddress)
{
MailMessage msg = new MailMessage("test@test.com", emailAddress, "test", "test body");
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
client.Send(msg);
}
Once that method was executed, a new mail messsage was created in the folder I specified, in this case: C:\TempWebService.
Once you apply the real smtp settings, the message will be delivered to the selected email.

Thanks for reading, Angel

Sunday, February 20, 2011

Hide / Show Datalist item in datalist asp.net c#

Hello everyone -
Its time again for a new blog post.
This time it will be related to asp.net datalist and datalistitems.
I was asked to hide show datalistitems in a datalist control depending from some parameters in the code.
Normally I did a loop through all the datalistitems in the datalist and if something is as it should be, enable that listitem.

foreach (DataListItem item in this.dlShopping.Items)
{
string namee = this.dlShopping.DataKeys[item.ItemIndex].ToString();
item.Visible = false;
if (namee.Equals("UPS GROUND") || namee.Equals("UPS 2 DAY AIR"))
{
item.Visible = true;
}
}

The code was working fine, but the end result was that all the datalist items were displayed, without filtering the one which were suppose to show up.

The solution to really filter the results was to add one more line in the code about the layout of the datalist.
dlShopping.RepeatLayout = RepeatLayout.Flow;

This helps the items to be displayed in random structure without using a table.
So, next time you want to do something like I did today, that line of code will solve your problems.
Thanks for reading.

Sunday, January 30, 2011

How to list items in categories and subcategories in treeview

Hello everyone -
Today I will explain how I solved problem I had with listing multiple subcategories in a treeview control on asp.net page.
I had problem where I was suppose to display files listed in categories which were populated by the user and then the files under each category were uploaded on the server from a user.
The files were all in one folder per company, and there was a table in the database where I was saving the info about which files are going where, under which name and which user.
So, I started to get my hands dirty.
First, I wanted to get all the categories which were created and there was a record for them in the database.
I did a simple query for doing that, and then I fetch the data from the table to a node in the treeview:

string getCategories = "SELECT Category FROM Categories";
SqlCommand commCat = new SqlCommand(getCategories, conn);
comm.CommandTimeout = 0;
comm.CommandType = CommandType.Text;
SqlDataReader rdrCat = commCat.ExecuteReader();
while (rdrCat.Read())
{
if (rdrCat.HasRows)
{
catNode = new TreeNode();
catNode.Text = rdrCat["Category"].ToString();
catNode.Value = rdrCat["Category"].ToString();
tvDocuments.Nodes.Add(catNode);
}
}


Once I had all the categories created in the treeview I went to get all the files for each category.
I created stored procedure which gets all the files and their categories from the info stored in the database.
Once I had all the info about the files and their respected categories I started looping through the nodes in the treeview and if the node had the same name as the category for the file, add the file to that category.
The loop was going like this:

foreach (DataRow dt in tblTreeView.Rows)
{
foreach (TreeNode node in tvDocuments.Nodes)
{
if (node.Text.Equals(dt[0].ToString()))
{
fileNode = new TreeNode();
fileNode.Text = dt[1].ToString();
fileNode.NavigateUrl = "../downloading.aspx?file=" + dt[1].ToString() + "&user=" + userID;
node.ChildNodes.Add(fileNode);
}
}
}


Since the file nodes were also hyperlink for downloading the documents I set the navigate url to the appropriate page for downloading along with the filename and the user id.

Thanks for reading and comments always appreciated.

Sunday, December 5, 2010

How to show/hide iframe in ssl/non-ssl pages in asp.net

Last week I was working on a task where we had to disable the facebook like box on a ssl pages because of security issues with the controls which are not coming from within our website. We are including the widget within our master page, that means that it will be part of all the child pages, doesn't matter if they are ssl or non-ssl. After some testing, here is how I resolved the problem, and have the widget enabled on non-ssl pages, and have the widget disabled on ssl pages.

Here is the iframe received from Facebook:


<iframe src="http://www.facebook.com/plugins/likebox.php?href=www.facebook.com%2Fwebsite&width=180&colorscheme=dark&connections=6&stream=true&header=false&height=605" style="border: medium none; overflow: hidden; width: 177px; height: 605px;" allowtransparency="true" frameborder="0" scrolling="no"></iframe>

Now what I am doing is I am checking the connection with:

                      <% if (Request.IsSecureConnection.Equals(false))


If the page is non-ssl display the iframe, and if the page is ssl don't display the iframe and disable ir from rendering.
Here is the complete source code:


<div>

                      <% if (Request.IsSecureConnection.Equals(false))

                           { %>

                           <br /><br />

            <iframe src="http://www.facebook.com/plugins/likebox.php?href=www.facebook.com%2FyourWebsite&width=180&colorscheme=dark&connections=6&stream=true&header=false&height=605" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:177px; height:605px;" allowTransparency="true"></iframe>                      

                       <br />

                         <a style="float:left;" href="http://twitter.com/YourWebsite" target="_blank" style="float: right"><img src="images/twitter_Web.jpg" title="Follow me on Twitter" width="162 height="69" /></a><br />

                    

                        <% } %>

                     </div>



Thanks for reading and comments always appreciated.

Follow me on twitter: http://www.twitter.com/AngelArnaudov

Thursday, November 25, 2010

Beginning Microsoft Sql Server 2008 Programming book by Wrox

I finally finished reading this book, it took me a while though, almost 2 months with all my travel around, but at the end I must conclude that it is a great book, I can recommend to everyone who wants to learn more about sql server and how to program more efficiently with sql language. The book covers all from very basic stuff to some intermediate level. There is one more part of this book, which I hope to read in near future and is the advanced programming in sql server 2008.