Wednesday, 18 April 2018

Demo

1) select empty >mvc
new get package > bootstrap
index view -> 

@{
Layout = null;
}
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="~/Scripts/bootstrap.js"></script>
<link href="~/Content/bootstrap.css" rel="nofollow" />
<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script src="~/Scripts/employee.js"></script>
</head>
<body>
<div class="container">
<div>
<form>
<div class="col-sm-6">
<label for="EmployeeId">ID</label>
<input type="text" class="form-control" id="EmployeeID" placeholder="Id" disabled="disabled" />
</div>
<div class="col-sm-6">
<label for="Name">Name</label>
<input type="text" class="form-control" id="Name" placeholder="Name" />
</div>
<div class="col-sm-6">
<label for="Age">Age</label>
<input type="text" class="form-control" id="Age" placeholder="Age" />
</div>
<div class="col-sm-6">
<label for="State">State</label>
<input type="text" class="form-control" id="State" placeholder="State" />
</div>
</form>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();">Add</button>
<button type="button" class="btn btn-primary" id="btnUpdate" style="display:none;" onclick="Update();">Update</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">Add More Employee Detail</button><br /><br />
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
<div>
@{Html.RenderAction("AddMoreList", "Home");}
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@*<button type="button" class="close" data-dissmiss="modal"><span aria-hidden="true">&times;</span></button>*@
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title" id="myModalLabel">Add Employee</h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="EmployeeId">ID</label>
<input type="text" class="form-control" id="EmployeeID" placeholder="Id" disabled="disabled" />
</div>
<div class="form-group">
<label for="Name">Name</label>
<input type="text" class="form-control" id="Name" placeholder="Name" />
</div>
<div class="form-group">
<label for="Age">Age</label>
<input type="text" class="form-control" id="Age" placeholder="Age" />
</div>
<div class="form-group">
<label for="State">State</label>
<input type="text" class="form-control" id="State" placeholder="State" />
</div>
<div class="form-group">
<label for="Country">Country</label>
<input type="text" class="form-control" id="Country" placeholder="Country" />
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="btnAdd" onclick="return Add();">Add</button>
<button type="button" class="btn btn-primary" id="btnUpdate" style="display:none;" onclick="Update();">Update</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</body>
</html>
AddMoreList.cshrml-
@model IEnumerable<Practical_Demo.Models.CustomClass.AddMoreList>
<table class="table">
<tr>
<th>
Name
</th>
<th>
Age
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Age)
</td>
<td>
<a href="javascript:;" class="btn btn-primary" onclick="return getbyID(@item.EmployeeId)">Edit</a> |
@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
</td>
</tr>
}
</table>
Controller
public class HomeController : Controller
{
TestEntities db = new TestEntities();
// GET: Home
public ActionResult Index()
{
return View();
}
public JsonResult Add(Practical_Demo.Models.CustomClass.Employee emp)
{
var result = db.InsertUpdateEmployee(emp.EmployeeID, emp.Name, emp.Age, emp.State, "a", "Insert");
return Json(result, JsonRequestBehavior.AllowGet);
}
public ActionResult AddMoreList(string accountType, string code = null, string name = null, string trade = null, string region = null, string teamName = null, string teamTrade = null, string teamWorkstream = null, string teamRole = null, int page = 1)
{

////var model = new List<AddMoreList>();
/////ViewBag.List = db.SelectEmployee();
var model = db.SelectEmployee().ToList().ConvertAll(item => new AddMoreList
{
EmployeeId = item.EmployeeId,
Name = item.Name,
Age = item.Age
}); 
return PartialView("AddMoreList", model);
}
public JsonResult GetbyID(int ID)
{
Models.Employee emp = new Models.Employee();
var a = db.GetbyID(ID);
return Json(a, JsonRequestBehavior.AllowGet);
}
}
employee.js

