This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
namespace <Project>.CMD | |
{ | |
public static class Utils |
This file contains 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 bool Update<T>(long id, T updatedObj) | |
{ | |
using (DBContext db = new DbContext()) | |
{ | |
var originalObj = db.T.Where(x => x.id == id).FirstOrDefault(); | |
var rawObj = new T(); | |
if (originalObj != null) | |
{ | |
foreach (PropertyInfo propertyInfo in updatedObj.GetType().GetProperties()) | |
{ |
This file contains 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
// query= a Query object containing a search string | |
DateTime searchTime; | |
if (DateTime.TryParse(query.Search, out searchTime)) | |
{ | |
DateTime endTime = searchTime + new TimeSpan(24, 0, 0); | |
IQueryable linq = dbContext.DataTable | |
.Where(x => x.TimeStamp >= searchTime) | |
.Where(x => x.TimeStamp <= endTime); |
This file contains 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
<template> | |
<div > | |
<!-- content --> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'NAME_OF_COMOPONENT', | |
data () { |
This file contains 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 class OnlyDateConverter: IsoDateTimeConverter | |
{ | |
public OnlyDateConverter() | |
{ | |
DateTimeFormat = "dd-MM-yyyy"; | |
} | |
} |
This file contains 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 class CustomFileStreamContent : StreamContent | |
{ | |
string filePath; | |
public CustomFileStreamContent(Stream fileStream, string filePath) : base(content: fileStream) | |
{ | |
this.filePath = filePath; | |
} | |
private CustomFileStreamContent(Stream fileStream) : base(content: fileStream) |
This file contains 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 interface IQueryMultiple | |
{ | |
bool Descending { get; } | |
bool HasQuery { get; } | |
bool HasSearch { get; } | |
string OrderBy { get; set; } | |
int Page { get; set; } | |
int PageCount { get; set; } | |
string Search { get; set; } | |
} |
This file contains 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
<div class="modal-mask"> | |
<div class="modal-wrapper"> | |
<div class="modal-container"> | |
<div class="container-fluid"> | |
<div class="row"> | |
<div class="col-sm-3"> | |
</div> | |
<div class="col-sm-6"> | |
<i class="fas fa-exclamation-triangle fa-5x" style="color: #d33a1f"></i> | |
</div> |
This file contains 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
<div class="row"> | |
<div class="col-sm-12"> | |
<i class="fas fa-cog fa-spin fa-2x"></i> | |
<span> Loading ...</span> | |
<i class="fas fa-cog fa-spin fa-2x"></i> | |
</div> | |
</div> |