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"/>
|
||||
</configSections>
|
||||
<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"/>-->
|
||||
</dbSettings>
|
||||
|
|
|
|||
|
|
@ -3504,6 +3504,7 @@
|
|||
<Content Include="Resource\GStat.png" />
|
||||
<Content Include="Resource\HeadBack.jpg" />
|
||||
<Content Include="Resource\Help_48x48.png" />
|
||||
<Content Include="Resource\home_pano.jpg" />
|
||||
<Content Include="Resource\Huge.gif" />
|
||||
<Content Include="Resource\Huge.ico" />
|
||||
<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.CustomControls;
|
||||
using Payroll.Report;
|
||||
using System.Net.Mail;
|
||||
|
||||
namespace Payroll.UI
|
||||
{
|
||||
|
|
@ -352,7 +353,8 @@ namespace Payroll.UI
|
|||
sb.AppendLine("Dear " + item.Name + "<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("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();
|
||||
}
|
||||
//else if (nType == 2)
|
||||
|
|
@ -482,39 +484,73 @@ namespace Payroll.UI
|
|||
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)
|
||||
{
|
||||
DirectoryInfo dirInfo = null;
|
||||
string reportPath = Application.StartupPath + @"\Report";
|
||||
|
||||
try
|
||||
{
|
||||
dirInfo = new DirectoryInfo(Application.StartupPath + @"\Report");
|
||||
if (!Directory.Exists(Application.StartupPath + @"\Report"))
|
||||
dirInfo = new DirectoryInfo(reportPath);
|
||||
|
||||
if (!dirInfo.Exists)
|
||||
{
|
||||
dirInfo.Create();
|
||||
}
|
||||
else // For Fail Safe Check. Do not remove this 'else' block
|
||||
else
|
||||
{
|
||||
|
||||
dirInfo.Delete(true);
|
||||
dirInfo.Create();
|
||||
// Clean contents, not directory
|
||||
foreach (FileInfo file in dirInfo.GetFiles()) file.Delete();
|
||||
foreach (DirectoryInfo subDir in dirInfo.GetDirectories()) subDir.Delete(true);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
throw new Exception(exp.Message);
|
||||
MessageBox.Show(exp.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (dirInfo != null)
|
||||
dirInfo.Delete(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user