Thursday, June 11, 2015

Including datepicker in Angular




Including datepicker in Angular

Directive code
angular.module('appName').directive('myDatepicker', function ($parse) {
    return function (scope, element, attrs, controller) {
        var ngModel = $parse(attrs.ngModel);
        $(function () {
            element.datepicker({              
                dateFormat: 'yy-mm-dd',
               
                onSelect: function (dateText, inst) {
                    scope.$apply(function (scope) {
                        // Change binded variable
                        ngModel.assign(scope, dateText);
                    });
                }
            });
        });
    }
});
html code
 
<input class="form-control" my-datepicker="" name="reqdate" placeholder="Requested Date" required="" type="text" />



http://jqueryui.com/

Microsoft Office 2016 Preview is now available for download



Microsoft Office 2016 Preview is now available for download

Download Link


Wednesday, May 27, 2015

Bootstrap Getting Started



Bootstrap is the most popular HTML, CSS, and JS framework for developing responsive, mobile first projects on the web.

 Bootstrap is completely free to download and use!

 Bootstrap CDN

<!-- Latest compiled and minified CSS -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"></link>

<!-- Optional theme -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css" rel="stylesheet"></link>

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>

Thursday, April 9, 2015

Simple slider

$('document').ready(function () {
    console.log("template js is working fine ");

    //basic slider starts
    var triggers = $('ul.triggers li');
    var images = $('ul.images li');
    var lastElem = triggers.length - 1;
    var target;

    triggers.first().addClass('active');
    images.hide().first().show();

    function sliderResponse(target) {
        images.fadeOut(400).eq(target).fadeIn(400);
        triggers.removeClass('active').eq(target).addClass('active');
    }

    triggers.click(function () {
        if (!$(this).hasClass('active')) {
            target = $(this).index();
            sliderResponse(target);
            resetTiming();
        }
    });

    $('.next').click(function () {
        target = $('ul.triggers li.active').index();
        target === lastElem ? target = 0 : target = target + 1;
        sliderResponse(target);
        resetTiming();
    });
    $('.prev').click(function () {
        target = $('ul.triggers li.active').index();
        lastElem = triggers.length - 1;
        target === 0 ? target = lastElem : target = target - 1;
        sliderResponse(target);
        resetTiming();
    });

    function sliderTiming() {
        target = $('ul.triggers li.active').index();
        target === lastElem ? target = 0 : target = target + 1;
        sliderResponse(target);
    }

    var timingRun = setInterval(function () { sliderTiming(); }, 5000);
    function resetTiming() {
        clearInterval(timingRun);
        timingRun = setInterval(function () { sliderTiming(); }, 5000);
    }

    //basic slider ends

});

Tuesday, April 7, 2015

Thursday, December 11, 2014

How to Load list item from a inputstring

            string inputString;
            inputString = "1667329363,1869169259,0,738263040,785112554,1,2,3,";
            string[] words = inputString.Split(',');
            foreach (string word in words)
            {
                listBox1.Items.Add(word);
            }

Wednesday, December 3, 2014

MSSQL Date Difference

DECLARE @DayIn datetime = '2014-12-03 10:05:00 PM'
DECLARE @DayOut datetime ='2014-12-04 07:00:00 AM'
DECLARE @BreakTimeIn  datetime = '2014-12-04 01:00:00 AM'
DECLARE @BreakTimeOut  datetime = '2014-12-04 02:00:00 AM'

SELECT GETDATE()
--SELECT @DayIn

--select cast(@DayIn as time) as DayIn

--select cast(@DayOut as time) as DayOut

--select cast(@BreakTimeIn as time) as BreakStartTime

--select cast(@BreakTimeOut as time) as BreakEndTime

-- Calculate the working hours

select cast((@DayOut - @DayIn)as time) as WorkingHours

-- Get breakhours

select cast(( @BreakTimeOut - @BreakTimeIn)as time) as Breaktime

-- Get totalworkingHours

