farzinmonsef / tk1

0 stars 0 forks source link

Temp #12

Open farzinmonsef opened 4 years ago

farzinmonsef commented 4 years ago

BEELINE

https://prod.beeline.com/wellsfargo/Security/NewLogin.aspx?Url=%2fwellsfargo%2fdefault.aspx

Temporary https://channel9.msdn.com/Series/vstips/FindInFiles https://www.telerik.com/account/support-tickets/view-ticket/1495049

Surface Pro 7: https://www.microsoft.com/en-us/store/build/Surface-Pro-7-Pro-Type-Cover-Bundle/8T2K2LVN9QHJ?cid=&preview=&previewModes=

Telerik Training - Debugging https://www.telerik.com/videos/aspnet-ajax/tag/tutorials?utm_medium=email&utm_source=eloqua&utm_campaign=ajax-awareness-monthly-newsletter-dec20&elqTrackId=A3EDB1F7F46DD1F01A772ECC3FE804E2&elq=05f7d4846ee747dc91bafc5ad7195e04&elqaid=23397&elqat=1&elqCampaignId=22013

One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man.

https://stackoverflow.com/questions/23023916/javascript-auto-logout-code (hit from your home pc)

https://www.youtube.com/watch?v=5MC2X-LRbkE

https://github.com/BIDeveloperExtensions https://docs.microsoft.com/en-us/sql/t-sql/functions/spid-transact-sql?view=sql-server-ver15

farzinmonsef commented 4 years ago

