Sep 22, 2016

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it n-tier architecture. Layer architectures are essentially objects and work in object oriented environment just like asp.net. 3-tier architecture is a very well known architecture in the world of software development, it doesn't matter whether you are developing web based application or desktop based, it is the best architecture to use.

3-Tier Architecture in asp.net using c#

3-Tier architecture consists of
1) UI or Presentation Layer
2) Business Access Layer or Business Logic Layer
3) Data Access Layer

Presentation Layer
Presentation layer consists of pages like .aspx or desktop based form where data is presented to users or getting input from users.

Business Logic layer or Business Access Layer
Business logic layer contains all of the business logic. Its responsibility is to validate the business rules of the component and communicating with the Data Access Layer. Business Logic Layer is the class in which we write functions that get data from Presentation Layer and send that data to database through Data Access Layer.

Data Access Layer
Data Access Layer is also the class that contains methods to enable business logic layer to connect the data and perform desired actions. These desired actions can be selecting, inserting, updating and deleting the data. DAL accepts the data from BAL and sends it to the database or DAL gets the data from the database and sends it to the business layer. In short, its responsibility is to communicate with the backend structure.

Check this article for 3-tier architecture 3 tier architecture example in asp.net

use and example of 3-tier architecture

Jun 16, 2016

Usable Things for Bootstrap


  • Bootstrap css front-end framework.
  • jQuery fast, small, and feature-rich JavaScript library.
  • DataTables advanced interaction controls in any HTML table
  • DropzoneJS library that provides drag'n'drop file uploads with image previews
  • EasyPieChart plugin to render and animate nice pie charts with the HTML5 canvas element
  • Flot simple but powerful chart plugin
  • FullCalendar is a jQuery plugin that provides a full-sized, drag & drop calendar
  • Gritter Notification plugin
  • iCheck Custom radio and checkbox buttons
  • IonRangeSlider Easy and light range slider plugin
  • Jasny additional components for bootstrap framework.
  • Jeditable Edit In Place Plugin For jQuery
  • jQueryUI set of user interface interactions, effects, widgets, and themes built on top of the jQuery
  • bootstrapdatepicker datepicker
  • Chosen plugin that makes long, unwieldy select boxes much more user-friendly
  • jsKnob Nice, downward compatible, touchable, jQuery dial.
  • metisMenu Easy menu jQuery plugin for Twitter bootstrap
  • Morris.js good-looking charts library
  • nouislider Lightweight javascript range slider
  • Pace Automatic page load progress bar

Apr 28, 2016

how to use multiple versions of jquery on the same page


Use jQuery.noConflict():

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script>
    var $i = jQuery.noConflict();
    alert($i.fn.jquery);
</script> 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
    var $j = jQuery.noConflict();
    alert($j.fn.jquery);
</script> 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
    var $k = jQuery.noConflict();
    alert($k.fn.jquery);
</script> 

Feb 26, 2016

Avoid duplicate rows by keep same order in SQL Server


I am looking for another solution for my sql query result.
My query below returns
SELECT 
    M.Mroutes_srno, M.Mroutes_loginid 
FROM
    Mroutes M
LEFT JOIN 
    MAccSanctioningLimit Limit ON M.mroutes_role = Limit.sac_type
                               AND M.Mroutes_moduleno = Limit.sac_moduleno
                               AND M.Mroutes_companycd = Limit.company_cd
WHERE
    M.mroutes_deptcd = 'BKAF'
    AND M.Mroutes_moduleno = 145
    AND M.mroutes_role NOT IN ('MIS', 'CFO', 'MD')
Output:
Mroutes_srno    Mroutes_loginid
--------------------------------
1   --------    AIJ1546
2   --------    BCS8021
3   --------    AIJ1546
4   --------    BCS8021
5   --------    venkatesh
6   --------    151N1636
But, after removing duplicate rows it result like below.
SELECT  
    M.Mroutes_loginid  
FROM
    Mroutes M
LEFT JOIN 
    MAccSanctioningLimit Limit ON M.mroutes_role = Limit.sac_type
                               AND M.Mroutes_moduleno = Limit.sac_moduleno
                               AND M.Mroutes_companycd = Limit.company_cd
WHERE 
    M.mroutes_deptcd = 'BKAF'
    AND M.Mroutes_moduleno = 145
    AND M.mroutes_role NOT IN ('MIS', 'CFO', 'MD')
GROUP BY
    M.Mroutes_loginid 
Output:
Mroutes_loginid
---------------
151N1636
AIJ1546
BCS8021
venkatesh
I need to keep the query in same order.

Answer 

You need to use row_number window function:
;WITH cte AS(
SELECT M.Mroutes_srno,
       M.Mroutes_loginid,
       ROW_NUMBER() OVER(PARTITION BY M.Mroutes_loginid ORDER BY M.Mroutes_srno) rn 
from Mroutes M
left JOIN MAccSanctioningLimit  Limit on M.mroutes_role =Limit.sac_type
    and  M.Mroutes_moduleno = Limit.sac_moduleno
    and M.Mroutes_companycd = Limit.company_cd
where M.mroutes_deptcd ='BKAF'
and M.Mroutes_moduleno =145
and M.mroutes_role NOT in ('MIS', 'CFO', 'MD'))

SELECT Mroutes_srno, Mroutes_loginid
FROM cte 
WHERE rn = 1
ORDER BY Mroutes_srno
Or you can order by aggregation like:
SELECT  M.Mroutes_loginid  
from Mroutes M
left JOIN MAccSanctioningLimit  Limit on M.mroutes_role =Limit.sac_type
    and  M.Mroutes_moduleno = Limit.sac_moduleno
    and M.Mroutes_companycd = Limit.company_cd
where M.mroutes_deptcd ='BKAF'
and M.Mroutes_moduleno = 145
and M.mroutes_role NOT in ('MIS', 'CFO', 'MD')
group by M.Mroutes_loginid
order by min(M.Mroutes_srno)

What is the use of n-tier architecture and 3-tier architecture?

how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...