select cast((@DayOut - @DayIn) - (@BreakTimeOut - @BreakTimeIn) as time) as TotalWorkingHours
--select DATEADD(dd, DATEDIFF(dd, 0, getdate()), 0)

--SELECT
--CONVERT(VARCHAR(8),GETDATE(),108) AS HourMinuteSecond,
--CONVERT(VARCHAR(8),GETDATE(),101) AS DateOnly


--SELECT
--CONVERT(TIME,GETDATE()) AS HourMinuteSecond,
--CONVERT(DATE,GETDATE(),101) AS DateOnly
--GO

--SELECT
--LEFT(CONVERT(TIME(0),GETDATE()) ,5) AS [HourMinuteSecond]
--GO

Tuesday, December 2, 2014

ASP.NET Web API 2 - Technical terms

REST

What is REST?

What is Protocol?

GET

PUT

POST

DELETE


Caching

Security

Statelessness

Network layering(with various firewalls and gateways in between client and server)

If U LIKE THE POST FOLLOW THE BLOG

ASP.NET Web API 2 - Introduction

Building a REST Service from Start to Finish

Pre Requirements

  • HTML(HyperTextMarkupLangauge)
  • CSS(CascadingStyleSheet)
  • JavaScript
  • jQuery
  • C#
  • MSSQL(T-SQL)
  • ASP.Net
  • JSON(JavaScriptObjectNotation)
  • HandsOnWithBrowser(GoogleChrome or FireFox(Firebug(plugin must be installed)))
  • Bootstrap(CssFramework(not necessary but knowing make work easier))

Tools Used.

=>Visual Studio 2013
=>Microsoft SQL Server Management Studio 2012
=>InternetInformationService(iis)
=> Firefox
=> GoogleChrome
=> Opera(testing purpose)
=> Safari(testing purpose)
=> Maxthon(testing purpose)

We will be covering all the topics here. So you dont need to be tensed i don't know these technologies, we are here to teach you step by step. Let's crack it ! feel cool.


If U LIKE THE POST FOLLOW THE BLOG

Windows Communcation Foundation (WCF)

WCF(windows communication foundation)

Have a look msdn First


  • Windows Communication Foundation (WCF) is a framework for building service-oriented applications.

  • Using WCF, you can send data as asynchronous messages from one service endpoint to another.

  • A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint.

    • A secure service to process business transactions.
    • A service that supplies current data to others, such as a traffic report or other monitoring service.
    • A chat service that allows two people to communicate or exchange data in real time.
    • A dashboard application that polls one or more services for data and presents it in a logical presentation.
    • Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
    • A Silverlight application to poll a service for the latest data feeds.

While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients.