public List FindAllTransactions(RoleType userRole //DataSourceRequest request )//User currentUser) { DateTime dt1 = DateTime.Now;

        //.Join(Db.Types, tr => tr.TransactionType, ty => ty.Id, (tr, ty) => new { tr, ty })
        //.Join(Db.Types, tra => tra.tr.Status, typ => typ.Id, (tra, typ) => new { tra, typ })
        //.Join(Db.Types, tran => tran.tra.tr.CategoryId, type => type.Id, (tran, type) => new { tran, type })
        //.Join(Db.Types, trans => trans.tran.tra.tr.PlanName, type => type.Id, (trans, typee) => new { trans, typee })            

        int categoryId = RoleToCategory((int)userRole);
        var transactions = new List<TransactionDTO>();
        var query = Db.Transactions
            .SelectMany(tr => Db.Types.Where(type => type.Id == tr.TransactionType).DefaultIfEmpty(), (tr, ty) => new { tr, ty })
            .SelectMany(tra => Db.Types.Where(type => type.Id == tra.tr.Status).DefaultIfEmpty(), (tra, typ) => new { tra, typ })
            .SelectMany(tran => Db.Types.Where(type => type.Id == tran.tra.tr.CategoryId).DefaultIfEmpty(), (tran, type) => new { tran, type })
            .SelectMany(trans => Db.Types.Where(type => type.Id == trans.tran.tra.tr.PlanName).DefaultIfEmpty(), (trans, typee) => new { trans, typee })
            .Where(x => (userRole != RoleType.Administrator ? x.trans.tran.tra.tr.CategoryId == categoryId : 1 == 1))
            .Select(x => new TransactionDTO
            {
                Id = x.trans.tran.tra.tr.Id,
                CategoryId = x.trans.tran.tra.tr.CategoryId,
                Category = x.trans.type.Name,
                SubCategoryId = x.trans.tran.tra.tr.SubCategoryId,
                TransactionType = x.trans.tran.tra.tr.TransactionType,
                EntryDate = x.trans.tran.tra.tr.EntryDate,
                TransactionEffectiveDate = x.trans.tran.tra.tr.TransactionEffectiveDate,
                RequisitionNumber = x.trans.tran.tra.tr.RequisitionNumber,
                ReserveName = x.trans.tran.tra.tr.ReserveName,
                TotalVestedShares = x.trans.tran.tra.tr.TotalVestedShares,
                SharesForTax = x.trans.tran.tra.tr.SharesForTax,
                ValueOfTaxShares = x.trans.tran.tra.tr.ValueOfTaxShares,
                NetSharesToMerrillLynch = x.trans.tran.tra.tr.NetSharesToMerrillLynch,
                TotalShares = x.trans.tran.tra.tr.TotalShares,
                Memo = x.trans.tran.tra.tr.Memo,
                Attachments = x.trans.tran.tra.tr.Attachments,
                Status = x.trans.tran.tra.tr.Status,
                StatusName = x.trans.tran.typ.Name,
                Actions = x.trans.tran.tra.tr.Actions,
                FileName = x.trans.tran.tra.tr.FileName,
                ApprovedById = x.trans.tran.tra.tr.ApprovedById,
                ApprovedOn = x.trans.tran.tra.tr.ApprovedOn,
                MailedById = x.trans.tran.tra.tr.MailedById,
                MailedOn = x.trans.tran.tra.tr.MailedOn,
                CreatedById = x.trans.tran.tra.tr.CreatedById,
                CreatedOn = x.trans.tran.tra.tr.CreatedOn,
                ModifiedById = x.trans.tran.tra.tr.ModifiedById,
                ModifiedOn = x.trans.tran.tra.tr.ModifiedOn,
                PlanName = x.trans.tran.tra.tr.PlanName,
                GrossStockUnitsDistributed = x.trans.tran.tra.tr.GrossStockUnitsDistributed,
                NetStockUnitSharestoDistribute = x.trans.tran.tra.tr.NetStockUnitSharestoDistribute,
                CancelandRetireShares = x.trans.tran.tra.tr.CancelandRetireShares,
                TypeName = x.trans.tran.tra.ty.Name,
                TypePlanName = x.typee.Name,
                CommonRestrictedUnvestedSharesGranted = x.trans.tran.tra.tr.CommonRestrictedUnvestedSharesGranted,
                CommonRestrictedUnvestedSharesFROMCR1 = x.trans.tran.tra.tr.CommonRestrictedUnvestedSharesFROMCR1,
                CommonRestrictedUnvestedSharesINTOCR1 = x.trans.tran.tra.tr.CommonRestrictedUnvestedSharesINTOCR1,
                CommonRestrictedShareINTOCR2 = x.trans.tran.tra.tr.CommonRestrictedShareINTOCR2,
                DirectorName = x.trans.tran.tra.tr.DirectorName,
                AccountName = x.trans.tran.tra.tr.AccountName,
                TotalTreasurySharestoRetire = x.trans.tran.tra.tr.TotalTreasurySharestoRetire,
            })
            //.ToDataSourceResult(request)
            ;

        transactions = query.ToList();
        //DateTime dt1 = DateTime.Now;
        DateTime dt2 = DateTime.Now;
        TimeSpan span = dt2 - dt1;
        int ms = (int)span.TotalMilliseconds;
        Debug.WriteLine("Total, time(ms)= " + ms.ToString());
        return transactions;
farzinmonsef commented 4 years ago

@using Entitites @using EQM.Enumerations; @{ViewBag.Title = "Transactions"; }

@(Html.Kendo().Grid() .Name("transactiongrid") .Columns(columns => { columns.Bound(c => c.Id).Title("ID").Filterable(filterable => filterable.UI("integerFilter")); ;//.ClientTemplate("#= kendo.toString(Id, \'n0\')#"); /*.Hidden();*/ columns.Bound(c => c.Category).Title("Category"); columns.Bound(c => c.TypeName).Title("Transaction Type"); columns.Bound(c => c.EntryDate).Format("{0: MM/dd/yyyy}"); columns.Bound(c => c.TransactionEffectiveDate).Format("{0: MM/dd/yyyy}"); columns.Command(command => { command.Edit().CancelText("Cancel").UpdateText("Submit").Text("Edit"); }).Hidden(); columns.Template(@) .ClientTemplate(@"").Title("#"); columns.Bound(c => c.StatusName).Title("Status"); columns.Template(@).Width(100) .ClientTemplate(@" Edit") .Title("Actions"); columns.Command(command => command.Custom("Preview Letter") .HtmlAttributes(new { @class = "btn k-button k-grid-customCommand btnPreviewLetter k-primary" }).Click("showPreview"))//k-state-disabled k-grid-customCommand k-primary .Width(90).Hidden(!((int)Session["userRole"] == (int)RoleType.Administrator)); columns.Template(@) .ClientTemplate(@"") .Title(" "); columns.Bound(c => c.FileName).Hidden(); }) .Groupable(g => g.Enabled(true)) .ColumnMenu() .Pageable(pageable => pageable .Refresh(true) .PageSizes(true) .ButtonCount(5) .PageSizes(new string[] { "10", "20", "50", "100", "1000"}) ) .Navigatable() .Selectable(selectable => { selectable.Mode(GridSelectionMode.Single); selectable.Type(GridSelectionType.Row); }) .ClientDetailTemplateId("template") .Sortable(sortable => { sortable.SortMode(GridSortMode.SingleColumn); }) .Filterable() .Scrollable(scrollable => scrollable.Enabled(false)) .Editable(ed => ed.Mode(GridEditMode.PopUp) .DisplayDeleteConfirmation(false) .TemplateName("_EditTransaction") .Window(w => w.Title("Add/Edit Transaction") .Width(1050) .Scrollable(false) .Name("EditTransaction") ) ) .Events(events => { events.DataBound("onTransactionDataBound"); events.Change("onTransactionChange"); events.Edit("onTransactionEdit"); events.Cancel("onTransactionCancel"); events.Save("onTransactionSave"); }) .Resizable(resize => resize.Columns(true)) .DataSource(dataSource => dataSource .Ajax() .ServerOperation(true) .Filter(filters => { filters.Add(TransactionDTO => TransactionDTO.StatusName).IsEqualTo("Pending"); }) .Model(model => { model.Id(p => p.Id); model.Field(t => t.Id).Editable(false); }) .PageSize(10) .Events(events => { events.Error("data_error_handler"); }) .Read(read => read.Action("ListAllTransactions", "Transaction")) .Create(create => create.Action("Transactions_Create", "Transaction")) .Update(update => update.Action("Transactions_Update", "Transaction")) .Destroy(destroy => destroy.Action("Transactions_Destroy", "Transaction")) ) )


@(Html.Kendo().Window() .Name("windowPreview") .Title("Preview Letter") .Modal(true) .Visible(false) .Content(@


[BOA-Logo]
Equity Management Communication

[Title]

To: [To]
From: [From]
 
Under the terms of the Bank of America Key 2003 Employee Equity Plan, we instruct you as follows:
[Title]
♦  Requisition Number: [RequisitionNumber]
♦  Effective Date: [TransactionEffectiveDate]
♦  Debit: [ReserveName]
♦  Debit Shares: [TotalVestedShares]
♦  Credit: Restricted Stock Account for Stock Plan Participants
♦  Credit Shares: [TotalVestedShares]
 
 
Approved By: [Approved]
Corporate Title: [CorporateTitle]
 
Prepared by: [Prepared]
Date: [EntryDate]
 
Bank of America N.A. Member FDIC © [LetterYear] Bank of America Corporation. All rights reserved
 
    <p style="text-align:center;padding: 50px">
        <input type="button" class="k-button" name="cancelemailLetter" value="Cancel" onclick="cancelemailLetter()">
        <input type="button" class="k-button k-primary" name="emailLetter" value="Send Email to ComputerShare" onclick="emailLetter()">&nbsp;&nbsp;&nbsp;
    </p>
</text>)

.Draggable() .Resizable() .Width(800) .Actions(actions => actions.Pin().Minimize().Maximize().Close()) .Events(ev => ev.Close("onWindowClose")) )

<div id="alertboxmodal" style="display: none; / Hidden by default / position: fixed; / Stay in place / z-index: 9999; / Sit on top / padding-top: 100px; / Location of the box / left: 0; top: 0; width: 100%; / Full width / height: 100%; / Full height / overflow: auto; / Enable scroll if needed / background-color: rgb(0,0,0); / Fallback color / background-color: rgba(0,0,0,0.4); / Black w/ opacity /" class="alertboxmodal"> <div style="background-color: #fefefe; margin: auto; padding: 20px; border: 1px solid #888; width: 40%;" class="alertbox-content">

×
MY-TITLE-HERE
Success MY-MESSAGE-HERE
MY-FOOTER-HERE    
</div>

farzinmonsef commented 4 years ago

Number.cshtml

@model double?

@(Html.Kendo().NumericTextBoxFor(m => m) .HtmlAttributes(new { style = "width:100%" }) )

farzinmonsef commented 4 years ago

NumberFormated.cshtml

@model double?

@(Html.Kendo().NumericTextBoxFor(m => m) .Format("###,###,###,###,###,###,###,###,###.##") .HtmlAttributes(new { style = "width: 100%"}) .Spinners(false) )

@

@ @@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("######,###,###,###,###,###,###,###") // Set the mask value of the MaskedTextBox. .HtmlAttributes(new { style = "width:100%;text-align: right;" }) / , @class = "k-rtl" / )@ @
@

@@Html.TextBoxFor(model => model, "{0:c}", //"{0:N2}0", new { style = "border-color: green; ", @class= "k-textbox" })@ @maxlength = 10,@

@@{ IFormatProvider formatProvider = new System.Globalization.CultureInfo("en-US"); String.toString(@Model, "C", formatProvider) }@ @@Html.EditorFor(m => m)@

@

@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("###") .HtmlAttributes(new { style = "width: 100%;text-align:right"}) )
@ @@Html.TextBoxFor(m => m)@ @@Html.DisplayFor(m=>m)@ @@Html.Editor(m =>m)@ @@Html.EditorFor(m => m)@ @@(Html.Kendo().NumericTextBoxFor(m => m) .Format("#.00") .HtmlAttributes(new { style = "width: 100%"}) )@ @@(Html.Kendo().NumericTextBoxFor(m => m) .HtmlAttributes(new { style = "width:100%" }) )@

farzinmonsef commented 4 years ago

NumberFormated2Fraction.cshtml

@model double?

@(Html.Kendo().NumericTextBoxFor(m => m) .Format("$###,###,###,###,###,###,###,###,###.00") .HtmlAttributes(new { style = "width: 100%"}) .Spinners(false) )

@

@ @@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("######,###,###,###,###,###,###,###") // Set the mask value of the MaskedTextBox. .HtmlAttributes(new { style = "width:100%;text-align: right;" }) / , @class = "k-rtl" / )@ @
@

@@Html.TextBoxFor(model => model, "{0:c}", //"{0:N2}0", new { style = "border-color: green; ", @class= "k-textbox" })@ @maxlength = 10,@

@@{ IFormatProvider formatProvider = new System.Globalization.CultureInfo("en-US"); String.toString(@Model, "C", formatProvider) }@ @@Html.EditorFor(m => m)@

@

@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("###") .HtmlAttributes(new { style = "width: 100%;text-align:right"}) )
@ @@Html.TextBoxFor(m => m)@ @@Html.DisplayFor(m=>m)@ @@Html.Editor(m =>m)@ @@Html.EditorFor(m => m)@ @@(Html.Kendo().NumericTextBoxFor(m => m) .Format("#.00") .HtmlAttributes(new { style = "width: 100%"}) )@ @@(Html.Kendo().NumericTextBoxFor(m => m) .HtmlAttributes(new { style = "width:100%" }) )@

farzinmonsef commented 4 years ago

NumberFormatedDisbled.cshtml

@model int?

@@Html.DisplayFor(m => m)@

@@{Html.DisplayForModel();}@

@(Html.Kendo().TextBoxFor(m => m) //.Format("###,###,###,###,###,###,###,###,###") .HtmlAttributes(new { style = "width:100%;", @class = "k-state-disabled" }) //.HtmlAttributes(new { style = "width: 100%" }) //.Spinners(false) ) @@(Html.Kendo().NumericTextBoxFor(m => m) .Format("#") .HtmlAttributes(new { style = "width:100%;", @class = "k-state-disabled" }) //.HtmlAttributes(new { style = "width: 100%" }) .Spinners(false) )@

@

@ @@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("######,###,###,###,###,###,###,###") // Set the mask value of the MaskedTextBox. .HtmlAttributes(new { style = "width:100%;text-align: right;" }) / , @class = "k-rtl" / )@ @
@

@@Html.TextBoxFor(model => model, "{0:c}", //"{0:N2}0", new { style = "border-color: green; ", @class= "k-textbox" })@ @maxlength = 10,@

@@{ IFormatProvider formatProvider = new System.Globalization.CultureInfo("en-US"); String.toString(@Model, "C", formatProvider) }@ @@Html.EditorFor(m => m)@

@

@(Html.Kendo().MaskedTextBoxFor(m => m) .Mask("###") .HtmlAttributes(new { style = "width: 100%;text-align:right"}) )
@ @@Html.TextBoxFor(m => m)@ @@Html.DisplayFor(m=>m)@ @@Html.Editor(m =>m)@ @@Html.EditorFor(m => m)@ @@(Html.Kendo().NumericTextBoxFor(m => m) .Format("#.00") .HtmlAttributes(new { style = "width: 100%"}) )@ @@(Html.Kendo().NumericTextBoxFor(m => m) .HtmlAttributes(new { style = "width:100%" }) )@

farzinmonsef commented 4 years ago

DropDownCategory.cshtml

@model object

@(Html.Kendo().DropDownListFor(m => m) .DataValueField("Id") .DataTextField("Name") .OptionLabel("- Select Category -") .Name("Category") .BindTo((System.Collections.IEnumerable)Session["CategoryList"]) .HtmlAttributes(new { style = "width:100%" }) /@class="k-textbox",/ .Events(e => { e.Change("onChangeCategory") //.Select("onSelect").Open("onOpen").Close("onClose").DataBound("onDataBound").Filtering("onFiltering") ; }))

farzinmonsef commented 4 years ago

DropDownPlanName.cshtml

@model object

@(Html.Kendo().DropDownListFor(m => m) .DataValueField("Id") .DataTextField("Name") .OptionLabel("- Select Plan Name -") .Name("PlanName") .BindTo((System.Collections.IEnumerable)Session["PlanNameList"]) .HtmlAttributes(new { style = "width:100%" }) /@class="k-textbox",/ )

farzinmonsef commented 4 years ago

DropDownTransactionType.cshtml

@model object

@(Html.Kendo().DropDownListFor(m => m) .DataValueField("Id") .DataTextField("Name") .OptionLabel("- Select Type -") .Name("TransactionType") //.BindTo((System.Collections.IEnumerable)Session["TransactionTypeList"]) .HtmlAttributes(new { style = "width:100%;" }) /@class="k-textbox",/ .Events(e => { e .Change("onDDTransactionTypeChange") .Select("onDDTransactionTypeSelect") //.Open("onDDTransactionTypeOpen") //.Close("onDDTransactionTypeClose") //.DataBound("onDDTransactionTypeDataBound") //.Filtering("onDDTransactionTypeFiltering") ; }) )

farzinmonsef commented 4 years ago

_EditTransaction.cshtml

@model Entitites.Transaction @{ ViewBag.Title = "Edit Transaction"; }

@@using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "formclass" }))@ @using (Html.BeginForm(null, null, FormMethod.Post, null)) { @Html.AntiForgeryToken() @Html.ValidationSummary(true, "", new { @class = "text-danger" })

@**@
@Html.LabelFor(model => model.CategoryId, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CategoryId, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CategoryId, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Id, htmlAttributes: new { @class = "control-label" })  : 
@Html.EditorFor(model => model.Id, new { htmlAttributes = new { @class = "form-control" } })
@Html.LabelFor(model => model.TransactionType, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.TransactionType, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.TransactionType, "", new { @class = "text-danger" })
@Html.EditorFor(model => model.EntryDate, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.EntryDate, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.TransactionEffectiveDate, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.TransactionEffectiveDate, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.TransactionEffectiveDate, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.RequisitionNumber, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.RequisitionNumber, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.RequisitionNumber, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.SharesForTax, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.SharesForTax, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.SharesForTax, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.ReserveName, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.ReserveName, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.ReserveName, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.PlanName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.PlanName, new { htmlAttributes = new { @class = "INTO CR1-control" } }) @Html.ValidationMessageFor(model => model.PlanName, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.TotalVestedShares, htmlAttributes: new { @class = "control-label " })
@Html.EditorFor(model => model.TotalVestedShares, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.TotalVestedShares, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.ValueOfTaxShares, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.ValueOfTaxShares, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.ValueOfTaxShares, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.DirectorName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.DirectorName, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.DirectorName, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.NetSharesToMerrillLynch, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.NetSharesToMerrillLynch, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.NetSharesToMerrillLynch, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.TotalShares, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.TotalShares, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.TotalShares, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.AccountName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.AccountName, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.AccountName, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.TotalTreasurySharestoRetire, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.TotalTreasurySharestoRetire, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.TotalTreasurySharestoRetire, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.GrossStockUnitsDistributed, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.GrossStockUnitsDistributed, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.GrossStockUnitsDistributed, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.NetStockUnitSharestoDistribute, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.NetStockUnitSharestoDistribute, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.NetStockUnitSharestoDistribute, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.CommonRestrictedUnvestedSharesGranted, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CommonRestrictedUnvestedSharesGranted, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CommonRestrictedUnvestedSharesGranted, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.CommonRestrictedUnvestedSharesFROMCR1, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CommonRestrictedUnvestedSharesFROMCR1, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CommonRestrictedUnvestedSharesFROMCR1, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.CancelandRetireShares, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CancelandRetireShares, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CancelandRetireShares, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.CommonRestrictedShareINTOCR2, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CommonRestrictedShareINTOCR2, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CommonRestrictedShareINTOCR2, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.CommonRestrictedUnvestedSharesINTOCR1, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.CommonRestrictedUnvestedSharesINTOCR1, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.CommonRestrictedUnvestedSharesINTOCR1, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.DirectorName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.DirectorName, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.DirectorName, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Memo, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.Memo, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Memo, "", new { @class = "text-danger" })
@Html.LabelFor(model => model.Attachments, htmlAttributes: new { @class = "control-label" })
@(Html.Kendo().Upload() .Name("files") .Multiple(false) .Async(a => a .Save("Async_Save", "TransUpload") .Remove("Async_Remove", "TransUpload") .AutoUpload(true) ) .HtmlAttributes(new { @style = "background-color: darkblue; color: white;" }) .Events(events => events .Cancel("onUploadCancel") .Complete("onUploadComplete") .Error("onUploadError") .Progress("onUploadProgress") .Remove("onUploadRemove") .Select("onUploadSelect") .Success("onUploadSuccess") .Upload("onUploadUpload") ) )
@Html.LabelFor(model => model.FileName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.FileName, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.FileName, "", new { @class = "text-danger" })

}

farzinmonsef commented 4 years ago

File Download

https://forums.asp.net/t/2005710.aspx?i+ve+a+file+in+kendo+ui+grid+i+want+to+download+it+Im+doing+this+in+MVC

farzinmonsef commented 4 years ago

Webinar = Test Studio R2 2020 Release

https://launch.gotowebinar.com/join/webinars/3464285570395076619/attendees/722670476

farzinmonsef commented 4 years ago

animation

https://stackoverflow.com/questions/22914684/flip-a-div-180-degrees-using-css-and-javascript https://codepen.io/ImageHoverEffects/pen/GfJLg

farzinmonsef commented 4 years ago

Telerik Reporting Seminar

Recorded file:

https://www.telerik.com/webinars/reporting/reporting-in-depth-webinar-how-to-streamline-your-reporting-with-ease

farzinmonsef commented 4 years ago

Tlerik Q

https://www.telerik.com/account/support-tickets/view-ticket/1486383

https://www.telerik.com/forums/context-menu-on-a-grid-item-row

https://stackoverflow.com/questions/6150289/how-can-i-convert-an-image-into-base64-string-using-javascript

farzinmonsef commented 3 years ago

<!DOCTYPE html>

farzinmonsef commented 3 years ago

Logout

Stack Overflow About Products For Teams Search…

Home PUBLIC Stack Overflow Tags Users FIND A JOB Jobs Companies TEAMS What’s this? Free 30 Day Trial Javascript auto logout code Asked 6 years, 9 months ago Active 1 year, 6 months ago Viewed 44k times

11

7 I have the below code which works for the most part but I am wondering if its possible to tweak it a bit. So what the below code does is if their is no mouse activity for x number of milliseconds a popup window is displayed saying that they will be logged out and then when / if you eventually click the ok button the script will automatically bring you to the logout file.

However what I would like to do instead is if the ok button is not clicked after x number of milliseconds just to go ahead and bring the screen to the logout.php file anyway. Anyone know how I might do this with the below code? Thanks

// Set timeout variables. var timoutWarning = 840000; // Display warning in 14 Mins. var timoutNow = 100000; // Timeout in 15 mins would be 900000. var logoutUrl = 'logout.php'; // URL to logout page.

var warningTimer; var timeoutTimer;

// Start timers. function StartTimers() { warningTimer = setTimeout("IdleWarning()", timoutWarning); timeoutTimer = setTimeout("IdleTimeout()", timoutNow); }

// Reset timers. function ResetTimers() { clearTimeout(warningTimer); clearTimeout(timeoutTimer); StartTimers(); $("#timeout").dialog('close'); }

// Show idle timeout warning dialog. function IdleWarning() { // $("#timeout").dialog({ //modal: true alert("Warning, your page will redirected to login page. Due to not move your mouse within the page in 15 minutes."); //}); }

// Logout the user. function IdleTimeout() { window.location = logoutUrl; } javascript Share Improve this question Follow edited Mar 17 '16 at 5:53

Ali Zia 3,49933 gold badges2222 silver badges5959 bronze badges asked Apr 11 '14 at 22:57

Jayreis 21511 gold badge44 silver badges2323 bronze badges 2 I hope keyboard activity also resets your timer. – Stephen P Apr 12 '14 at 0:11 What if the user turns off javascript? – Vbudo Jul 17 '20 at 1:48 add a comment 4 Answers

18

Conceptually, you only need 1 timer running at a time. One timer that runs for 14 minutes and another that runs for another minute (15 minutes total). Once the 14 minute timer runs out, kill it and then start the 1 minute timer. If that one minute timer runs out, log the user out. If the user presses the "Stay Logged In" button, kill the 1 minute timer and restart the 14 minute timer. Rinse and repeat.

I changed your code the best I could. Hope you get the point.

// Set timeout variables. var timoutWarning = 840000; // Display warning in 14 Mins. var timoutNow = 60000; // Warning has been shown, give the user 1 minute to interact var logoutUrl = 'logout.php'; // URL to logout page.

var warningTimer; var timeoutTimer;

// Start warning timer. function StartWarningTimer() { warningTimer = setTimeout("IdleWarning()", timoutWarning); }

// Reset timers. function ResetTimeOutTimer() { clearTimeout(timeoutTimer); StartWarningTimer(); $("#timeout").dialog('close'); }

// Show idle timeout warning dialog. function IdleWarning() { clearTimeout(warningTimer); timeoutTimer = setTimeout("IdleTimeout()", timoutNow); $("#timeout").dialog({ modal: true }); // Add code in the #timeout element to call ResetTimeOutTimer() if // the "Stay Logged In" button is clicked }

// Logout the user. function IdleTimeout() { window.location = logoutUrl; } Share Improve this answer Follow edited Feb 13 '17 at 2:01 answered Apr 11 '14 at 23:44

VtoCorleone 13.5k44 gold badges3232 silver badges4747 bronze badges 4 This will not work when multiple tabs are open. because clearTimeout(); does not work across multiple tabs. – niranjan harpale Feb 19 '19 at 13:29 add a comment

6

update to @VtoCorleone's answer :

var warningTimeout = 840000; var timoutNow = 60000; var warningTimerID,timeoutTimerID;

function startTimer() { // window.setTimeout returns an Id that can be used to start and stop a timer warningTimerID = window.setTimeout(warningInactive, warningTimeout); }

function warningInactive() { window.clearTimeout(warningTimerID); timeoutTimerID = window.setTimeout(IdleTimeout, timoutNow); $('#modalAutoLogout').modal('show'); }

function resetTimer() { window.clearTimeout(timeoutTimerID); window.clearTimeout(warningTimerID); startTimer(); }

// Logout the user. function IdleTimeout() { document.getElementById('logout-form').submit(); }

function setupTimers () { document.addEventListener("mousemove", resetTimer, false); document.addEventListener("mousedown", resetTimer, false); document.addEventListener("keypress", resetTimer, false); document.addEventListener("touchmove", resetTimer, false); document.addEventListener("onscroll", resetTimer, false); startTimer(); }

$(document).on('click','#btnStayLoggedIn',function(){ resetTimer(); $('#modalAutoLogout').modal('hide'); });

$(document).ready(function(){ setupTimers(); }); Share Improve this answer Follow answered Jul 12 '19 at 18:06

Saurabh Mistry 8,29711 gold badge3030 silver badges4545 bronze badges add a comment

2

I had to do the same functionality for our project. Used the following code:-

The above code will set a timer every time we click anywhere on the screen. In case we don't click it auto-logs out to home screen.

Share Improve this answer Follow answered Jan 12 '18 at 9:59

Snehal Bhusal 5122 bronze badges The problem with this solution is that keeping the mouse on a text field doesn't fire off the timer. – ConfusedDeer Oct 12 '18 at 2:23 1 this will not work when multiple tabs(of your site) are open. – niranjan harpale Feb 19 '19 at 13:20 1 As far as, my observation goes, clearTimeout(); does not work across multiple tabs. – niranjan harpale Feb 19 '19 at 13:21 add a comment

1

Share Improve this answer Follow answered Jul 11 '18 at 5:55

Priyabrat Rath 3122 bronze badges add a comment Your Answer Sign up or log in Post as a guest Name Email Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged javascript or ask your own question. The Overflow Blog Episode 304: Our stack is HTML and CSS Have the tables turned on NoSQL? Linked 1 How to delete 'Authorization Code Flow with PKCE' session when browser is closed 0 javascript autologout for inactivity for 10 minutes 0 Show A Popup Warning Before Session Timeout 0 Logout automatically after 1 minutes using php Related 4691 How to validate an email address in JavaScript 7632 How do JavaScript closures work? 5176 What is the most efficient way to deep clone an object in JavaScript? 6418 How do I remove a property from a JavaScript object? 4189 How do you get a timestamp in JavaScript? 5661 Which equals operator (== vs ===) should be used in JavaScript comparisons? 5473 How do I include a JavaScript file in another JavaScript file? 7739 What does “use strict” do in JavaScript, and what is the reasoning behind it? 7421 How to check whether a string contains a substring in JavaScript? 4895 For-each over an array in JavaScript Hot Network Questions How did Trump's January 6 speech call for insurrection and violence? Should a gas Aga be left on when not in use? Removing my characters does not change my meaning Noun to describe a person who wants to please everybody, but sort of in an obsessed manner Numerically stable way to compute sqrt((b²*c²) / (1-c²)) for c in [-1, 1] Is it at all possible for the sun to revolve around as many barycenters as we have planets in our solar system? Explain for kids — Why isn't Northern Ireland demanding a stay/leave referendum like Scotland? How to express that the sausages are made with good quality meat with a shorter sentence? When does "copying" a math diagram become plagiarism? Thickening letters for tefillin and mezuzos Why are the edges of a broken glass almost opaque? Realistic Light Reflection Chess Tournament Simulator What would cause a culture to keep a distinct weapon for centuries? When Japanese people talk to themselves, do they use formal or informal? When was the phrase "sufficiently smart compiler" first used? Does a Bugbear PC take damage when holding an enemy on the other side of a Wall of Fire with Grapple? Is my back-of-the-envelope calculation about taking out a loan to invest into the markets flawed? Checkmate but confused why Why can't stars be multicolored like gas giants? How would Muslims adapt to follow their prayer rituals in the loss of Earth? Why is the air inside an igloo warmer than its outside? Languages with different words for 'we' Why are tuning pegs (aka machine heads) different on different types of guitars? Question feed

STACK OVERFLOW Questions Jobs Developer Jobs Directory Salary Calculator Help Mobile Disable Responsiveness PRODUCTS Teams Talent Advertising Enterprise COMPANY About Press Work Here Legal Privacy Policy Terms of Service Contact Us STACK EXCHANGE NETWORK Technology Life / Arts Culture / Recreation Science Other Blog Facebook Twitter LinkedIn Instagram site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.1.15.38320

farzinmonsef commented 3 years ago

GSplit

gsplitp.zip