var CellNo = $("#CellNo").val();
var Designation = $("#designation_select_box").val();
var Center = $("#center_select_box").val();
var Designation = $("#designation_select_box").val();
var Center = $("#center_select_box").val();
Dynamic div
<script>
$(document).ready(function () {
var $sourceFields = $("#sourceFields");
var $destinationFields = $("#destinationFields");
var $chooser = $("#fieldChooser").fieldChooser(sourceFields, destinationFields);
$.getJSON("Home/ItemDetails",
function (json) {
var res;
var ItemDiv = $("#sourceFields");
//Append each row to html table
for (var i = 0; i < json.length; i++) {
//"<div>"
//$('#sourceFields').html(json[i].item);
//ItemDiv = "<div>" + json[i].item + "</div>";
//$("<div/>").appendTo("div#ItemDiv");
$("<div>" + json[i].item + "</div>").appendTo("#sourceFields");
//ItemDiv.html('');
//ItemDiv.html(json[i].item);
// alert(ItemDiv);
// alert(ItemDiv);
////tr = $('<tr/>');
//tr.append("<td>" + json[i].Id + "</td>");
//tr.append("<td>" + json[i].Name + "</td>");
//tr.append("<td>" + json[i].City + "</td>");
//tr.append("<td>" + json[i].Address + "</td>");
//$('table').append(tr);
}
});
$('#btnSave').click(function () {
});
});
//function SaveItems() {
// alert('1');
// var ItemDiv2 = $("#destinationFields");
// //Append each row to html table
// alert(ItemDiv.length);
//}
</script>
<div id="fieldChooser" tabindex="1">
<div id="sourceFields">
@*<div>Item1</div>
<div>Item2</div>
<div>Item3</div>
<div>Item4</div>
<div>Item5</div>
<div>Item6</div>
<div>Item7</div>
<div>Item8</div>*@
</div>
<div id="destinationFields">
</div>
<input type="button" value="Submit" id="btnSave" />
@*<input type="button" value="Submit" onclick="SaveItems();" id="btnSave" />*@
</div>
/////////////////////////////////////////////
[HttpGet]
public JsonResult ItemDetails()
{
List<ItemModel> ObjEmp = new List<ItemModel>()
{
new ItemModel
{
item = "Test1"
},
new ItemModel
{
item = "Test2"
},
new ItemModel
{
item = "Test3"
},
new ItemModel
{
item = "Test4"
}
};
return Json(ObjEmp, JsonRequestBehavior.AllowGet);
}
//
Procedure Example
CREATE Procedure [dbo].[ECS_GetProductList_SP]
as
Select distinct SLS_PackageDetail_TB.Price,SLS_PackageDetail_TB.Price as [TotalAmount],SLS_PackageDetail_TB.Quantity,SLS_PackageDetail_TB.Product_Id ,
ORA_Products_TB.name,SLS_B_TaxPercentage_TB.TaxPercentage
Into #TemMyProductList
From SLS_PackageDetail_TB
INNER JOIN ORA_Products_TB on SLS_PackageDetail_TB.Product_Id = ORA_Products_TB.Id
Inner Join SLS_B_TaxDetail_TB On ORA_Products_TB.ID=SLS_B_TaxDetail_TB.Product_Id
Inner Join SLS_B_TaxPercentage_TB on SLS_B_TaxDetail_TB.Tax_ID=SLS_B_TaxPercentage_TB.id
where SLS_PackageDetail_TB.Active='y' and
SLS_PackageDetail_TB.Active='Y' AND SLS_B_TaxDetail_TB.Active='y' AND ORA_Products_TB.Active='y'
order by ORA_Products_TB.name,SLS_PackageDetail_TB.Quantity asc
Select ROW_NUMBER() over (ORDER BY name) AS ID,* From #TemMyProductList
Drop Table #TemMyProductList
Procedure Example
CREATE Procedure [dbo].[ECS_GetProductList_SP]
as
Select distinct SLS_PackageDetail_TB.Price,SLS_PackageDetail_TB.Price as [TotalAmount],SLS_PackageDetail_TB.Quantity,SLS_PackageDetail_TB.Product_Id ,
ORA_Products_TB.name,SLS_B_TaxPercentage_TB.TaxPercentage
Into #TemMyProductList
From SLS_PackageDetail_TB
INNER JOIN ORA_Products_TB on SLS_PackageDetail_TB.Product_Id = ORA_Products_TB.Id
Inner Join SLS_B_TaxDetail_TB On ORA_Products_TB.ID=SLS_B_TaxDetail_TB.Product_Id
Inner Join SLS_B_TaxPercentage_TB on SLS_B_TaxDetail_TB.Tax_ID=SLS_B_TaxPercentage_TB.id
where SLS_PackageDetail_TB.Active='y' and
SLS_PackageDetail_TB.Active='Y' AND SLS_B_TaxDetail_TB.Active='y' AND ORA_Products_TB.Active='y'
order by ORA_Products_TB.name,SLS_PackageDetail_TB.Quantity asc
Select ROW_NUMBER() over (ORDER BY name) AS ID,* From #TemMyProductList
Drop Table #TemMyProductList
............
CREATE Procedure [dbo].[Ecs_ChangePinCode_Sp]
(@NicNo varchar(25),@ContactNumber varchar(15),
@OldPinCode varchar(6),@NewPincode varchar(6))
as
If Exists (Select sct.NIC_No,scnt.ContactNumber From SLS_ContactNumbers_TB scnt Inner Join SLS_Contact_TB sct on scnt.Contact_Id=sct.Id
where sct.NIC_No=@NicNo and scnt.ContactNumber=@ContactNumber and scnt.Pincode=@OldPinCode)
Begin
Update SLS_ContactNumbers_TB Set PinCode=@NewPincode where ContactNumber=@ContactNumber
Select 1 as [Status],'Pincode Has been Changed' as [Message]
End
Else
Begin
Select 0 as [Status],'Provide valid CellNo/Nic/OldPin' as [Message]
End