Merge pull request 'Pay slip mail body need to update Done' (#2) from dev_shahadat into devqc
Reviewed-on: http://103.197.204.162:3025/CelHRTeam/CEL_Payroll/pulls/2
This commit is contained in:
commit
cd468381d6
|
|
@ -7,7 +7,8 @@
|
||||||
<section name="InformationForReportTool" type="Ease.SearchTools.Objects.InformationForReportToolConfigHandler, Ease.SearchTools.Objects"/>
|
<section name="InformationForReportTool" type="Ease.SearchTools.Objects.InformationForReportToolConfigHandler, Ease.SearchTools.Objects"/>
|
||||||
</configSections>
|
</configSections>
|
||||||
<dbSettings>
|
<dbSettings>
|
||||||
<connection name="conn" provider="sql" connectionString="server=103.197.204.164,1718;Database=CELPayrol;User ID=DBuser;Password=E@se2@24" sqlSyntax="SQL"/>
|
<connection name="conn" provider="sql" connectionString="server=cel80;Database=CELPayroll;User ID=CELPayroll;password=4B06094270245E4D5B63" sqlSyntax="SQL"/>
|
||||||
|
<!--<connection name="conn" provider="sql" connectionString="server=103.197.204.164,1718;Database=CELPayrol;User ID=DBuser;Password=E@se2@24" sqlSyntax="SQL"/>-->
|
||||||
|
|
||||||
<!--<connection name="conn" provider="sql" connectionString="server=WIN-D48IJC70V70;Database=GPPayroll;integrated security=yes;" sqlSyntax="SQL"/>-->
|
<!--<connection name="conn" provider="sql" connectionString="server=WIN-D48IJC70V70;Database=GPPayroll;integrated security=yes;" sqlSyntax="SQL"/>-->
|
||||||
</dbSettings>
|
</dbSettings>
|
||||||
|
|
@ -20,13 +21,13 @@
|
||||||
<add key="GratuityParam" value="Grade"/>
|
<add key="GratuityParam" value="Grade"/>
|
||||||
<!--<add key="FSSLeaveOnlyBasic" value="no"/>-->
|
<!--<add key="FSSLeaveOnlyBasic" value="no"/>-->
|
||||||
<add key="EERS" value="123456"/>
|
<add key="EERS" value="123456"/>
|
||||||
<add key="WebAddress" value="http://www.celimited.com"/>
|
<add key="WebAddress" value="http://www.celimited.com"/>
|
||||||
<add key="mailGateway" value="SMTP" />
|
<add key="mailGateway" value="SMTP" />
|
||||||
<add key="SendMethod" value="SMTP" />
|
<add key="SendMethod" value="SMTP" />
|
||||||
<add key="EmailServer" value="mail.celimited.com" />
|
<add key="EmailServer" value="mail.celimited.com" />
|
||||||
<add key="FromAddress" value="fkanak@celimited.com" />
|
<add key="FromAddress" value="fkanak@celimited.com" />
|
||||||
<add key="UserID" value="fkanak@celimited.com" />
|
<add key="UserID" value="fkanak@celimited.com" />
|
||||||
<add key="Password" value="4823074F2F0506582E704159" />
|
<add key="Password" value="4823074F2F0506582E704159" />
|
||||||
<add key="EnableSSL" value="No" />
|
<add key="EnableSSL" value="No" />
|
||||||
<add key="PortNumber" value="25" />
|
<add key="PortNumber" value="25" />
|
||||||
<add key="handleAuditTrail" value="No"/>
|
<add key="handleAuditTrail" value="No"/>
|
||||||
|
|
|
||||||
|
|
@ -3504,6 +3504,7 @@
|
||||||
<Content Include="Resource\GStat.png" />
|
<Content Include="Resource\GStat.png" />
|
||||||
<Content Include="Resource\HeadBack.jpg" />
|
<Content Include="Resource\HeadBack.jpg" />
|
||||||
<Content Include="Resource\Help_48x48.png" />
|
<Content Include="Resource\Help_48x48.png" />
|
||||||
|
<Content Include="Resource\home_pano.jpg" />
|
||||||
<Content Include="Resource\Huge.gif" />
|
<Content Include="Resource\Huge.gif" />
|
||||||
<Content Include="Resource\Huge.ico" />
|
<Content Include="Resource\Huge.ico" />
|
||||||
<Content Include="Resource\icon_people.jpg" />
|
<Content Include="Resource\icon_people.jpg" />
|
||||||
|
|
|
||||||
BIN
Payroll.UI/Payroll.UI/Resource/home_pano.jpg
Normal file
BIN
Payroll.UI/Payroll.UI/Resource/home_pano.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
|
|
@ -11,6 +11,7 @@ using Payroll.BO;
|
||||||
using Payroll.Controls;
|
using Payroll.Controls;
|
||||||
using Payroll.Controls.CustomControls;
|
using Payroll.Controls.CustomControls;
|
||||||
using Payroll.Report;
|
using Payroll.Report;
|
||||||
|
using System.Net.Mail;
|
||||||
|
|
||||||
namespace Payroll.UI
|
namespace Payroll.UI
|
||||||
{
|
{
|
||||||
|
|
@ -352,7 +353,8 @@ namespace Payroll.UI
|
||||||
sb.AppendLine("Dear " + item.Name + "<br/><br/>");
|
sb.AppendLine("Dear " + item.Name + "<br/><br/>");
|
||||||
sb.AppendLine("Attached your pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy") + "." + "<br/><br/>");
|
sb.AppendLine("Attached your pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy") + "." + "<br/><br/>");
|
||||||
sb.AppendLine("If you have any query, please contact :" + "<br/><br/>");
|
sb.AppendLine("If you have any query, please contact :" + "<br/><br/>");
|
||||||
sb.AppendLine("Md. Showkat Hossain, Mobile-01711679640, email: fkanak@celimited.com" + "<br/>");
|
sb.AppendLine("Md. Showkat Hossain, Mobile-01711679640, email: fkanak@celimited.com" + "<br/><br/>");
|
||||||
|
sb.AppendLine("<b>Note:</b><br/><b>***Please use the last four digits of your mobile number, that you have shared with us, as the password to open the pay-slip</b>" + "<br/>");
|
||||||
MS.Body = sb.ToString();
|
MS.Body = sb.ToString();
|
||||||
}
|
}
|
||||||
//else if (nType == 2)
|
//else if (nType == 2)
|
||||||
|
|
@ -482,40 +484,74 @@ namespace Payroll.UI
|
||||||
lblSelected.Text = "0";
|
lblSelected.Text = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//private void btnSendMail_Click(object sender, EventArgs e)
|
||||||
|
//{
|
||||||
|
// DirectoryInfo dirInfo = null;
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// dirInfo = new DirectoryInfo(Application.StartupPath + @"\Report");
|
||||||
|
// if (!Directory.Exists(Application.StartupPath + @"\Report"))
|
||||||
|
// {
|
||||||
|
// dirInfo.Create();
|
||||||
|
// }
|
||||||
|
// else // For Fail Safe Check. Do not remove this 'else' block
|
||||||
|
// {
|
||||||
|
|
||||||
|
// dirInfo.Delete(true);
|
||||||
|
// dirInfo.Create();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (Validation())
|
||||||
|
// {
|
||||||
|
// PrepareReport();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// catch (Exception exp)
|
||||||
|
// {
|
||||||
|
// throw new Exception(exp.Message);
|
||||||
|
// }
|
||||||
|
// finally
|
||||||
|
// {
|
||||||
|
// if (dirInfo != null)
|
||||||
|
// dirInfo.Delete(true);
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
private void btnSendMail_Click(object sender, EventArgs e)
|
private void btnSendMail_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DirectoryInfo dirInfo = null;
|
DirectoryInfo dirInfo = null;
|
||||||
|
string reportPath = Application.StartupPath + @"\Report";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
dirInfo = new DirectoryInfo(Application.StartupPath + @"\Report");
|
dirInfo = new DirectoryInfo(reportPath);
|
||||||
if (!Directory.Exists(Application.StartupPath + @"\Report"))
|
|
||||||
|
if (!dirInfo.Exists)
|
||||||
{
|
{
|
||||||
dirInfo.Create();
|
dirInfo.Create();
|
||||||
}
|
}
|
||||||
else // For Fail Safe Check. Do not remove this 'else' block
|
else
|
||||||
{
|
{
|
||||||
|
// Clean contents, not directory
|
||||||
dirInfo.Delete(true);
|
foreach (FileInfo file in dirInfo.GetFiles()) file.Delete();
|
||||||
dirInfo.Create();
|
foreach (DirectoryInfo subDir in dirInfo.GetDirectories()) subDir.Delete(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Validation())
|
if (Validation())
|
||||||
{
|
{
|
||||||
PrepareReport();
|
PrepareReport(); // <-- Generate PDF and Send Mail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IMPORTANT: Delete only after everything is closed
|
||||||
|
foreach (FileInfo file in dirInfo.GetFiles()) file.Delete();
|
||||||
}
|
}
|
||||||
catch (Exception exp)
|
catch (Exception exp)
|
||||||
{
|
{
|
||||||
throw new Exception(exp.Message);
|
MessageBox.Show(exp.Message);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (dirInfo != null)
|
|
||||||
dirInfo.Delete(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user