524 lines
24 KiB
C#
524 lines
24 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using Ease.CoreV35.Model;
|
|
using iTextSharp.text.pdf;
|
|
using Payroll.BO;
|
|
using Payroll.Controls;
|
|
using Payroll.Controls.CustomControls;
|
|
using Payroll.Report;
|
|
|
|
namespace Payroll.UI
|
|
{
|
|
#region fNewSendMail
|
|
|
|
public partial class fPayslipSendMail : Form
|
|
{
|
|
#region Declarations
|
|
private ObjectsTemplate<SearchEmployee> _SelectedEmps = null;
|
|
private ObjectsTemplate<Bank> _banks = null;
|
|
private ObjectsTemplate<Branch> _branches = null;
|
|
|
|
private ObjectsTemplate<SearchEmployee> _ToSendEmps = null;
|
|
private int _Type;
|
|
MailSender MS = null;
|
|
|
|
#endregion
|
|
|
|
#region Constructor
|
|
public int Type
|
|
{
|
|
set
|
|
{
|
|
_Type = value;
|
|
}
|
|
}
|
|
public fPayslipSendMail()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void fNewSendMail_Load(object sender, EventArgs e)
|
|
{
|
|
dtpfromDate.Value = GlobalFunctions.FirstDateOfMonth(Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate);
|
|
LoadBank();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Private Functions
|
|
|
|
private void LoadBank()
|
|
{
|
|
cboBank.DataSource = null;
|
|
_banks = Bank.Get();
|
|
cboBank.DataSource = _banks;
|
|
cboBank.DisplayMember = "Name";
|
|
cboBank.ValueMember = "ID";
|
|
if (cboBank.Items.Count > 0)
|
|
cboBank.SelectedIndex = -1;
|
|
}
|
|
|
|
private void RefreshList()
|
|
{
|
|
lsvEmployee.Items.Clear();
|
|
if (_SelectedEmps == null) return;
|
|
foreach (SearchEmployee emp in _SelectedEmps)
|
|
{
|
|
ListViewItem item = new ListViewItem();
|
|
item.Text = emp.Name;
|
|
item.Tag = emp;
|
|
item.SubItems.Add(emp.EmployeeNo);
|
|
item.SubItems.Add(emp.Email);
|
|
lsvEmployee.Items.Add(item);
|
|
}
|
|
lblTotal.Text = lsvEmployee.Items.Count.ToString();
|
|
}
|
|
|
|
private bool Validation()
|
|
{
|
|
if (ctlEmployee.SelectedEmployee == null)
|
|
{
|
|
if (lsvEmployee.CheckedItems.Count == 0)
|
|
{
|
|
MessageBox.Show("Please select an employee to send mail.", "Payslip Mail", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
lsvEmployee.Focus();
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
private void PrepareReport()
|
|
{
|
|
MailSender mailSender = new MailSender();
|
|
_ToSendEmps = new ObjectsTemplate<SearchEmployee>();
|
|
lblEmployee.Text = "";
|
|
lblEmployee.Refresh();
|
|
PaySlip paySlip = new PaySlip();
|
|
if ((ObjectTemplate)(object)ctlEmployee.SelectedEmployee != (ObjectTemplate)null)
|
|
{
|
|
((List<SearchEmployee>)(object)_ToSendEmps).Add(ctlEmployee.SelectedEmployee);
|
|
}
|
|
else if (lsvEmployee.CheckedItems.Count > 0)
|
|
{
|
|
int num = 0;
|
|
foreach (ListViewItem checkedItem in lsvEmployee.CheckedItems)
|
|
{
|
|
((List<SearchEmployee>)(object)_ToSendEmps).Add((SearchEmployee)lsvEmployee.CheckedItems[num++].Tag);
|
|
}
|
|
}
|
|
if (((List<SearchEmployee>)(object)_ToSendEmps).Count <= 0)
|
|
{
|
|
return;
|
|
}
|
|
string empty = string.Empty;
|
|
string empty2 = string.Empty;
|
|
byte[] array = null;
|
|
int num2 = 0;
|
|
try
|
|
{
|
|
Cursor = Cursors.WaitCursor;
|
|
EnumSendMail enumSendMail = EnumSendMail.None;
|
|
foreach (SearchEmployee item in (List<SearchEmployee>)(object)_ToSendEmps)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(item.Employee.MobileNo))
|
|
{
|
|
MessageBox.Show($"{item.Employee.Name} ({item.Employee.EmployeeNo}) does not have a phone number. Email sending was skipped.");
|
|
continue;
|
|
}
|
|
Label label = lblEmployee;
|
|
int num3 = ++num2;
|
|
label.Text = "Sending Mail :" + num3 + "/" + ((List<SearchEmployee>)(object)_ToSendEmps).Count;
|
|
lblEmployee.Refresh();
|
|
array = ((_Type != 1) ? paySlip.SKFExpencesPaySlip1(dtpfromDate.Value, item.EmployeeID.Integer.ToString()) : paySlip.MailReportWithAccountNoMask(dtpfromDate.Value, item.EmployeeID.Integer.ToString()));
|
|
if (array == null)
|
|
{
|
|
continue;
|
|
}
|
|
if (!Directory.Exists(Application.StartupPath + "\\Report"))
|
|
{
|
|
DirectoryInfo directoryInfo = new DirectoryInfo(Application.StartupPath + "\\Report");
|
|
directoryInfo.Create();
|
|
}
|
|
empty = string.Concat(str2: (_Type != 1) ? ("Expense_" + item.EmployeeNo + "-" + dtpfromDate.Value.Month + "-" + dtpfromDate.Value.Year + "_" + DateTime.Now.ToString("hh_mm_ss") + ".pdf") : ("Payslip_" + item.EmployeeNo + "-" + dtpfromDate.Value.Month + "-" + dtpfromDate.Value.Year + "_" + DateTime.Now.ToString("hh_mm_ss") + ".pdf"), str0: Application.StartupPath, str1: "\\Report\\");
|
|
using (FileStream fileStream = new FileStream(empty, FileMode.Create))
|
|
{
|
|
fileStream.Write(array, 0, array.Length);
|
|
fileStream.Dispose();
|
|
}
|
|
|
|
//string employeeNo = item.Employee.EmployeeNo;
|
|
//string text = ((employeeNo.Length >= 3) ? employeeNo.Substring(employeeNo.Length - 3) : employeeNo.PadLeft(3, '0'));
|
|
|
|
//Encrypt PDF with last 4 digit of mobile no
|
|
string phoneNo = item.Employee.MobileNo;
|
|
string text = ((phoneNo.Length >= 4) ? phoneNo.Substring(phoneNo.Length - 4) : phoneNo.PadLeft(4, '0'));
|
|
|
|
using (MemoryStream memoryStream = new MemoryStream(array))
|
|
{
|
|
PdfReader val = new PdfReader((Stream)memoryStream);
|
|
try
|
|
{
|
|
// Replace the following line:
|
|
//using FileStream fileStream2 = new FileStream(empty, FileMode.Create);
|
|
using (FileStream fileStream2 = new FileStream(empty, FileMode.Create))
|
|
{
|
|
PdfEncryptor.Encrypt(val, (Stream)fileStream2, 2, text, (string)null, 2052);
|
|
}
|
|
//PdfEncryptor.Encrypt(val, (Stream)fileStream2, 2, text, (string)null, 2052);
|
|
}
|
|
finally
|
|
{
|
|
((IDisposable)val)?.Dispose();
|
|
}
|
|
}
|
|
item.Email = item.Employee.EmailAddress;
|
|
enumSendMail = SendMail(item, empty, _Type);
|
|
switch (enumSendMail)
|
|
{
|
|
case EnumSendMail.ToMissing:
|
|
MessageBox.Show("Employee mail address is missing", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
case EnumSendMail.FromMissing:
|
|
MessageBox.Show("Missing from address", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
case EnumSendMail.BodyMissing:
|
|
MessageBox.Show("Missing mail body", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
case EnumSendMail.SubjectMissing:
|
|
MessageBox.Show("Mail subject is missing", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
case EnumSendMail.ServerNotFound:
|
|
MessageBox.Show("Server not found", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
case EnumSendMail.SendError:
|
|
MessageBox.Show("Sending Mail Error", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
break;
|
|
}
|
|
}
|
|
if (enumSendMail == EnumSendMail.SuccessFullySend)
|
|
{
|
|
lblEmployee.Text = string.Empty;
|
|
lblEmployee.Refresh();
|
|
MessageBox.Show("Mail Sent Successfully", "Payslip", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
|
}
|
|
Cursor = Cursors.Default;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(this, ex.Message, "Error Sending Mail", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
|
lblEmployee.Text = string.Empty;
|
|
lblEmployee.Refresh();
|
|
Cursor = Cursors.Default;
|
|
}
|
|
}
|
|
//private void PrepareReport()
|
|
//{
|
|
// MailSender oMailSender = new MailSender();
|
|
// _ToSendEmps = new ObjectsTemplate<SearchEmployee>();
|
|
|
|
// lblEmployee.Text = "";
|
|
// lblEmployee.Refresh();
|
|
// PaySlip _payslip = new PaySlip();
|
|
|
|
// if (ctlEmployee.SelectedEmployee != null)
|
|
// {
|
|
// _ToSendEmps.Add((SearchEmployee)ctlEmployee.SelectedEmployee);
|
|
// }
|
|
// else if (lsvEmployee.CheckedItems.Count > 0)
|
|
// {
|
|
// int index = 0;
|
|
// foreach (ListViewItem item in lsvEmployee.CheckedItems)
|
|
// {
|
|
// _ToSendEmps.Add((SearchEmployee)lsvEmployee.CheckedItems[index++].Tag);
|
|
// }
|
|
// }
|
|
|
|
|
|
// if (_ToSendEmps.Count > 0)
|
|
// {
|
|
// string path = string.Empty;
|
|
// string filename = string.Empty;
|
|
// byte[] filetoSendBytes = null;
|
|
// int count = 0;
|
|
// try
|
|
// {
|
|
// this.Cursor = Cursors.WaitCursor;
|
|
// EnumSendMail sendMail = EnumSendMail.None;
|
|
// foreach (SearchEmployee item in _ToSendEmps)
|
|
// {
|
|
// lblEmployee.Text = "Sending Mail :" + (++count).ToString() + "/" + _ToSendEmps.Count;
|
|
// lblEmployee.Refresh();
|
|
// if(_Type==1)
|
|
// filetoSendBytes = _payslip.MailReport(dtpfromDate.Value, item.EmployeeID.Integer.ToString());
|
|
// else
|
|
// filetoSendBytes = _payslip.SKFExpencesPaySlip1(dtpfromDate.Value, item.EmployeeID.Integer.ToString());
|
|
|
|
// if (filetoSendBytes != null)
|
|
// {
|
|
// if (!Directory.Exists(Application.StartupPath + @"\Report"))
|
|
// {
|
|
// DirectoryInfo dirInfo = new DirectoryInfo(Application.StartupPath + @"\Report");
|
|
// dirInfo.Create();
|
|
// }
|
|
// if (_Type == 1)
|
|
// filename = "Payslip_"+item.EmployeeNo + "-" + dtpfromDate.Value.Month + "-" + dtpfromDate.Value.Year+"_"+DateTime.Now.ToString("hh_mm_ss") + ".pdf";
|
|
// else
|
|
// filename = "Expense_" + item.EmployeeNo + "-" + dtpfromDate.Value.Month + "-" + dtpfromDate.Value.Year + "_" + DateTime.Now.ToString("hh_mm_ss") + ".pdf";
|
|
// path = Application.StartupPath + @"\Report\" + filename;
|
|
|
|
// using (FileStream fs = new FileStream(path, FileMode.Create))
|
|
// {
|
|
// fs.Write(filetoSendBytes, 0, filetoSendBytes.Length);
|
|
// fs.Dispose();
|
|
// }
|
|
// item.Email = item.Employee.EmailAddress;
|
|
// sendMail = SendMail(item, path,_Type);
|
|
|
|
// switch (sendMail)
|
|
// {
|
|
// case EnumSendMail.ToMissing:
|
|
// MessageBox.Show("Employee mail address is missing", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
// case EnumSendMail.FromMissing:
|
|
// MessageBox.Show("Missing from address", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
// case EnumSendMail.BodyMissing:
|
|
// MessageBox.Show("Missing mail body", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
// case EnumSendMail.SubjectMissing:
|
|
// MessageBox.Show("Mail subject is missing", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
// case EnumSendMail.ServerNotFound:
|
|
// MessageBox.Show("Server not found", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
// case EnumSendMail.SendError:
|
|
// MessageBox.Show("Sending Mail Error", item.EmployeeNo, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// break;
|
|
|
|
// default:
|
|
// break;
|
|
// }
|
|
|
|
|
|
// }
|
|
// }
|
|
|
|
// if (sendMail == EnumSendMail.SuccessFullySend)
|
|
// {
|
|
// lblEmployee.Text = string.Empty;
|
|
// lblEmployee.Refresh();
|
|
// MessageBox.Show("Mail Sent Successfully", "Payslip", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
// }
|
|
// this.Cursor = Cursors.Default;
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// MessageBox.Show(this, ex.Message, "Error Sending Mail", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
// lblEmployee.Text = string.Empty;
|
|
// lblEmployee.Refresh();
|
|
// this.Cursor = Cursors.Default;
|
|
// }
|
|
|
|
// }
|
|
//}
|
|
|
|
private EnumSendMail SendMail(SearchEmployee item, string sPath,int nType)
|
|
{
|
|
MS = new MailSender();
|
|
MS.To = item.Email.Trim(); // "hassan@celimited.com";
|
|
|
|
if (nType == 1)
|
|
{
|
|
#region Old Body
|
|
//MS.Subject = "Salary Pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy");
|
|
//StringBuilder sb = new StringBuilder();
|
|
//sb.AppendLine("Dear " + item.Name+"<br/>");
|
|
//sb.AppendLine("Attached the pay slip of your Salary of " + dtpfromDate.Value.ToString("MMMM yyyy")+"."+"<br/>");
|
|
//sb.AppendLine("If you have any query, please contact with anyone under mentioned personnel:" + "<br/>");
|
|
//sb.AppendLine("1. Mr. Md. Suzaet Hossain-Asstt. Manager-HR & Payroll, mobile-01729073233, email: suzaet@skf.transcombd.com" + "<br/>");
|
|
//sb.AppendLine("2. Mr. Md. Shahabuddin Molla- HR Manager, Operations, mobile-01714098171, email: sum@skf.transcombd.com" + "<br/>");
|
|
//sb.AppendLine("3. Mr. K. M. Shirazul Haque- Sr. HR Manager, Operations, mobile-01713065410, email: shiraz@skf.transcombd.com" + "<br/>");
|
|
//MS.Body = sb.ToString();
|
|
#endregion
|
|
|
|
MS.Subject = "Salary Pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy");
|
|
StringBuilder sb = new StringBuilder();
|
|
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/>");
|
|
MS.Body = sb.ToString();
|
|
}
|
|
//else if (nType == 2)
|
|
//{
|
|
// #region Old Body
|
|
// //MS.Subject = "Expense Pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy");
|
|
// //StringBuilder sb = new StringBuilder();
|
|
// //sb.AppendLine("Dear " + item.Name + "<br/>");
|
|
// //sb.AppendLine("Attached the pay slip of your Expense of " + dtpfromDate.Value.ToString("MMMM yyyy") + "." + "<br/>");
|
|
// //sb.AppendLine("If you have any query, please contact with anyone under mentioned personnel:" + "<br/>");
|
|
// //sb.AppendLine("1. Mr. Md. Suzaet Hossain-Asstt. Manager-HR & Payroll, mobile-01729073233, email: suzaet@skf.transcombd.com" + "<br/>");
|
|
// //sb.AppendLine("2. Mr. Md. Shahabuddin Molla- HR Manager, Operations, mobile-01714098171, email: sum@skf.transcombd.com" + "<br/>");
|
|
// //sb.AppendLine("3. Mr. K. M. Shirazul Haque- Sr. HR Manager, Operations, mobile-01713065410, email: shiraz@skf.transcombd.com" + "<br/>");
|
|
// //MS.Body = sb.ToString();
|
|
// #endregion
|
|
|
|
// MS.Subject = "Expense Pay slip of " + dtpfromDate.Value.ToString("MMMM yyyy");
|
|
// StringBuilder sb = new StringBuilder();
|
|
// 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 anyone below:" + "<br/><br/>");
|
|
// sb.AppendLine("1. Mobile-01729073233, email: suzaet@skf.transcombd.com" + "<br/>");
|
|
// sb.AppendLine("2. Mobile-01714098171, email: sum@skf.transcombd.com" + "<br/>");
|
|
// sb.AppendLine("3. Mobile-01713065410, email: shiraz@skf.transcombd.com" + "<br/><br/>");
|
|
// MS.Body = sb.ToString();
|
|
//}
|
|
|
|
MS.AddAttachment(sPath);
|
|
|
|
return MS.SendMail();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Events
|
|
|
|
private void cboBank_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
cboBranch.DataSource = null;
|
|
if (cboBank.SelectedItem != null)
|
|
{
|
|
_branches = Branch.GetChild(((Bank)cboBank.SelectedItem).ID);
|
|
cboBranch.DataSource = _branches;
|
|
cboBranch.DisplayMember = "Name";
|
|
cboBranch.ValueMember = "ID";
|
|
if (cboBranch.Items.Count > 0)
|
|
cboBranch.SelectedIndex = -1;
|
|
}
|
|
}
|
|
|
|
private void btnSearch_Click(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
SearchManager manager = new SearchManager(EnumSearchFrom.Employee);
|
|
manager.Parameter.Add(ctlCategory.SearchParam);
|
|
manager.Parameter.Add(ctlDepartment.SearchParam);
|
|
manager.Parameter.Add(ctlReligion.SearchParam);
|
|
manager.Parameter.Add(ctlLocation.SearchParam);
|
|
manager.Parameter.Add(ctlGrade.SearchParam);
|
|
manager.Parameter.Add(ctlCostCenter.SearchParam);
|
|
manager.Parameter.Add(ctlDesignation.SearchParam);
|
|
|
|
|
|
|
|
if (cboGender.SelectedIndex > 0)
|
|
manager.Parameter.Add(EnumSearchParameter.Gender, cboGender.SelectedIndex);
|
|
|
|
if (cboBank.SelectedIndex >= 0)
|
|
{
|
|
manager.Parameter.Add(EnumSearchParameter.BankID, ((Bank)cboBank.SelectedItem).ID.Integer);
|
|
if (cboBranch.SelectedIndex >= 0)
|
|
{
|
|
manager.Parameter.Add(EnumSearchParameter.BranchID, ((Branch)cboBranch.SelectedItem).ID.Integer);
|
|
}
|
|
else
|
|
{
|
|
string branchID = "";
|
|
int i = 0;
|
|
foreach (Branch oItem in _branches)
|
|
{
|
|
|
|
if (oItem.BankID.Integer == ((Bank)cboBank.SelectedItem).ID.Integer)
|
|
{
|
|
if (i == _branches.Count - 1)
|
|
branchID = branchID + oItem.ID.Integer;
|
|
else
|
|
branchID = branchID + oItem.ID.Integer + ",";
|
|
|
|
i = i + 1;
|
|
}
|
|
}
|
|
manager.Parameter.Add(EnumSearchParameter.BranchID, EnumSQLOperator.In, EnumSearchObjDataType.String, branchID);
|
|
}
|
|
}
|
|
|
|
if (dtpfromDate.Visible == true) manager.Parameter.Add(EnumSearchParameter.FromDate, GlobalFunctions.LastDateOfMonth(dtpfromDate.Value));
|
|
|
|
manager.SearchFrom = EnumSearchFrom.Salary;
|
|
_SelectedEmps = manager.Find();
|
|
RefreshList();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
MessageBox.Show(ex.Message, "Error occured during search specific employee");
|
|
}
|
|
}
|
|
|
|
private void btnSelectAll_Click(object sender, EventArgs e)
|
|
{
|
|
bool bSelected = false;
|
|
if (btnSelectAll.Text.Equals("&Select All"))
|
|
{
|
|
bSelected = true;
|
|
btnSelectAll.Text = "&Unselect All";
|
|
}
|
|
else
|
|
{
|
|
btnSelectAll.Text = "&Select All";
|
|
}
|
|
|
|
foreach (ListViewItem item in lsvEmployee.Items)
|
|
{
|
|
item.Checked = bSelected;
|
|
}
|
|
if (bSelected == false)
|
|
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);
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
#endregion
|
|
}
|