$(document).ready(function () {
});
//Add Data Function 
function Add() {
var res = validate();
if (res == false) {
return false;
}
var empObj = {
EmployeeID: $('#EmployeeID').val(),
Name: $('#Name').val(),
Age: $('#Age').val(),
State: $('#State').val()
};
$.ajax({
url: "/Home/Add",
data: JSON.stringify(empObj),
type: "POST",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (result) {
loadData();
$('#myModal').modal('hide');
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
//Function for getting the Data Based upon Employee ID
function getbyID(EmpID) {
$('#Name').css('border-color', 'lightgrey');
$('#Age').css('border-color', 'lightgrey');
$('#State').css('border-color', 'lightgrey');
$('#Country').css('border-color', 'lightgrey');
$.ajax({
url: "/Home/getbyID/" + EmpID,
typr: "GET",
contentType: "application/json;charset=UTF-8",
dataType: "json",
success: function (data) {
debugger;
$('#EmployeeID').val(data[0].EmployeeId);
//$('#Name').val(result.Name);
//$('#Age').val(result.Age);
//$('#State').val(result.State);
//$('#Country').val(result.Country);
$('#myModal').modal('show');
$('#btnUpdate').show();
$('#btnAdd').hide();
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
return false;
}
//function for updating employee's record
function Update() {
var res = validate();
if (res == false) {
return false;
}
var empObj = {
EmployeeID: $('#EmployeeID').val(),
Name: $('#Name').val(),
Age: $('#Age').val(),
State: $('#State').val(),
Country: $('#Country').val(),
};
$.ajax({
url: "/Home/Update",
data: JSON.stringify(empObj),
type: "POST",
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (result) {
loadData();
$('#myModal').modal('hide');
$('#EmployeeID').val("");
$('#Name').val("");
$('#Age').val("");
$('#State').val("");
$('#Country').val("");
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
//function for deleting employee's record
function Delele(ID) {
var ans = confirm("Are you sure you want to delete this Record?");
if (ans) {
$.ajax({
url: "/Home/Delete/" + ID,
type: "POST",
contentType: "application/json;charset=UTF-8",
dataType: "json",
success: function (result) {
loadData();
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
}
//Function for clearing the textboxes
function clearTextBox() {
$('#EmployeeID').val("");
$('#Name').val("");
$('#Age').val("");
$('#State').val("");
$('#Country').val("");
$('#btnUpdate').hide();
$('#btnAdd').show();
$('#Name').css('border-color', 'lightgrey');
$('#Age').css('border-color', 'lightgrey');
$('#State').css('border-color', 'lightgrey');
$('#Country').css('border-color', 'lightgrey');
}
//Valdidation using jquery
function validate() {
var isValid = true;
if ($('#Name').val().trim() == "") {
$('#Name').css('border-color', 'Red');
isValid = false;
}
else {
$('#Name').css('border-color', 'lightgrey');
}
if ($('#Age').val().trim() == "") {
$('#Age').css('border-color', 'Red');
isValid = false;
}
else {
$('#Age').css('border-color', 'lightgrey');
}
if ($('#State').val().trim() == "") {
$('#State').css('border-color', 'Red');
isValid = false;
}
else {
$('#State').css('border-color', 'lightgrey');
}
return isValid;
}

Sunday, 14 July 2013

How To Discble and enable the USB port..

Flag Counter


1. Click Start, and then click Run.

2. In the Open box, type regedit, and then click OK.



3. Locate, and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor

4. In the right pane, double-click "Start".

5. In the Value data box, type "3" (without quotes), click Hexadecimal (if it is not already selected), and then click OK. Note :- if 3 is entered it will open the port and if 4 is entered it will close the port.

 6. Quit Registry Editor.

Thursday, 6 June 2013

How To Open A FireFox Within A FireFox?


Yes Now You can run's the multiple Firefox inside Firefox..

it's really easy to use try it on your Mozilla FireFox its Really Awesome just insert the url in firefox browser..

URL::==>>

Create a folder without name.

Create a folder without name



For some security purpose we hide our some folder and data unvisualable.

So i will teach you how to create folder without name and hide it..
Just Follw some Few Steps..

1) Create a new Folder.

2) After all that Press F2 button.
    Or Do right Click near the folder and choose rename

3) The Press Alt + 255

4) By that The Folder will create without name
5) After do right click and select properties and select customize


6) Then choose chang Icone.

7) And Select Blank Item from the folder and ok.

8)