WCF includes the following set of features. For more information, see WCF Feature Details.
  • Service Orientation
    One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another. A loosely-coupled relationship implies that any client created on any platform can connect to any service as long as the essential contracts are met.
  • Interoperability
    WCF implements modern industry standards for Web service interoperability. For more information about the supported standards, see Interoperability and Integration.
  • Multiple Message Patterns
    Messages are exchanged in one of several patterns. The most common pattern is the request/reply pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. There are other patterns such as a one-way message in which a single endpoint sends a message without any expectation of a reply. A more complex pattern is the duplex exchange pattern where two endpoints establish a connection and send data back and forth, similar to an instant messaging program. For more information about how to implement different message exchange patterns using WCF see Contracts.
  • Service Metadata
    WCF supports publishing service metadata using formats specified in industry standards such as WSDL, XML Schema and WS-Policy. This metadata can be used to automatically generate and configure clients for accessing WCF services. Metadata can be published over HTTP and HTTPS or using the Web Service Metadata Exchange standard. For more information, see Metadata.
  • Data Contracts
    Because WCF is built using the .NET Framework, it also includes code-friendly methods of supplying the contracts you want to enforce. One of the universal types of contracts is the data contract. In essence, as you code your service using Visual C# or Visual Basic, the easiest way to handle data is by creating classes that represent a data entity with properties that belong to the data entity. WCF includes a comprehensive system for working with data in this easy manner. Once you have created the classes that represent data, your service automatically generates the metadata that allows clients to comply with the data types you have designed. For more information, see Using Data Contracts
  • Security
    Messages can be encrypted to protect privacy and you can require users to authenticate themselves before being allowed to receive messages. Security can be implemented using well-known standards such as SSL or WS-SecureConversation. For more information, see Windows Communication Foundation Security.
  • Multiple Transports and Encodings
    Messages can be sent on any of several built-in transport protocols and encodings. The most common protocol and encoding is to send text encoded SOAP messages using is the HyperText Transfer Protocol (HTTP) for use on the World Wide Web. Alternatively, WCF allows you to send messages over TCP, named pipes, or MSMQ. These messages can be encoded as text or using an optimized binary format. Binary data can be sent efficiently using the MTOM standard. If none of the provided transports or encodings suit your needs you can create your own custom transport or encoding. For more information about transports and encodings supported by WCF see Transports in Windows Communication Foundation.
  • Reliable and Queued Messages
    WCF supports reliable message exchange using reliable sessions implemented over WS-Reliable Messaging and using MSMQ. For more information about reliable and queued messaging support in WCF see Queues and Reliable Sessions.
  • Durable Messages
    A durable message is one that is never lost due to a disruption in the communication. The messages in a durable message pattern are always saved to a database. If a disruption occurs, the database allows you to resume the message exchange when the connection is restored. You can also create a durable message using the Windows Workflow Foundation (WF). For more information, see Workflow Services.
  • Transactions
    WCF also supports transactions using one of three transaction models: WS-AtomicTtransactions, the APIs in the System.Transactions namespace, and Microsoft Distributed Transaction Coordinator. For more information about transaction support in WCF see Transactions [from BPUEDev11].
  • AJAX and REST Support
    REST is an example of an evolving Web 2.0 technology. WCF can be configured to process "plain" XML data that is not wrapped in a SOAP envelope. WCF can also be extended to support specific XML formats, such as ATOM (a popular RSS standard), and even non-XML formats, such as JavaScript Object Notation (JSON).
  • Extensibility
    The WCF architecture has a number of extensibility points. If extra capability is required, there are a number of entry points that allow you to customize the behavior of a service. For more information about available extensibility points see Extending WCF.

WCF is a flexible platform. Because of this extreme flexibility, WCF is also used in several other Microsoft products. By understanding the basics of WCF, you have an immediate advantage if you also use any of these products.
The first technology to pair with WCF was the Windows Workflow Foundation (WF).

Workflows simplify application development by encapsulating steps in the workflow as “activities.”

In the first version of Windows Workflow Foundation, a developer had to create a host for the workflow.

The next version of Windows Workflow Foundation was integrated with WCF. That allowed any workflow to be easily hosted in a WCF service; you can do this by automatically choosing the WF/WCF a project type in Visual Studio 2012.

Microsoft BizTalk Server R2 also utilizes WCF as a communication technology.

BizTalk is designed to receive and transform data from one standardized format to another.

Messages must be delivered to its central message box where the message can be transformed using either a strict mapping or by using one of the BizTalk features such as its workflow engine.

BizTalk can now use the WCF Line of Business (LOB) adapter to deliver messages to the message box.
Microsoft Silverlight is a platform for creating interoperable, rich Web applications that allow developers to create media-intensive Web sites (such as streaming video).

Beginning with version 2, Silverlight has incorporated WCF as a communication technology to connect Silverlight applications to WCF endpoints.

Microsoft .NET Services is a cloud computing initiative that uses WCF for building Internet-enabled applications.

Use .NET Services to create WCF services that operate across trust boundaries.

The hosting features of Windows Server AppFabric application server is specifically built for deploying and managing applications that use WCF for communication.

The hosting features includes rich tooling and configuration options specifically designed for WCF-enabled applications.

Source Link : http://msdn.microsoft.com/en-us/library/ms731082%28v=vs.110%29.aspx

If U LIKE THE POST FOLLOW THE BLOG