|
|
Always best to try your own searches before posting questions.
|
|
|
|
|
The basics of .NET Core are, that this framework is highly extensible. There is nothing, by default in it. You add everything from scratch. Angular, Node.js, NPM etc. They are all added by the developers and you have to add them yourself as well.
There are however, templates provided, that you can use to create a new project.
Have a look here, Create an Angular 2 and .NET Core app that can be edited using Visual Studio 2017 - jonhilton.net, this provides a command that you can use to install extra packages and then utilize them in your projects by creating a new template-based project.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Just wondering if anyone has had some luck with integrating lightSlider, bootstrap and MVC.
I wrote something from scratch that worked better, but had trouble overlaying navigation over the pictures, otherwise it resized correctly with phones and desktops.
So I decided to try lightSlider since Sputnik was using it. Seems well written, but I can't figure out how to resize the pictures for various devices.
It's too tall for desktop use and wanted to scale it down. On phones in portrait, I get full picture height but it overflows hidden; and landscape it's just too tall for the screen.
You can see what I have here
http://50.20.227.154/Portfolio/Viewer/0
Just poking around for insight.
If it ain't broke don't fix it
|
|
|
|
|
Well I skipped over fixing the lightSlider and added the light-gallery to it. Then used my bower.json file to load both plugins automatically, and gulp to distribute the files correctly throughout the project. After getting all of that to work, I went back to doing research on the lightSlider and started going through a handful of tutorials.
Finally found this one
Js Tutorial - lightSlider - A lightweight touchable responsive Content slider
Which seemed to offer the best information on how to set it up.
So if all boiled down to the config file. So to save any one having the same trouble, here's a sample of what I used.
Still messing with the responsive properties to see how they work. Now that I have a stronger foundation, I can now build it out.
Overall, this lightSlider plugin is pretty slick, and the guy did a nice job writing it.
$(document).ready(function () {
$('#lightSlider').lightSlider({
item: 1,
autoWidth: false,
slideMove: 1,
slideMargin: 10,
addClass: '',
mode: "slide",
useCSS: true,
cssEasing: 'ease',
easing: 'linear',
speed: 400,
auto: false,
loop: false,
slideEndAnimation: true,
pause: 2000,
keyPress: false,
controls: true,
prevHtml: '',
nextHtml: '',
rtl: false,
adaptiveHeight: false,
vertical: false,
verticalHeight: 500,
vThumbWidth: 100,
thumbItem: 10,
pager: false,
gallery: true,
galleryMargin: 5,
thumbMargin: 5,
currentPagerPosition: 'middle',
enableTouch: true,
enableDrag: true,
freeMove: true,
swipeThreshold: 40,
responsive:
[
{ breakpoint: 1260, settings: { item: 2, thumbitem: 10, gallery: true, pager: true } },
{ breakpoint: 900, settings: { item: 2, thumbitem: 8, gallery: true, pager: true } },
{ breakpoint: 700, settings: { item: 1, thumbitem: 6, gallery: false, pager: true } },
{ breakpoint: 600, settings: { item: 1, thumbitem: 4, gallery: false, pager: true } }
],
onBeforeStart: function (el) { },
onSliderLoad: function (el) {
el.lightGallery({
selector: '#lightSlider .lslide',
subHtmlSelectorRelative: true
});
},
onBeforeSlide: function (el) { },
onAfterSlide: function (el) { },
onBeforeNextSlide: function (el) { },
onBeforePrevSlide: function (el) { }
});
});
If it ain't broke don't fix it
|
|
|
|
|
im using grid view, i set page size to 10 record and also put search bar to search record, the problem is that when i search record it shows records that is about 30 on page change it is reset to the default rather then show record on page 2 related to my search
|
|
|
|
|
You mean, you need to trim down the amount of results shown on the page?
Why are you selecting more than 10 records in the very first place? You should return only 10 records, on that page and then later on select the next 10 records, and so on.
You should also look at Pagination in ASP.NET, that will help you a lot in showing a better UX to the readers, who want to get something from your web application, read the following posts,
GridView Examples for ASP.NET 2.0: Paging and Sorting the GridView's Data
How To Implement Paging in GridView Control in ASP.NET
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello Dudes,
I need a project on Employee leave management with timesheet, payroll and leave management using Asp.Net C#. please anyone provide me that code.
Thanks in advance.
Prasad
modified 8-May-17 14:49pm.
|
|
|
|
|
Hi Naveen,
It is not possible to get everything in a single project online. It is better to made it according to the requirement. If you want i can help you in to create that project.
|
|
|
|
|
Hi geeta goel, thank you for the replay. but at least i need leave management code and database tables. remaining parts i can implement.
|
|
|
|
|
This site is not here to provide code to order; try RentaCoder.
|
|
|
|
|
Hi Geeta goel,
Could you please give me brief description about salary structure in MNCs and also give me clarification about Leave management & Vacation Management. is leave and vacation both are same or different? how salaries calculated if any leave or vacation in a month. please give me example with 2 employees info.
Eagerly waiting for your response.
Thanks in Advance,
Prasad
|
|
|
|
|
Hello Naveen,
Leave & Vacation management both have different aspects in Corporate.
Leave also have a structure or we can say there are different types of leaves are there and they are alloted to the employees on some logical basis.
There are different ways of salary structure in MNC's. In some company's it is deciding on the grade levels and in some it is deciding on the experience basis.
It is not explained in a single paragraph. There are many logics behind the salary & leave management.
|
|
|
|
|
Thank you for your response.
Actually i'm implementing HRMS application. i want to include all those features like Leave,Vacation,Task,Employee Loans... etc. into one application. So, i need full clarity on Leave, Vacation and Salary Management. Till now i've completed upto employees management and task management. So, please give me at-least 50% knowledge.
What are the different ways for salary structures?
|
|
|
|
|
Hello Naveen,
There are different kinds of salary structure.
1. Hourly basis pay
2. Monthy basis pay
3. Weekly basis pay
4. Bi-weekly basis pay
It also depends that you are implementing the HRMS application for which country - India or USA or any other. There are some differences in their salary structures.
And also in salary structure, you can consider some more attributes.
I have given you a short description of the salary structures. You need to study in brief if you want to implement all full features.
|
|
|
|
|
|
I don't have time to give you the table structures, but I can tell you that you want to design the solution with effective dates; meaning Emp A is currently earning 4 hrs per month towards his PTO (paid time off), next year he will be earning 4.25 hrs per month, etc.
You will need to have a background job which adds each employee's accrued hours to a current balance bucket, also you want to have an end of year job which zeros out any unused PTO (use it or lose it).
You will need to take into consideration that if Employee A is asking for a week of vacation in July, but it is only February, you will have to perform logic such as, Current Balance + future accrued balance is that enough time ?
Also take into consideration if 3 guys from the same department want to take time off the same week August to go fishing. Will you be able to run the business ?
Leave management is a tricky thing. Lots of things to consider.
Good luck.
|
|
|
|
|
We have a spec to generate PDF from HTML inputs and send as email attachments.
We were able to use the examples on the article below to accomplish that:
https://www.aspsnippets.com/Articles/iTextSharp-Generate-PDF-in-Memory-and-send-as-Email-Attachment-using-C-VBNet-and-ASPNet.aspx
The issue is that because the article uses HTMLWorker, it is extremely difficult to format data with HTMLWorker.
So, I attempted to convert HTMLWorker to XMLWorker.
Right now, it works by inserting records into the database but the email is not getting sent.
Any ideas what I am doing wrong?
Imports iTextSharp.tool.xml
Imports iTextSharp.text.pdf
Imports System.IO
Imports System.Text
Imports System.Data
Imports System.Net
Imports System.Net.Mail
Imports iTextSharp.text.html.simpleparser
Imports System.Data.SqlClient
Imports System.Runtime.CompilerServices
Partial Class _Default
Inherits System.Web.UI.Page
Private strConn As String = ConfigurationManager.ConnectionStrings("constr").ToString()
Private sqlCon As SqlConnection
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
End If
End Sub
Protected Sub Insert(ByVal sender As Object, ByVal e As EventArgs)
System.Threading.Thread.Sleep(5000)
Try
Dim table As New DataTable()
Using con = New SqlConnection(ConfigurationManager.ConnectionStrings("constr").ConnectionString)
Using cmd = New SqlCommand("INSERT INTO Policies(userid,entrydate,signature, email) VALUES(@empID, @lDate,@signature, @email)", con)
Using da = New SqlDataAdapter(cmd)
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@empID", txtUserName.Text)
cmd.Parameters.AddWithValue("@lDate", txtDate.Text)
cmd.Parameters.AddWithValue("@signature", txtSignature.Text)
cmd.Parameters.AddWithValue("@email", txtEmail.Text)
da.Fill(table)
End Using
End Using
End Using
Dim dt As New DataTable()
dt.Columns.AddRange(New DataColumn(0) {New DataColumn(" ")})
' dt.Rows.Add(txtaffirmation.Text)
SendPDFEmail(dt)
'If the message failed at some point, let the user know
Label1.ForeColor = System.Drawing.Color.Blue
Label1.Text = "Success!<br> A copy of the completed form has been sent to your inbox. If you do not receive an email within 5 minutes (usually immediately), check your spam box."
'Reset markup controls
txtFullName.Text = ""
txtUserName.Text = ""
txtSignature.Text = ""
txtDate.Text = ""
txtEmail.Text = ""
Catch ex As Exception
'If the message failed at some point, let the user know
Label1.ForeColor = System.Drawing.Color.Red
Label1.Text = ex.Message
End Try
''reset markup controls
'ClearTextBoxes(Page)
End Sub
Private Sub SendPDFEmail(ByVal dtb As DataTable)
Dim strHtml As String
Dim memStream As New MemoryStream()
Dim strWriter As New StringWriter()
Dim FullName As String = txtFullName.Text
Dim user As String = txtUserName.Text
Dim signedName As String = txtSignature.Text
Dim lDate As String = txtDate.Text
Dim body As String = "<br />"
body = body & "<table style=""background-color:#F8F8F8"" cellspadding=""2"" border=""0"" width=""100%"" >"
For Each column As DataColumn In dtb.Columns
body = body & "<td style=""color: black"" align=""Left"">" & txtaffirmation.Text & "</td></tr></table><br>"
Next
body = body & " <br><br>"
body = body & "<table style=""background-color:#F8F8F8"" cellspadding=""2"" border=""0"" width=""100%"" >"
body = body & "<tr><td align=""left"">" & FullName & "</td>"
body = body & "<td align=""left"">" & user & "</td></tr>"
body = body & "<tr><td align=""left"">Employee Name</td>"
body = body & "<td align=""left"">Employee ID</td></tr>"
body = body & "<tr><td style=""font-family:Brush Script Std"" align=""left"">" & signedName & " </td><td align=""left"">" & " " & "</td>"
body = body & "<td align=""left"">Employee Signature</td><td align=""left"">" & " " & "</td></tr>"
body = body & "<tr><td align=""left"">" & lDate & "</td><td align=""left"">" & " " & "</td></tr>"
body = body & "<td align=""left"">Date</td><td align=""left"">" & " " & "</td></tr></table>"
strHtml = strWriter.ToString()
strWriter.Close()
strWriter.Dispose()
Dim strFileShortName As String = "test" & DateTime.Now.Ticks & ".pdf"
Dim strFileName As String = HttpContext.Current.Server.MapPath("reports\" & strFileShortName)
Dim docWorkingDocument As iTextSharp.text.Document = New iTextSharp.text.Document(iTextSharp.text.PageSize.A4.Rotate(), 1, 1, 0, 0)
Dim srdDocToString As StringReader = Nothing
Try
Dim pdfWrite As PdfWriter
pdfWrite = PdfWriter.GetInstance(docWorkingDocument, New FileStream(strFileName, FileMode.Create))
srdDocToString = New StringReader(strHtml)
docWorkingDocument.Open()
XMLWorkerHelper.GetInstance().ParseXHtml(pdfWrite, docWorkingDocument, srdDocToString)
Catch ex As Exception
Response.Write(ex.Message)
Finally
If Not docWorkingDocument Is Nothing Then
docWorkingDocument.Close()
docWorkingDocument.Dispose()
End If
If Not srdDocToString Is Nothing Then
srdDocToString.Close()
srdDocToString.Dispose()
End If
End Try
Using memoryStream As New MemoryStream()
Dim writer As PdfWriter = PdfWriter.GetInstance(docWorkingDocument, memoryStream)
docWorkingDocument.Open()
'insert image into pdf
Dim logo = iTextSharp.text.Image.GetInstance(Server.MapPath("~/Images/fc3.png"))
logo.SetAbsolutePosition(29, 680) ' insert top left
'logo.ScaleToFit(350.0F, 300.0F) ' reduce image size
docWorkingDocument.Add(logo)
docWorkingDocument.Close()
Dim bytes As Byte() = memoryStream.ToArray()
memoryStream.Close()
Dim mm As New MailMessage("NoReply@email.com", txtEmail.Text)
mm.Subject = "From: " & txtFullName.Text
mm.Body = "Please see attached copy of your completed form. "
mm.Attachments.Add(New Attachment(New MemoryStream(bytes), user & ".pdf"))
mm.IsBodyHtml = True
Dim smtp As New SmtpClient()
smtp.Host = "smtp.gmail.com"
smtp.EnableSsl = False
Dim NetworkCred As New System.Net.NetworkCredential()
NetworkCred.UserName = "myemail@gmail.com"
NetworkCred.Password = "mpassword"
smtp.UseDefaultCredentials = True
smtp.Credentials = NetworkCred
smtp.Port = 587
smtp.Send(mm)
End Using
End Sub
End Class
|
|
|
|
|
|
Hi Richard,
As always, thank you so much.
You are right about the EnableSSL. It should have been set to True.
About adding those values to config file, I have two questions.
1, you said I wouldn't need ton configure smtpclient instance,
What should it look like completely?
2, Our goal is to present user with three options, to send email using gmail, or outlook or yahoo.
I am not sure why they are doing this but if I add the smtpClient instance in config file, how do I handle the other two?
Hope I am making some sense.
|
|
|
|
|
samflex wrote: What should it look like completely?
Exactly as I posted in my previous message. The default constructor for the SmtpClient picks up the settings from the config file, so you don't need to set anything in your code.
samflex wrote: Our goal is to present user with three options, to send email using gmail, or outlook or yahoo.
In that case, the <mailSettings> element won't work. There isn't an option to load different sets of settings in different scenarios.
I'd still recommend putting the settings in the config file, so that you don't have to recompile your code if they change. But you'll need to store them differently, possibly using a custom configuration section.
How to: Create Custom Configuration Sections Using ConfigurationSection[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I made a slight change which seems to work.
I changed <system.web>...
to
<system.net>...
and then moved
<compilation debug="true" targetFramework="4.0"/>
to <system.web>...
<pre>
<system.web>
<compilation debug="true" targetframework="4.0">
Thanks for all your help as usual.
|
|
|
|
|
Sorry sir, I got pulled away from this for a moment.
Happens all the time!
Anyway, I keep getting this error:
recognized configuration section system.web/mailSettings
after adding this to the config file - exactly as you have it.
|
|
|
|
|
samflex wrote: system.web/mailSettings
samflex wrote: exactly as you have it.
Are you sure about that? Read my message again - it's <system.net> , not <system.web> .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a div which is misbehaving badly. It seems that some very long text entered into this "tableItem" is causing the icon within the div to be pushed down to the next line. How do I stop this maddening behavior?
<pre>
<div style="max-height: 175px; overflow-y: auto; width: auto;">
<table id="tblSelectedItem" runat="server">
<tbody>
<tr>
<td>
<div class='itemStyle'>
<div style='float: left; border: 0; min-width: 245px;'> </div>
<div style='display: inline-block; float: left; border: 0;'>
<img src="~/Images/search.png" id="imgSearch" alt="Select Items" runat="server" class="SearchIconStyle" />
</div>
</div>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>
</div>
.itemStyle {
border: 1px solid #cccccc;
border-radius: 6px;
display: inline-block;
padding: 3px 3px 3px 3px;
white-space: nowrap;
margin: 0;
height: 20px;
}
.SearchIconStyle {
cursor: pointer;
margin-top: 2px;
margin-right: 2px;
}
modified 3-May-17 18:20pm.
|
|
|
|
|