Friday, December 21, 2012

Tech - Days Kochi - 20th December 2012



              Attended Microsoft techdays at kochi conducted on 20th Dec-12 at Info Park Kochi  with Deepak, Albert and Graison.Tech days at kochi is started with Joseph Landes's (General Manager DPE | Microsoft India) keynote followed by the sessions of Ujawal Kumars and his collegue from Microsoft India.

Tech Days Schedule.

TimeDetails
09:00 am - 10:00 amRegistration
10:00 am - 10:30 amOpening Keynote
10:30 am - 11:15 amPlatform for Windows Store Apps
11:15 am – 11:30 amTea Break
11:30 am – 12:15 pmDesigning a Windows Store App
12:15 pm - 01:00 pmWindows Store Apps for .NET developers
01:00 pm – 01:30 pmMoving the web forward with Internet Explorer 10
01:30 pm - 02:30 pmLunch
02:30 pm – 08:00 pmCode Jam

After the sessions we got a good idea about windows store apps developement and Windows Phone Apps.
Here is the some usefull windows App developement resources which is given by Ujwal Kumar

Ujwal's Blog:  http://blogs.msdn.com/b/ujjwalk/
Getting started with Windows 8 apps development – comprehensive links and resources
Getting started with Windows Phone apps development – comprehensive links and resources

Tech Days Participation Certificate



Tuesday, October 9, 2012

Change DB Schema.


Select 'Alter Schema dbo Transfer ' + [s].name+'.'+o.name from
sys.schemas s inner join sys.objects o on s.schema_id = o.schema_id
and s.name = 'schema_name'

credits -  pramod

Thursday, August 30, 2012

ASP.NET MVC 4 Useful Links


Release Note
       http://www.asp.net/whitepapers/mvc4-release-notes

Using Asynchronous Methods in ASP.NET MVC 4

         http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4

Bundling and Minification


Asp.net MVC 4 Article Series by Nandip Makwana

           

Create a Custom Authorize Attribute in ASP.NET MVC


 Sample code for a creating a simple Authorize attribute. 
A user with "admin" username can only access the action which is decorated by [AdminAuthorize] attribute.

  
public class AdminAuthorize : AuthorizeAttribute
    {
        //return true if username is admin else return false
        protected override bool AuthorizeCore(HttpContextBase httpContext)
        {
            if (!httpContext.User.Identity.IsAuthenticated)
            {
                return false;
            }
            Users = httpContext.User.Identity.Name.ToLower();
 
            return (Users == "admin");
        } 
    }

Saturday, July 21, 2012

Parse a string to Enum

 if (Enum.IsDefined(typeof(EnStatus), this.HttpContext.Request.Form["payment_status"]))             {                 result.status = (EnStatus)Enum.Parse(typeof                  (EnStatus), this.HttpContext.Request.Form["payment_status"]);             }




http://blogs.msdn.com/b/tims/archive/2004/04/02/106310.aspx

Saturday, May 26, 2012

Displaying popup in WPF

      A Popup window is a window that float over a window.In this blog post i’m going to to explain how can we create a sexy popup window like message box using xaml.Wpf has a popup control
Syntax

<Popup></Popup>

      Popup control can have a child inside the popup tags.If we want to add more contents we can use any layout panels like grid, stackpanel etc.
In popup if we set IsOpen property to true then the popup will be displayed and If IsOpen = false then the popup will be closed. In this example we will set IsOpen = true whenever we click on validate button and we will set it to false when we clicked on OK button.

popup

xaml

<Popup Name="myPopup" IsOpen="False" PlacementTarget="{Binding ElementName=ProjectTasks}" Placement="Center">
      <Grid Width="300" Background="Gray">
          <Grid.RowDefinitions>
              <RowDefinition Height="Auto"/>
              <RowDefinition Height="*"/>
              <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
      <Border Grid.RowSpan="3" Background="Gray" BorderBrush="#3a3a3a" BorderThickness="1"/>
            <DockPanel  Width="300" Background="#3a3a3a" LastChildFill="True">
                <Image Source="/Images/Icons/attention.png" Width="15" Height="15" Margin="3"  DockPanel.Dock="Left"/>
<TextBlock  Padding="3" Grid.Row="0" Background="#3a3a3a" Text="Information" Foreground="White" FontWeight="Bold"/>
                </DockPanel>
              <TextBlock Width="260" Grid.Row="1" Margin="5" TextWrapping="Wrap" Foreground="white" Text="{Binding Path=ProjectValidateMessage}"></TextBlock>     


<Button Width="40" Height="20" Margin="5" Grid.Row="2" x:Name="btnPopup" Click="btnPopup_OnClick" Content="Ok" />
                        
      </Grid>
</Popup>


Code Behind:

public void btnPopup_OnClick(object Sender, RoutedEventArgs e)          
{             
    this.myPopup.IsOpen = false;         
}         
public void btnValidate_OnClick(object Sender,RoutedEventArgs e)
{             
    this.myPopup.IsOpen = true;         
}

Tuesday, May 22, 2012

Find current financial and Calendar Year in SQL Server

declare @d datetime
      set @d = GETDATE()
select
        DATEADD(yyyy, DATEDIFF(yyyy, 0, @d), 0) as [CalendarYear]
select
case
       when DATEPART(M, @d) >= 4 then DATEADD(mm, 3, DATEADD(yyyy, DATEDIFF(yyyy, 0, @d), 0))
        when DATEPART(M, @d) < 4 then DATEADD(mm, -9, DATEADD(yyyy, DATEDIFF(yyyy, 0, @d), 0))
end as [FinancialYear]

Monday, May 14, 2012

How to append a text field to an existing column in SQL Server

update table set fieldName = 'append string'+ fieldName where conditions

Example:

select *from AM_Invoice where DocumentTypeId = 3 and SalesInvoiceType = 2
update AM_Invoice set InvoiceNumber = 'B/'+InvoiceNumber where DocumentTypeId = 3 and SalesInvoiceType = 2
select *from AM_Invoice where DocumentTypeId = 3 and SalesInvoiceType = 2

result:

appendstring

Friday, May 4, 2012

Samsung reveals Galaxy SIII



Samsung reveals their most awaited android phone Galaxy SIII in an event held at London



Knockout

                        
          In these recent days I've been started learning Knockout. Knockout is a simple light weight java script library which helps us to create a rich user interface  web applications using MVVM patterns.
Knockout has a rich documentation and Live examples.you can get more from knockoutjs.com



Headline features:
  • Elegant dependency tracking - automatically updates the right parts of your UI whenever your data model changes.
  • Declarative bindings - a simple and obvious way to connect parts of your UI to your data model. You can construct a complex dynamic UIs easily using arbitrarily nested binding contexts.
  • Trivially extensible - implement custom behaviors as new declarative bindings for easy reuse in just a few lines of code.
Additional benefits:
  • Pure JavaScript library - works with any server or client-side technology
  • Can be added on top of your existing web application without requiring major architectural changes
  • Compact - around 13kb after gzipping
  • Works on any mainstream browser (IE 6+, Firefox 2+, Chrome, Safari, others)
  • Comprehensive suite of specifications (developed BDD-style) means its correct functioning can easily be verified on new browsers and platforms.
In this blog post i'm going to share the use full tutorials and blog links to learn knockout
    Live tutorial :  http://learn.knockoutjs.com/
    my jsfiddle samples : http://jsfiddle.net/rgopal_p/QUrQ7/

link list will updated... :)