This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] | |
| public class SessionExpireFilterAttribute : ActionFilterAttribute | |
| { | |
| public override void OnActionExecuting(ActionExecutingContext filterContext) | |
| { | |
| var ctx = HttpContext.Current; | |
| if (ctx.Session["RegisteredUser"] == null || !filterContext.HttpContext.Request.IsAuthenticated) | |
| { | |
| FormsAuthentication.SignOut(); | |
| ctx.Session.Clear(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## bug tracking applications for developers | |
| + [BugLog](http://www.bugloghq.com/) (opensource) | |
| + [BugNET Issue Tracker](http://www.bugnetproject.com/) (commercial, opensource) | |
| + [Trac](http://trac.edgewall.org/) | |
| + [Bugzilla](http://www.bugzilla.org/) (opensource) | |
| + [Snowy Evening](https://snowy-evening.com/) | |
| + [MantisBT](http://www.mantisbt.org/) (commercial, free plan) | |
| + [Bugify](https://bugify.com/) (commercial) | |
| + [Lighthouse](http://lighthouseapp.com/) (commercial) | |
| + [TheBuggenie](http://www.thebuggenie.com/) (commercial) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Crud | |
| { | |
| public static int Save<T>(this T entity, ZeiterfassungsContext ctx) where T : class, ICrud | |
| { | |
| if (entity == null) | |
| throw new ArgumentNullException("entity", "Die Entität darf nicht null sein"); | |
| return Exists(entity, "Id", ctx) ? Update(entity, ctx) : Insert(entity, ctx); | |
| } | |
| public static int Insert<T>(this T entity, ZeiterfassungsContext ctx) where T : class, ICrud |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class BindableExtender { | |
| public static string GetBindableText(DependencyObject obj) { | |
| return (string)obj.GetValue(BindableTextProperty); | |
| } | |
| public static void SetBindableText(DependencyObject obj, | |
| string value) { | |
| obj.SetValue(BindableTextProperty, value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db.Database.SqlCommand("dbo.News_Insert @Title, @Body, @NewsStatusId", | |
| new SqlParameter("Title", news.Title), | |
| new SqlParameter("Body", news.Body), | |
| new SqlParameter("NewsStatusId", news.NewStatus.Id)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class WaitAndRetry | |
| { | |
| public static void Do(Action action, TimeSpan waitInterval, int retryCount = 3) | |
| { | |
| Do<object>(() => { action(); return null; }, | |
| waitInterval, retryCount); | |
| } | |
| public static T Do<T>(Func<T> action, TimeSpan waitInterval, int retryCount = 3) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //https://stackoverflow.com/a/17488875/119109 | |
| $.fn.serializeObject = function() | |
| { | |
| var o = {}; | |
| var a = this.serializeArray(); | |
| $.each(a, function() { | |
| if (o[this.name]) { | |
| if (!o[this.name].push) { | |
| o[this.name] = [o[this.name]]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public ActionResult Export(ViewModel model) | |
| { | |
| var fileData = _repo.GetFile(model...); | |
| var serializer = new JavaScriptSerializer { MaxJsonLength = Int32.MaxValue, RecursionLimit = 100 }; | |
| var dataJson = new DownloadAjaxResult(true) | |
| { | |
| File = fileData, | |
| Filename = model.Filename | |
| }; | |
| return new ContentResult() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE s | |
| SET s.IsFreezed = 1 | |
| FROM [DBNAME].[dbo].[COLUMN] AS s | |
| INNER JOIN [DBNAME].[dbo].[COLUMN] AS m | |
| ON s.Id = m.StatusId | |
| WHERE m.Subject = 'xxxxx' | |
| AND s.HasSent = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- replaced the first old characters with new signs | |
| update [DATABASE].[dbo].[TABLE] set COLUMN = stuff(COLUMN, 1, 12, 'E:\Daten\LIVE\') |
OlderNewer