Talent without working hard is nothing.
by

Using CCTV to decrease the rate of crimes and discuss the possibility of using CCTV in university camps.

These days, the crime rate is increasing and people trying to find solutions to prevent crime. One of the best methods to reduce the crime is CCTV cameras. Overall, it seems that CCTV system good way to help a society to prevent crime and it can be useful to use on a university campus. This essay will argue the benefits of using CCTV to decrease the rate of crimes and discuss the possibility of using CCTV in university camps.

    There are several benefits of using CCTV cameras to protect streets from crimes and make it more secure. And it also protects private properties banks, restaurants, airport and bus stops and traffic control system (Brown, 2002).

    Brown (2002) states there are many studies about the impact of using CCTV cameras to reduce crimes, the studies were over the period 1995 to 1999 between different cities in the UK. As a result, this study found that CCTV helps people to prevent the crime from a controlled area. Whilst, the crime rate increased in all the surrounding areas without CCTV system. For example, Birmingham in 1995 the main point was a reduction in motor theft 17%, the same for Doncaster in 1999 a significant change in traffic offense -57%. In other hands, both studies show the increase in other crime categories has been increased (Brown, 2002). It seems that with the big amount of money spent on CCTV system still, there are many gaps that need to be solved.

 

     There are many advantages of using CCTV cameras on a university campus, the primary feature of CCTV is protecting students and university campus from disruptive activities. For instance, installing CCTV system around the university areas can give an early alert to the securities from any strange person who does not belong to the university and any anti-student behavior and preventing violence among the students, At the same time can be used to observe students during the exams.

 

    This essay argued the benefits of using CCTV to reduce the rate of crimes and discuss the possibility of using CCTV in university camps. To conclude CCTV system can help to prevent crime if it will be applied everywhere without exceptions. As well as, CCTV cameras can protect university campus and ensuring peace to the students and the university.

 

 

Note: you may face some mistakes with sentence structures.

Read more..
On
by

Hi,

again with 2 tutorial ASP.NET MVC FancyGird.

After we create our data in Part 1,

Now will create new Controller Call it

StudentController.

The most important one is, what I highlight it (Yellow).

First one is declared our Interface,

  private readonly IStudent repositoryStudent;

building contractor.

 public StudentController(IStudent repoStudent)
        {
            repositoryStudent = repoStudent;
        }

 

This one our main job :)

 public JsonResult StudentJSON() {
            //    Student model = new Student();
           List<Student> model = new List <Student>();
            model = repositoryStudent.GetStudent;
            return Json(model, JsonRequestBehavior.AllowGet);
        }
 

From StudentJSON method will send Data to Our FancyGrid using AJAX.

Next step, Add View Just right click on DataTablesJQuery() and add Empty View.

So, if you visit FancyGrid website and check how to use it from the documentation page.

Previews Photo Show you what you need to add, its just 2 lines.

//FancyGrid
<link href="http://code.fancygrid.com/fancy.min.css" rel="stylesheet">
<script src="http://code.fancygrid.com/fancy.min.js"></script>

Past them in your page.

same next photo

Full View Page Code:


<link href="http://code.fancygrid.com/fancy.min.css" rel="stylesheet">
<style>
    .image-staff img {
        margin-top: -15px;
        border-radius: 2px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
</style>
<h2>DataTables JQuery</h2>

 <div id="container"></div>

 @section Scripts{
<script src="http://code.fancygrid.com/fancy.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {       
        $.ajax({
            type:"GET",
            url: "StudentJSON",
            dataType: "json",
            success: function (result) {                              
                new FancyGrid({
                    title: 'Student',
                    renderTo: 'container',
                    width: 750,
                    height: 450,
                    data: result,
                    defaults: {
                        editable: true,
                        resizable: true,
                        sortable: true,
                        filter: {
                            header: true,
                            emptyText: 'Search'
                        }
                    },
                    paging: true,

                    columns: [{
                        index: 'ID',
                        title: 'ID',
                        type: 'string'
                    }, {
                            type: 'string',
                            index: 'FirstName',
                            title: 'FirstName'
                        }
                        , {
                        type: 'string',
                        index: 'LastName',
                        title: 'LastName'
                    }, {
                            type: 'string',
                            index: 'City',
                            title: 'City'}, {
                            type: 'image',
                            index: 'image',
                            title: 'Photo',
                            cls: 'image-staff',
                            width: 100,
                            flex: 1 }]
                });
            },
            error: function () {
                alert("Error loading data! Please try again.");
            }
        });
    });
</script>
    }

 

OK, don't be scare, you will say it's not too many lines.

After you see the result.

So, let's talk about the HTML code first,

We added the javascript file and style file.

After that we create new

<div id="container"></div>

