// Since confModal is essentially a nested modal it's enforceFocus method
// must be no-op'd or the following error results
// "Uncaught RangeError: Maximum call stack size exceeded"
// But then when the nested modal is hidden we reset modal.enforceFocus
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;
<script type="text/javascript">
$(function () {
// When your form is submitted
$("form").submit(function (e) {
debugger;
var errorWeekendDate = document.getElementById('errorWeekendDate');
var WeekendDate = document.getElementById('WeekendDate');
if (WeekendDate.value == '') {
errorWeekendDate.style.color = "red";
return false;
}
else {
errorWeekendDate.style.color = "";
}
e.preventDefault();
// Serialize your form
var formData = new FormData($(this)[0]);
loader();
// Make your POST
$.ajax({
type: 'POST',
url: '@Url.Action("FileCsv", "InvoiceProcessing")',
data: formData,
cache: false,
contentType: false,
processData: false,
success: function (result) {
debugger;
$("#popup_ok").click();
document.getElementById('dvmismatch').style.display = 'block';
$("#dvmismatch").html(result);
},
error: function (result) { alert(''); }
*************Employee Model*******************
public classEmployeeModel
{
public EmployeeModel()
{
EmployeeList = new List<EmployeeModel>();
StudentList = new List<EmployeeModel>();
ServiceList = new List<SelectListItem>();
ParentList = new List<SelectListItem>();
GenderList= new List<SelectListItem>
{
new SelectListItem() {Text = "--Select--", Value ="0" },
new SelectListItem() {Text = "Male", Value ="1" },
new SelectListItem() {Text = "Female", Value ="2"},
};
}
public int ID { get; set; }
public string Name{ get; set; }
public string Address{ get; set; }
public int Age{ get; set; }
public string Mobile{ get; set; }
public List<EmployeeModel> EmployeeList { get; set; }
public List<EmployeeModel> StudentList { get; set; }
public IEnumerable<Employee> SerList { get; set; }
public decimal? ServiceUsage { get; set; }
public decimal? ServiceCost_Per_Annum { get; set; }
public decimal? ServiceCost_for_Service { get; set; }
public List<SelectListItem> GenderList{ get; set; }
publicActionResultLogOut(){HttpCookie cookie =Request.Cookies["TSWA-Last-User"];if(User.Identity.IsAuthenticated==false|| cookie ==null||StringComparer.OrdinalIgnoreCase.Equals(User.Identity.Name, cookie.Value)){string name =string.Empty;if(Request.IsAuthenticated){
name =User.Identity.Name;}
cookie =newHttpCookie("TSWA-Last-User", name);Response.Cookies.Set(cookie);Response.AppendHeader("Connection","close");Response.StatusCode=401;// Unauthorized;Response.Clear();//should probably do a redirect here to the unauthorized/failed login page//if you know how to do this, please tap it on the comments belowResponse.Write("Unauthorized. Reload the page to try again...");Response.End();returnRedirectToAction("Index");}
cookie =newHttpCookie("TSWA-Last-User",string.Empty){Expires=DateTime.Now.AddYears(-5)};Response.Cookies.Set(cookie);returnRedirectToAction("Index");}
<script type="text/javascript">
function insertWebForm() {
debugger;
if (document.getElementById('<%=txtPage.ClientID%>').value == '') {
document.getElementById('<%=txtPage.ClientID%>').focus();
return false;
}
var pageName = document.getElementById('<%=txtPage.ClientID%>').value;
var isCheck = document.getElementById('<%=chkstatus.ClientID%>').checked;
document.getElementById('<%=hdlField.ClientID%>').value = "";
var label = document.getElementById('<%=hdlField.ClientID%>').value;
var fname = document.getElementById("FName");
var title = document.getElementById("Title");
var lname = document.getElementById("LName");
var company = document.getElementById("Company");
var phone = document.getElementById("Phone");
function OnSuccess(response) {
debugger;
if (response.d == "true") {
document.getElementById('<%=hdlField.ClientID%>').value = "";
var abc = document.getElementById('<%=hdlField.ClientID%>').value;
window.location = '/DynamicLabelList.aspx';
}
else {
document.getElementById('<%=hdlField.ClientID%>').value = "";
var abc = document.getElementById('<%=hdlField.ClientID%>').value;
alert("Page Name already inserted");
}
}
function RemoveLabelControl(div) {
document.getElementById("labelContainer").removeChild(div.parentNode);
}
</script>
<script type="text/javascript">
function drag(ev) {
document.getElementById('<%=hdnLabel.ClientID%>').value = ev.target.innerHTML;
}
function allowDrop(ev) {
debugger;
var counter = 0;
var label = document.getElementById('<%=hdnLabel.ClientID%>').value;
if (label) {
var div = document.createElement('DIV');
public static string insertPageNamewithLabel(string pageName, string isCheck, string label)
{
string result = "true";
DataTable dt = new DataTable();
SqlDataAdapter da;
SqlConnection con = new SqlConnection();
con.ConnectionString = @"Data Source="";Initial Catalog="";Persist Security Info=True;User ID="";Password=""";
SqlCommand cmd = new SqlCommand("select * from page where Name='" + pageName + "'", con);
da = new SqlDataAdapter(cmd);
da.Fill(dt);
con.Open();
cmd.ExecuteNonQuery();
if (dt.Rows.Count > 0)
{
result = "false";
//lblMsg.Text = "Page Name already inserted";
//lblMsg.ForeColor = System.Drawing.Color.Green;
}
else
{
SqlConnection coninsert = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["con"].ConnectionString);
coninsert.Open();
string strquery = "INSERT INTO [dbo].[Page]([Name],[Status]) VALUES (@name,@status);SELECT CAST(scope_identity() AS int)";
SqlCommand cmdinsert = new SqlCommand(strquery, coninsert);
cmdinsert.Parameters.AddWithValue("@name", pageName);
if (isCheck == "false")
{
cmdinsert.Parameters.AddWithValue("@status", false);
}
else
{
cmdinsert.Parameters.AddWithValue("@status", true);
}
int pageId = (int)cmdinsert.ExecuteScalar();
if (pageId > 0)
{
if (label.Length > 0)
{
string[] splitId = label.Split(new string[] { "/" }, StringSplitOptions.None);
if (splitId.Count() > 0)
{
for (int i = 0; i < splitId.Count(); i++)
{
if (splitId[i] != "")
{
SqlConnection mycon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["con"].ConnectionString);
mycon.Open();
string strquery1 = "insert into PageField (PageID, ControlToDisplay, FieldLabel, RequiredValidation, OrderBy, OptionalValue)values(@pageid,@Control,@fieldlabel,@required,@orderby,@optionalvalue);SELECT CAST(scope_identity() AS int)";
SqlCommand cmdPageLabel = new SqlCommand(strquery1, mycon);
ALTER PROC [dbo].[Sp_Fetch_AllEventByString](@SearchName VARCHAR(200))
AS
BEGIN
IF ISNULL(@SearchName,'') = ''
BEGIN
SELECT EventID, OrganizationName, OrganizationID, Title, DescriptionShort, DescriptionLong,
SUBSTRING(FileName, CHARINDEX('.', FileName) + 1, LEN(FileName)) as extension ,
Location, EventDate, ExpirationDate, URL, FileName, Active,EventTime from dbo.t_Event
END
ELSE
BEGIN
DECLARE @Count INT;
DECLARE @i INT = 0
WHILE (@i) < LEN(@SearchName)
BEGIN
SELECT @Count = COUNT(*) FROM t_Event
WHERE (OrganizationName LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
OR (Title LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
OR (DescriptionShort LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName)- @i) + '%')
OR (DescriptionLong LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
IF @Count > 0
BEGIN
SELECT EventID, OrganizationName, OrganizationID, Title, DescriptionShort, DescriptionLong,
SUBSTRING(FileName, CHARINDEX('.', FileName) + 1, LEN(FileName)) as extension ,
Location, EventDate, ExpirationDate, URL, FileName, Active,EventTime from dbo.t_Event
WHERE (OrganizationName LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
OR (Title LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
OR (DescriptionShort LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
OR (DescriptionLong LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName) - @i) + '%')
order by Title
Create PROC [dbo].[usp_Blog_Search](@SearchName VARCHAR(200))
AS
BEGIN IF ISNULL(@SearchName,'') = '' BEGIN SELECT b.ID, b.Title, b.ShortDescription, b.Description, b.ImageUrl, b.CategoryId, b.TagKeyWord, b.SeoTitle, b.SeoKeyword, b.SeoDescription, b.Status, b.UserType, b.UserId, b.CreatedDate, c.Name, (case UserType when 'U1' then (select FullName from dbo.UserDetail u where u.ID = b.UserId) when 'A1' then (select FirstName + ' ' + LastName from dbo.AdminUser a where a.Id = b.UserId) end) as UserName, (select COUNT(bv.BlogID) from BlogVisits bv where bv.BlogId=b.ID) as ViewCount, (select COUNT(br.ID) from BlogReply br where br.BlogId=b.ID and br.Status=1) as CommentCount,(select COUNT(br.ID) from BlogReply br where br.BlogId=b.ID) as CommentCountWithoutStatus, (case when [Status]=1 then 'Active' when [Status]=0 then 'InActive' end) as StatusActiveDeActive from Blog b inner join dbo.BlogCategory c on c.ID= b.CategoryId where b.[Status]=1 order by b.ID desc END ELSE BEGIN SELECT b.ID, b.Title, b.ShortDescription, b.Description, b.ImageUrl, b.CategoryId, b.TagKeyWord, b.SeoTitle, b.SeoKeyword, b.SeoDescription, b.Status, b.UserType, b.UserId, b.CreatedDate, c.Name, (case UserType when 'U1' then (select FullName from dbo.UserDetail u where u.ID = b.UserId) when 'A1' then (select FirstName + ' ' + LastName from dbo.AdminUser a where a.Id = b.UserId) end) as UserName, (select COUNT(bv.BlogID) from BlogVisits bv where bv.BlogId=b.ID) as ViewCount, (select COUNT(br.ID) from BlogReply br where br.BlogId=b.ID and br.Status=1) as CommentCount,(select COUNT(br.ID) from BlogReply br where br.BlogId=b.ID) as CommentCountWithoutStatus, (case when [Status]=1 then 'Active' when [Status]=0 then 'InActive' end) as StatusActiveDeActive from Blog b inner join dbo.BlogCategory c on c.ID= b.CategoryId WHERE ((Title LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName)) + '%') or(TagKeyWord LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName)) + '%') or(Name LIKE '%' + SUBSTRING(@SearchName,1,LEN(@SearchName)) + '%')) and [Status]=1 order by ID desc END
END