AJAX code responsible to execute StudentJSON() method and get the result to send it to FancyGrid.

 new FancyGrid({
    renderTo: 'container',
    width: 500,
    height: 400,
    data: result,
    columns: [{}]

}

Just you need on more thing,

Columns,you need yo write column Name ,Index and which data type.

in our example was number,image and string.

last column was image datatype becouse we sent image.

columns: [{
                        index: 'ID',
                        title: 'ID',
                        type: 'string'
                    }, {
                            type: 'string',
                            index: 'FirstName',
                            title: 'FirstName'
                        }
                        , {
                        type: 'string',
                        index: 'LastName',
                        title: 'LastName'
                    }, {
                            type: 'string',
                            index: 'City',
                            title: 'City'}, 
                                  
                           {type: 'image',
                            index: 'image',
                            title: 'Photo',
                            cls: 'image-staff',
                            width: 100}]

 

The result after running your project,

 

there are too many features in this tool, I just highlight in yellow paging, filtering, sorting and add image ;) 

if you back to the code you can see paging: true, this 2 words to enable paging.

to enable sorting, filtering, resizable and editable to all columns just add this piece of code.

defaults: {
                        editable: true,
                        resizable: true,
                        sortable: true,
                        filter: {
                            header: true,
                            emptyText: 'Search'
                        }
                    },

 

For more information and more and more features, you can visit https://www.fancygrid.com website 

or if you like to watch it on Youtube, How to use FancyGrid with ASP.NET MVC and SQL Server

just visit my Channel

Read more..
On
by

Hi,

In this article will write about Grid, there are too many Grid tools you can find.

but what exactly we want from Grid to display, features and how to code it or work with it from coding side.

Sure everybody tries to find the useful tool and easy with coding.

So, I found one easy to work with from coding side and too many features, help your page to be good and easy.

FancyGrid, I found it on Twitter.

 

When I checked the website, I was shocked.

Why ? I will not tell you that 

let's try together to dig up in it, with ASp.NET MVC Application.

First Step, Create new ASP.NET MVC Application.

Follow the Photos.

 

Choose MVC,

 

So, Now we need data to send it to our HTML page and display it on FancyGrid.

First, we need to create new Class in Models folder and call it Student.

 

Next Step, Create Folder Call it Services will put inside it,

a new class (IStudent class).

 

 

After Create our Interface, we need to create Repository Folder with StudentRepository class.

In StudentRepository Class, I have fake data just to show you how it will be in our HTML page.

sure you can Use data from your SQL Server database, using Entry Framework.

part2

Read more..
On
by

Hi, again this is Part 2 from Paging in ASP.NET MVC.

In Part 1, I showed you how to add all data required.

Now let's try to finish what we start together.

Now will try to add new Controller and Call it StudentController.

The most important one is, what I highlight it (Yellow).

First one is declared our Interface,

  private readonly IStudent repositoryStudent;

building contractor.

 public StudentController(IStudent repoStudent)
        {
            repositoryStudent = repoStudent;
        }

 

This one our main job :)

ActionResult Index,

First int? page=1, this for your request, when it will be null, the default page will be first one page=1.

next step is reading data from our Repository.

  var model = repositoryStudent.GetStudent;

if no page was specified in the query string, default to the first page (1)

  var pageNumber = page ?? 1; 

 will only contain 25 products max because of the pageSize

  var onePageOfProducts = products.ToPagedList(pageNumber, 25); 
  

Don't forget to call X.PagedList .

using X.PagedList;

Now to our HTML code.

Just generate Index view.

next Photo will show you what you will have new change.

Again same what we call in our controller, we should call 2 library from X.PagedList.

@using X.PagedList.Mvc;  
@using X.PagedList;

after that to have a good style you need to add,

<link href="/Content/PagedList.css" rel="stylesheet" type="text/css" />

so after all that the most important part is.

@Html.PagedListPager((IPagedList)Model, page => Url.Action("Index", new { page }))

 

The result will be same next photo.

 

 

 

Youtube Video.....

 

Hope this article is helpful.

If you have any question, just write in the comment.

 

Read more..
On
by

Hi,

Today I'm going to write about Paging in ASP.NET MVC.

First, if someone asks you about paging, why?

Sometimes, we have too many rows, Photos, articles and Products you don't want to display all of them in same time,

or let's say, you don't want load 100K row in one click, this will be a big issue with your application.

  So, the solution will be is paging.

and don't forget to use IQueryable rather than List or IEnumerable.

Now, To work our first step is to create new ASP.NET MVC Project.

Follow the Photos.

 

Choose MVC,

 

Next Step, Add X.PagedList  From NuGet packages.

So, Now we need data to send it to our HTML page and display it in the table.

First, we need to create new Class in Models folder and call it Student.

 

Next Step, Create Folder Call it Services will put inside it,

a new class (IStudent class).

 

 

After Create our Interface, we need to create Repository Folder with StudentRepository class.

In StudentRepository Class, I have fake data just to show you how it will be in our HTML page.

sure you can Use data from your SQL Server database, using Entry Framework.

 

Part2

Read more..
On