HRM-10/HRM.BO/TagOutput/LetterTemplate.cs

2137 lines
93 KiB
C#
Raw Normal View History

2026-11-03 13:06:00 +06:00
using Ease.Core.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Reflection;
namespace HRM.BO
{
public class FixedLetterTemplte
{
//BAT Letter Template
public const int Visa_Letter_Business_Trip_With_Family = 1;
public const int Salary_Certificate = 2;
public const int Visa_Letter_Business_Trip = 3;
public const int Visa_Letter_Personal_Trip = 4;
public const int Visa_Letter_With_Family = 5;
public const int Loan_Letter_Bank = 6;
public const int Foreign_Currency_Bank_AC_For_secondee = 7;
public const int Visa_for_Business_trip_or_Family = 8;
public const int Visa_for_Company_Business = 9;
public const int Loan_Certificate_Letter_for_Authorization = 10;
public const int Loan_Certificate_Take_Home_Salary = 11;
public const int Intvw_BrdMember_Notify_Mail = 12;
public const int Employee_Intvw_Notify_Mail = 13;
public const int Applicant_Intvw_Notify_Mail = 14;
public const int Welcome_Mail_New_Joiner = 15;
public const int Welcome_Mail_Employee = 16;
public const int Induction_Request_New_Joiner = 17;
public const int Induction_Request_Employee = 18;
public const int Announcement_New_Joiner = 19;
public const int Announcement_Employee = 20;
public const int Candidate_Offer_Letter = 21;
public const int Candidate_Appointment_Letter = 22;
public static bool IsValidForDelete(int templateID)
{
if (templateID <= 17)
return false;
else return true;
}
}
public class LetterTemplte : BasicBaseObject
{
#region Global Variables
private DataSet _errorMessages;
private string _description;
private string _subject;
private object _body;
private EnumDocType _type;
private EnumletterCreationType _creationType;
private int _typeID;
private string _FilePath;
#endregion
#region Constructor
public LetterTemplte()
{
_description = string.Empty;
_subject = string.Empty;
_body = null;
_type = EnumDocType.Email;
_typeID = 0;
_errorMessages = null;
_creationType = EnumletterCreationType.Manual;
_FilePath = string.Empty;
}
#endregion
#region Properties
#region TypeID : int
public int TypeID
{
get { return _typeID; }
set { _typeID = value; }
}
#endregion
#region Type : Enum
public EnumDocType Type
{
get
{
return _type;
}
set
{
_type = value;
}
}
#endregion
#region Body : Object
public object Body
{
get
{
return _body;
}
set
{
_body = value;
}
}
#endregion
#region Subject : string
public string Subject
{
get
{
return _subject;
}
set
{
_subject = value;
}
}
#endregion
#region CreationType : EnumletterCreationType
public EnumletterCreationType CreationType
{
get
{
return _creationType;
}
set
{
_creationType = value;
}
}
#endregion
#region Description : string
public string Description
{
get
{
return _description;
}
set
{
_description = value;
}
}
#endregion
#region FilePath : string
public string FilePath
{
get
{
return _FilePath;
}
set
{
_FilePath = value;
}
}
#endregion
#region Service Factory ILetterTemplteService : ILetterTemplteService
internal static ILetterTemplteService Service
{
get { return Services.Factory.CreateService<ILetterTemplteService>(typeof(ILetterTemplteService)); }
}
#endregion
#endregion
//#region Functions
//public Hashtable RefreshFinantialData(Employee emp)
//{
// Hashtable table = new Hashtable();
// table.Add("<<EMPLOYEEBASICSALARY>>", emp.BasicSalary);
// double salaryTotal = emp.BasicSalary;
// List<ADParameter> adParams = ADParameter.Get(emp.GradeID, EnumEntitleType.Grade, EnumAllowOrDeduct.Allowance);
// if (adParams != null)
// {
// foreach (ADParameter adParam in adParams)
// {
// double namount = adParam.GetGradeDefinedAmount(emp,
// emp.BasicSalary,
// emp.GrossSalary, new EmployeeGradeSalary());
// salaryTotal = salaryTotal + namount;
// if (namount > 0)
// table.Add("<<AL-" + adParam.AllowanceDeduction.Code + ">>", namount);
// }
// }
// List<ADParameterEmployee> adParamEmps = ADParameterEmployee.GetByEmployee(emp.ID, EnumAllowOrDeduct.Allowance, EnumADEmpType.AppliedToIndividual);
// if (adParamEmps != null)
// {
// foreach (ADParameterEmployee adEmp in adParamEmps)
// {
// if (adEmp.MonthlyAmount > 0) table.Add("<<AL-" + adEmp.AllowDeduct.Code + ">>", adEmp.MonthlyAmount);
// salaryTotal = salaryTotal + adEmp.MonthlyAmount;
// }
// }
// return table;
//}
//public Hashtable RefreshObject(Employee oEmp)
//{
// Grade oGrade = null;
// Designation oDesig = null;
// Location oLoc = null;
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// EmployeeCostCenter oEmpCC = EmployeeCostCenter.Get(oEmp.ID);
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// OrganogramBasic ogNode;
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.CandidateName, oEmp.Name);
// string basicSalary = string.Empty;
// basicSalary = "Tk. " + emp.BasicSalary.ToString() + "/- (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(emp.BasicSalary) + " )";
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// table.Add(TagOutputConstant.FirstName, oHREmp.FirstName);
// table.Add(TagOutputConstant.MiddleName, oHREmp.MiddleName);
// table.Add(TagOutputConstant.LastName, oHREmp.LastName);
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// //////////////
// table.Add(TagOutputConstant.DateOfConfirmation, (emp.ConfirDate != null && emp.ConfirDate != DateTime.MinValue) ? emp.ConfirDate.ToString("dd MMM yyyy") : "_______");
// table.Add(TagOutputConstant.PassportNo, (oHREmp.PassportNo != String.Empty) ? oHREmp.PassportNo : "_______");
// //table.Add(TagOutputConstant.PromotionEffectiveDate, (olfc.EffectDate != null && olfc.EffectDate != DateTime.MinValue) ? olfc.EffectDate.ToString("dd MMM yyyy") : "_______");
// /////////////
// string category = "________";
// if (emp.Category != null) category = emp.Category.Name;
// table.Add(TagOutputConstant.EmploymentType, category);
// DateTime retirementdate;
// if (emp.JoiningDate != null && emp.JoiningDate != DateTime.MinValue)
// {
// retirementdate = emp.JoiningDate.AddYears(57);
// table.Add(TagOutputConstant.RetirementDate, retirementdate.ToString("dd MMM yyyy"));
// }
// else table.Add(TagOutputConstant.RetirementDate, "________");
// table.Add(TagOutputConstant.EndOfContractDate,
// emp.EndOfContractDate != null && emp.EndOfContractDate != DateTime.MinValue ? (((DateTime)(emp.EndOfContractDate)).ToString("dd MMM yyyy")) : ("________"));
// FSTran fstran = FSTran.Get(emp.ID.Integer);
// if (fstran != null)
// {
// table.Add(TagOutputConstant.NoticeDate, fstran.NoticeDate != null && fstran.NoticeDate != DateTime.MinValue ?
// fstran.NoticeDate.ToString("dd MMM yyyy") : "________");
// }
// else
// {
// table.Add(TagOutputConstant.NoticeDate, "________");
// }
// ////////////
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "_______");
// table.Add(TagOutputConstant.EmployeeGrade, emp.Grade == null ? "________" : emp.Grade.Name);
// table.Add(TagOutputConstant.EmployeeLocation, emp.Location == null ? "________" : emp.Location.Name);
// table.Add(TagOutputConstant.EmployeeDept, emp.Department == null ? "________" : emp.Department.Name);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// if (oEmpCC != null)
// {
// table.Add(TagOutputConstant.EmployeeCC, oEmpCC.Costcenter == null ? "________" : oEmpCC.Costcenter.Name);
// }
// else
// {
// table.Add(TagOutputConstant.EmployeeCC, "________");
// }
// table.Add(TagOutputConstant.EmployeePresentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PresentAddress : "_______");
// table.Add(TagOutputConstant.EmployeeJoiningDate, emp.JoiningDate.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.EmployeeBasicSalary, oEmp.BasicSalary);
// table.Add(TagOutputConstant.EmployeeGrossSalary, oEmp.GrossSalary);
// table.Add(TagOutputConstant.BasicInWords, basicSalary);
// table.Add(TagOutputConstant.PermanentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PermanentAddress : "_______");
// table.Add(TagOutputConstant.BirthDate, emp.BirthDate.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.TIN, oHREmp.TinNo);
// table.Add(TagOutputConstant.FatherName, oHREmp.FatherName);
// table.Add(TagOutputConstant.MotherName, oHREmp.MotherName);
// table.Add(TagOutputConstant.PFDeduction, PayrollPayrollGlobalFunctions.TakaFormat(emp.BasicSalary / 10.00));
// table.Add(TagOutputConstant.CurrentDate, DateTime.Now.Date.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.Salutation, emp.Gender == EnumGender.Male ? "Mr." : "Ms.");
// table.Add(TagOutputConstant.HeShe, emp.Gender == EnumGender.Male ? "He" : "She");
// table.Add(TagOutputConstant.heshe, emp.Gender == EnumGender.Male ? "he" : "she");
// table.Add(TagOutputConstant.HisHer, emp.Gender == EnumGender.Male ? "His" : "Her");
// table.Add(TagOutputConstant.hisher, emp.Gender == EnumGender.Male ? "his" : "her");
// table.Add(TagOutputConstant.HimHer, emp.Gender == EnumGender.Male ? "Him" : "Her");
// table.Add(TagOutputConstant.himher, emp.Gender == EnumGender.Male ? "him" : "her");
// table.Add(TagOutputConstant.SBUName, Payroll.BO.SystemInformation.CurrentSysInfo.name);
// table.Add(TagOutputConstant.SBUAddress, Payroll.BO.SystemInformation.CurrentSysInfo.corporateAddress);
// List<OrganogramEmployee> emps = OrganogramEmployee.GetByEmp(oEmp.ID);
// if (emps == null || emps.Count == 0)
// {
// table.Add(TagOutputConstant.LineManagerName, "________");
// table.Add(TagOutputConstant.LineManagerDesig, "________");
// //throw new Exception("Employee is not posted in Organ-O-Gram.");
// }
// else
// {
// ogNode = OrganogramBasic.Get(emps[0].NodeID);
// if (ogNode.Parent != null)
// {
// ogNode = ogNode.Parent;
// if (ogNode.EmployeeAssigned == true)
// {
// Employee oOrganEmp = ogNode.GetAssignedEmployee();
// table.Add(TagOutputConstant.LineManagerName, oOrganEmp == null ? "________" : oOrganEmp.Name);
// table.Add(TagOutputConstant.LineManagerDesig, oOrganEmp == null ? "________" : oOrganEmp.DescriptionText);
// }
// }
// else
// {
// table.Add(TagOutputConstant.LineManagerName, "________");
// table.Add(TagOutputConstant.LineManagerDesig, "________");
// }
// }
// table.Add(TagOutputConstant.GroupHeadHRName, "________");
// table.Add(TagOutputConstant.GroupHeadHR, "Group Head of HR");
// //table.Add(TagOutputConstant.LineManagerName, emp.LineManager == null ? "________" : emp.LineManager.Name); //emp.LineManagerNode.
// //table.Add(TagOutputConstant.LineManagerDesig, emp.LineManager == null ? "________" : emp.LineManager.DesigDescription); //emp.ParantNode
// //table.Add(TagOutputConstant.GroupHeadHRName, "Arif Shahriar");
// //table.Add(TagOutputConstant.GroupHeadHR, "Group Head of HR");
// //Previous Designation
// int nDesigID = EmpLifeCycle.GetPrvDesigId(oEmp.ID, oEmp.DesignationID);
// oDesig = Designation.Get((nDesigID));
// if (oDesig != null)
// table.Add(TagOutputConstant.EmpPrvDesignation, oDesig.Name);
// else
// table.Add(TagOutputConstant.EmpPrvDesignation, oDesig != null ? oDesig.Name : "________");
// //Previous Grade
// int nGradeID = EmpLifeCycle.GetPrvGradeId(oEmp.ID, oEmp.GradeID);
// oGrade = Grade.Get((nGradeID));
// if (oGrade != null)
// table.Add(TagOutputConstant.EmpPrvGrade, oGrade.Name);
// else
// table.Add(TagOutputConstant.EmpPrvGrade, oGrade == null ? "________" : oGrade.Name);
// //Previous Cost Center
// //int nCCID = EmpLifeCycle.GetPrvRCId(oEmp.ID);
// //if (olfc.Costcenter != null)
// // table.Add(TagOutputConstant.EmpPrvRC, olfc.Costcenter.Name);
// //else
// // table.Add(TagOutputConstant.EmpPrvRC, oEmpCC == null ? "________" : oEmpCC.Costcenter.Name);
// //Previous Location
// int nLoc = EmpLifeCycle.GetPrvLocationId(oEmp.ID, oEmp.LocationID);
// oLoc = Location.Get((nLoc));
// if (oLoc != null)
// table.Add(TagOutputConstant.EmpPrvLocation, oLoc.Name);
// else
// table.Add(TagOutputConstant.EmpPrvLocation, oLoc == null ? "________" : oLoc.Name);
// return table;
//}
//public Hashtable RefreshObjectForExceptionJL(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// EmployeeCostCenter oEmpCC = EmployeeCostCenter.Get(oEmp.ID);
// Bank oBank = null;
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (oEmpCC != null)
// {
// table.Add("<<RC>>", oEmpCC.Costcenter != null ? oEmpCC.Costcenter.Name : "______");
// }
// else
// {
// table.Add("<<RC>>", "______");
// }
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// table.Add("<<MOBILENO>>", emp.MobileNo);
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "_______");
// table.Add(TagOutputConstant.EmployeeLocation, emp.Location == null ? "________" : emp.Location.Name);
// table.Add(TagOutputConstant.EmployeeDept, emp.Department == null ? "________" : emp.Department.Name);
// table.Add(TagOutputConstant.PermanentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PermanentAddress : "_______");
// if (emp.EmployeePosting != null && !emp.EmployeePosting.ID.IsUnassigned)
// {
// table.Add("<<POSTINGPLACE>>", emp.EmployeePosting.Location == null ? "________" : emp.EmployeePosting.Location.Name);
// }
// else
// {
// table.Add("<<POSTINGPLACE>>", "________");
// }
// if (!oEmp.BranchID.IsUnassigned)
// {
// oBank = Bank.GetByBrancID(oEmp.BranchID);
// }
// table.Add("<<BANK>>", oBank != null ? oBank.Name : " ");
// table.Add("<<BRANCH>>", oEmp.Branch != null ? oEmp.Branch.Name : "_______");
// table.Add("<<ACCOUNTNO>>", oEmp.AccountNo);
// table.Add(TagOutputConstant.EmployeePresentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PresentAddress : "_______");
// table.Add("<<DAY>>", DateTime.Now.Date.ToString("dd") + " th");
// table.Add("<<MONTH>>", DateTime.Now.Date.ToString("MMMM"));
// table.Add("<<YEAR>>", DateTime.Now.Date.ToString("yyyy"));
// return table;
//}
//public Hashtable RefreshObjectForExceptionFamily(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// EmployeeCostCenter oEmpCC = EmployeeCostCenter.Get(oEmp.ID);
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// //oHREmp.EmployeePosting.Location
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "_______");
// if (emp.EmployeePosting != null && !emp.EmployeePosting.ID.IsUnassigned)
// {
// table.Add("<<POSTINGPLACE>>", emp.EmployeePosting.Location != null ? emp.EmployeePosting.Location.Name : "______");
// }
// else
// {
// table.Add("<<POSTINGPLACE>>", "______");
// }
// table.Add("<<SPOUSENAME>>", oHREmp.Spouses.Count > 0 ? oHREmp.Spouses[0].Name : "_______");
// //string oRes = Ease.CoreV35.Utility.Global.DateFunctions.DateDiff(Convert.ToDateTime("12/12/2000"), DateTime.Now);
// int i = 0;
// if (oHREmp.ChildrenList.Count > 0)
// {
// foreach (EmpChildren oItem in oHREmp.ChildrenList)
// {
// string sAge = Ease.CoreV35.Utility.Global.DateFunctions.DateDiff(oItem.BirthDate, DateTime.Now);
// table.Add("<<AGE" + i + ">>", sAge);
// table.Add("<<CN" + i + ">>", oItem.Name);
// i++;
// }
// for (int j = i; j < 4; j++)
// {
// table.Add("<<AGE" + j + ">>", "_______");
// table.Add("<<CN" + j + ">>", "_______");
// }
// }
// else
// {
// table.Add("<<AGE0>>", "_______");
// table.Add("<<CN0>>", "_______");
// table.Add("<<AGE1>>", "_______");
// table.Add("<<CN1>>", "_______");
// table.Add("<<AGE2>>", "_______");
// table.Add("<<CN2>>", "_______");
// table.Add("<<AGE3>>", "_______");
// table.Add("<<CN3>>", "_______");
// }
// //table.Add("<<AGE>>", oHREmp.ChildrenList.Count > 0 ? oHREmp.ChildrenList[0].BirthDate : "_______");
// return table;
//}
//public Hashtable RefreshObjectForExceptionMedical(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "_______");
// table.Add("<<SPOUSENAME>>", oHREmp.Spouses.Count > 0 ? oHREmp.Spouses[0].Name : "_______");
// if (oHREmp.Spouses.Count > 0 && oHREmp.Spouses[0].MarriageDate != DateTime.MinValue)
// {
// table.Add(TagOutputConstant.BirthDate, oHREmp.Spouses[0].MarriageDate.ToString("dd MMM yyyy"));
// }
// else
// {
// table.Add(TagOutputConstant.BirthDate, "_______");
// }
// if (oHREmp.Spouses.Count > 0)
// {
// table.Add("<<OCCUPATION>>", oHREmp.Spouses[0].Occupation != null ? oHREmp.Spouses[0].Occupation.Description : "_______");
// }
// else
// {
// table.Add("<<OCCUPATION>>", "_______");
// }
// int i = 0;
// if (oHREmp.ChildrenList.Count > 0)
// {
// foreach (EmpChildren oItem in oHREmp.ChildrenList)
// {
// table.Add("<<CNAME" + i + ">>", oItem.Name);
// table.Add("<<CBDATE" + i + ">>", oItem.BirthDate.ToString("dd MMM yyyy"));
// table.Add("<<COCCUPATION" + i + ">>", oItem.Occupation != null ? oItem.Occupation.Description : "_____");
// i++;
// }
// for (int j = i; j < 4; j++)
// {
// table.Add("<<CNAME" + j + ">>", "_______");
// table.Add("<<CBDATE" + j + ">>", "_______");
// table.Add("<<COCCUPATION" + j + ">>", "_______");
// }
// }
// else
// {
// table.Add("<<CNAME0>>", "_______");
// table.Add("<<CBDATE0>>", "_______");
// table.Add("<<COCCUPATION0>>", "_______");
// table.Add("<<CNAME1>>", "_______");
// table.Add("<<CBDATE1>>", "_______");
// table.Add("<<COCCUPATION1>>", "_______");
// table.Add("<<CNAME2>>", "_______");
// table.Add("<<CBDATE2>>", "_______");
// table.Add("<<COCCUPATION2>>", "_______");
// table.Add("<<CNAME3>>", "_______");
// table.Add("<<CBDATE3>>", "_______");
// table.Add("<<COCCUPATION3>>", "_______");
// }
// return table;
//}
//public Hashtable RefreshObjectForExceptionNominee(Employee oEmp)
//{
// bool CheckPF = false;
// bool CheckGr = false;
// bool CheckGI = false;
// bool CheckCS = false;
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// if (oHREmp.Nominees.Count > 0)
// {
// foreach (EmpNominee oItem in oHREmp.Nominees)
// {
// Relation oRelation = Relation.Get(oItem.RelationID);
// if (oItem.NominationPurposeID == (1))
// {
// CheckPF = true;
// table.Add("<<PFNOMINEE>>", oItem.Name != string.Empty ? oItem.Name : "______");
// table.Add("<<PRELATION>>", oRelation != null ? oRelation.Description : "_____");
// table.Add("<<PADDRESS>>", oItem.Address != string.Empty ? oItem.Address : "_____");
// }
// if (oItem.NominationPurposeID == (2))
// {
// CheckGr = true;
// table.Add("<<GSNOMINEE>>", oItem.Name != string.Empty ? oItem.Name : "_______");
// table.Add("<<GRELATION>>", oRelation != null ? oRelation.Description : "_______");
// table.Add("<<GADDRESS>>", oItem.Address != string.Empty ? oItem.Address : "_______");
// }
// if (oItem.NominationPurposeID == (3))
// {
// CheckGI = true;
// table.Add("<<GINOMINEE>>", oItem.Name != string.Empty ? oItem.Name : "_______");
// table.Add("<<GIRELATION>>", oRelation != null ? oRelation.Description : "______");
// table.Add("<<GIADDRESS>>", oItem.Address != string.Empty ? oItem.Address : "______");
// }
// if (oItem.NominationPurposeID == (4))
// {
// CheckCS = true;
// table.Add("<<CSNOMINEE>>", oItem.Name != string.Empty ? oItem.Name : "______");
// table.Add("<<CSRELATION>>", oRelation != null ? oRelation.Description : "______");
// table.Add("<<CSADDRESS>>", oItem.Address != string.Empty ? oItem.Address : "_______");
// }
// }
// }
// else
// {
// CheckPF = true;
// CheckGr = true;
// CheckGI = true;
// CheckCS = true;
// table.Add("<<PFNOMINEE>>", "_______");
// table.Add("<<PRELATION>>", "_______");
// table.Add("<<PADDRESS>>", "_______");
// table.Add("<<GSNOMINEE>>", "_______");
// table.Add("<<GRELATION>>", "_______");
// table.Add("<<GADDRESS>>", "_______");
// table.Add("<<GINOMINEE>>", "_______");
// table.Add("<<GIRELATION>>", "_______");
// table.Add("<<GIADDRESS>>", "_______");
// table.Add("<<CSNOMINEE>>", "_______");
// table.Add("<<CSRELATION>>", "_______");
// table.Add("<<CSADDRESS>>", "_______");
// }
// if (!CheckPF)
// {
// table.Add("<<PFNOMINEE>>", "_______");
// table.Add("<<PRELATION>>", "_______");
// table.Add("<<PADDRESS>>", "_______");
// }
// if (!CheckGr)
// {
// table.Add("<<GSNOMINEE>>", "_______");
// table.Add("<<GRELATION>>", "_______");
// table.Add("<<GADDRESS>>", "_______");
// }
// if (!CheckGI)
// {
// table.Add("<<GINOMINEE>>", "_______");
// table.Add("<<GIRELATION>>", "_______");
// table.Add("<<GIADDRESS>>", "_______");
// }
// if (!CheckCS)
// {
// table.Add("<<CSNOMINEE>>", "_______");
// table.Add("<<CSRELATION>>", "_______");
// table.Add("<<CSADDRESS>>", "_______");
// }
// return table;
//}
//public Hashtable RefreshObjectForExceptionLawAcknodledgement(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// return table;
//}
//public Hashtable RefreshObjectForExceptionCitizenAcknodledgement(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// if (oHREmp.Function != null)
// table.Add("<<FUNCTION>>", oHREmp.Function.Name);
// else
// table.Add("<<FUNCTION>>", "________");
// return table;
//}
//public Hashtable RefreshObjectForExceptionConductAcknodledgement(Employee oEmp)
//{
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// if (oHREmp.Function != null)
// table.Add("<<FUNCTION>>", oHREmp.Function.Name);
// else
// table.Add("<<FUNCTION>>", "________");
// return table;
//}
//public Hashtable RefreshObjectForExceptionQuestion(Employee oEmp)
//{
// bool CheckQ1 = false;
// bool CheckQ2 = false;
// bool CheckQ3 = false;
// bool CheckQ4 = false;
// bool CheckQ5 = false;
// bool CheckQ6 = false;
// bool CheckQ7 = false;
// bool CheckQ8 = false;
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "_______");
// if (oHREmp.EmpHRQuestionAnswers.Count > 0)
// {
// foreach (EmpHRQuestionAnswer oEmpHRQuestion in oHREmp.EmpHRQuestionAnswers)
// {
// if (oEmpHRQuestion.QuestionNo == "Q1")
// {
// CheckQ1 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q1One>>", oEmpHRQuestion.QAnswer);
// table.Add("<<Q1Two>>", "_____");
// table.Add("<<Q1Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (1))
// {
// table.Add("<<Q1One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (2))
// {
// table.Add("<<Q1Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (4))
// {
// table.Add("<<Q1Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q2")
// {
// CheckQ2 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q2One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q2Two>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (5))
// {
// table.Add("<<Q2One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (6))
// {
// table.Add("<<Q2Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q3")
// {
// CheckQ3 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q3One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q3Two>>", "_____");
// table.Add("<<Q3Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (7))
// {
// table.Add("<<Q3One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (8))
// {
// table.Add("<<Q3Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (9))
// {
// table.Add("<<Q3Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q4")
// {
// CheckQ4 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q4One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q4Two>>", "_____");
// table.Add("<<Q4Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (10))
// {
// table.Add("<<Q4One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (11))
// {
// table.Add("<<Q4Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (12))
// {
// table.Add("<<Q4Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q5")
// {
// CheckQ5 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q5One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q5Two>>", "_____");
// table.Add("<<Q5Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (13))
// {
// table.Add("<<Q5One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (14))
// {
// table.Add("<<Q5Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (15))
// {
// table.Add("<<Q5Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q6")
// {
// CheckQ6 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q6One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q6Two>>", "_____");
// table.Add("<<Q6Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (16))
// {
// table.Add("<<Q6One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (17))
// {
// table.Add("<<Q6Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (18))
// {
// table.Add("<<Q6Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q7")
// {
// CheckQ7 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q7One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q7Two>>", "_____");
// table.Add("<<Q7Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (19))
// {
// table.Add("<<Q7One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (20))
// {
// table.Add("<<Q7Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (21))
// {
// table.Add("<<Q7Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// else if (oEmpHRQuestion.QuestionNo == "Q8")
// {
// CheckQ8 = true;
// if (oEmpHRQuestion.QAnswer.ToUpper() == "NO")
// {
// table.Add("<<Q8One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// table.Add("<<Q8Two>>", "_____");
// table.Add("<<Q8Three>>", "_____");
// }
// else
// {
// if (oEmpHRQuestion.JoiningQuestionary.int == (22))
// {
// table.Add("<<Q8One>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (23))
// {
// table.Add("<<Q8Two>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// else if (oEmpHRQuestion.JoiningQuestionary.int == (24))
// {
// table.Add("<<Q8Three>>", oEmpHRQuestion.QAnswer != string.Empty ? oEmpHRQuestion.QAnswer : "_____");
// }
// }
// }
// }
// }
// else
// {
// CheckQ1 = true;
// CheckQ2 = true;
// CheckQ3 = true;
// CheckQ4 = true;
// CheckQ5 = true;
// CheckQ6 = true;
// CheckQ7 = true;
// CheckQ8 = true;
// table.Add("<<Q1One>>", "_____");
// table.Add("<<Q1Two>>", "_____");
// table.Add("<<Q1Three>>", "_____");
// table.Add("<<Q2One>>", "_____");
// table.Add("<<Q2Two>>", "_____");
// table.Add("<<Q3One>>", "_____");
// table.Add("<<Q3Two>>", "_____");
// table.Add("<<Q3Three>>", "_____");
// table.Add("<<Q4One>>", "_____");
// table.Add("<<Q4Two>>", "_____");
// table.Add("<<Q4Three>>", "_____");
// table.Add("<<Q5One>>", "_____");
// table.Add("<<Q5Two>>", "_____");
// table.Add("<<Q5Three>>", "_____");
// table.Add("<<Q6One>>", "_____");
// table.Add("<<Q6Two>>", "_____");
// table.Add("<<Q6Three>>", "_____");
// table.Add("<<Q7One>>", "_____");
// table.Add("<<Q7Two>>", "_____");
// table.Add("<<Q7Three>>", "_____");
// table.Add("<<Q8One>>", "_____");
// table.Add("<<Q8Two>>", "_____");
// table.Add("<<Q8Three>>", "_____");
// }
// if (!CheckQ1)
// {
// table.Add("<<Q1One>>", "_____");
// table.Add("<<Q1Two>>", "_____");
// table.Add("<<Q1Three>>", "_____");
// }
// if (!CheckQ2)
// {
// table.Add("<<Q2One>>", "_____");
// table.Add("<<Q2Two>>", "_____");
// }
// if (!CheckQ3)
// {
// table.Add("<<Q3One>>", "_____");
// table.Add("<<Q3Two>>", "_____");
// table.Add("<<Q3Three>>", "_____");
// }
// if (!CheckQ4)
// {
// table.Add("<<Q4One>>", "_____");
// table.Add("<<Q4Two>>", "_____");
// table.Add("<<Q4Three>>", "_____");
// }
// if (!CheckQ5)
// {
// table.Add("<<Q5One>>", "_____");
// table.Add("<<Q5Two>>", "_____");
// table.Add("<<Q5Three>>", "_____");
// }
// if (!CheckQ6)
// {
// table.Add("<<Q6One>>", "_____");
// table.Add("<<Q6Two>>", "_____");
// table.Add("<<Q6Three>>", "_____");
// }
// if (!CheckQ7)
// {
// table.Add("<<Q7One>>", "_____");
// table.Add("<<Q7Two>>", "_____");
// table.Add("<<Q7Three>>", "_____");
// }
// if (!CheckQ8)
// {
// table.Add("<<Q8One>>", "_____");
// table.Add("<<Q8Two>>", "_____");
// table.Add("<<Q8Three>>", "_____");
// }
// return table;
//}
//public Hashtable RefreshTags(Employee oEmp, EmpLifeCycle olfc)
//{
// OrganogramBasic ogNode;
// Hashtable table = new Hashtable();
// HREmployee oHREmp = new HREmployee();
// EmployeeCostCenter oEmpCC = EmployeeCostCenter.Get(oEmp.ID);
// oHREmp = oHREmp.Get(oEmp.ID);
// table.Clear();
// Employee emp;
// emp = oEmp;
// string basicSalary = string.Empty;
// if (olfc.BasicSalary != null && olfc.BasicSalary != 0.0)
// basicSalary = "Tk. " + PayrollPayrollGlobalFunctions.TakaFormat((double)olfc.BasicSalary) + "/- (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(Convert.ToDouble(olfc.BasicSalary)) + " )";
// else
// basicSalary = "Tk. " + PayrollPayrollGlobalFunctions.TakaFormat(emp.BasicSalary) + "/- (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(emp.BasicSalary) + " )";
// //////////////////////////////////////////////////////////////////////////////////////////////
// string category = "________";
// if (emp.Category != null) category = emp.Category.Name;
// table.Add(TagOutputConstant.EmploymentType, category);
// DateTime retirementdate;
// if (emp.JoiningDate != null && emp.JoiningDate != DateTime.MinValue)
// {
// retirementdate = emp.JoiningDate.AddYears(57);
// table.Add(TagOutputConstant.RetirementDate, retirementdate.ToString("dd MMM yyyy"));
// }
// else table.Add(TagOutputConstant.RetirementDate, "________");
// table.Add(TagOutputConstant.EndOfContractDate,
// emp.EndOfContractDate != null && emp.EndOfContractDate != DateTime.MinValue ? (((DateTime)(emp.EndOfContractDate)).ToString("dd MMM yyyy")) : ("________"));
// FSTran fstran = FSTran.Get(emp.ID.Integer);
// if (fstran != null)
// {
// table.Add(TagOutputConstant.NoticeDate, fstran.NoticeDate != null && fstran.NoticeDate != DateTime.MinValue ?
// fstran.NoticeDate.ToString("dd MMM yyyy") : "________");
// }
// else
// {
// table.Add(TagOutputConstant.NoticeDate, "________");
// }
// /////////////////////////////////////////////////////////////////////////////////////////////
// table.Add(TagOutputConstant.EmployeeNo, emp.EmployeeNo);
// table.Add(TagOutputConstant.FirstName, oHREmp.FirstName);
// table.Add(TagOutputConstant.MiddleName, oHREmp.MiddleName);
// table.Add(TagOutputConstant.LastName, oHREmp.LastName);
// table.Add(TagOutputConstant.FullName, oHREmp.Name);
// if (olfc.Designation != null)
// table.Add(TagOutputConstant.EmployeeDesig, emp.DescriptionText);
// else
// table.Add(TagOutputConstant.EmployeeDesig, emp.Designation != null ? emp.DescriptionText : "________");
// //Previous Designation
// int? nDesigID = EmpLifeCycle.EmpPrevDesg(oEmp.ID);
// Designation oDesig = null;
// if (nDesigID != null)
// {
// oDesig = Designation.Get(((int)nDesigID));
// if (oDesig != null)
// table.Add(TagOutputConstant.EmpPrvDesignation, oDesig.Name);
// else
// table.Add(TagOutputConstant.EmpPrvDesignation, oDesig != null ? oDesig.Name : "________");
// }
// else table.Add(TagOutputConstant.EmpPrvDesignation, oDesig != null ? oDesig.Name : "________");
// if (olfc.Grade != null)
// table.Add(TagOutputConstant.EmployeeGrade, olfc.Grade.Name);
// else
// table.Add(TagOutputConstant.EmployeeGrade, emp.Grade == null ? "________" : emp.Grade.Name);
// //Previous Grade
// int nGradeID = EmpLifeCycle.GetPrvGradeId(oEmp.ID, oEmp.GradeID);
// Grade oGrade = Grade.Get((nGradeID));
// if (oGrade != null)
// table.Add(TagOutputConstant.EmpPrvGrade, oGrade.Name);
// else
// table.Add(TagOutputConstant.EmpPrvGrade, oGrade == null ? "________" : oGrade.Name);
// if (olfc.Department != null)
// table.Add(TagOutputConstant.EmployeeDept, olfc.Department.Name);
// else
// table.Add(TagOutputConstant.EmployeeDept, emp.Department == null ? "________" : emp.Department.Name);
// if (olfc.Costcenter != null)
// table.Add(TagOutputConstant.EmployeeCC, olfc.Costcenter.Name);
// else
// table.Add(TagOutputConstant.EmployeeCC, oEmpCC == null ? "________" : oEmpCC.Costcenter.Name);
// //Previous Cost Center
// int nCCID = EmpLifeCycle.GetPrvRCId(oEmp.ID);
// Costcenter CostCenter = Costcenter.Get((nCCID));
// if (CostCenter != null)
// table.Add(TagOutputConstant.EmpPrvRC, CostCenter.Name);
// else
// table.Add(TagOutputConstant.EmpPrvRC, CostCenter == null ? "________" : CostCenter.Name);
// if (olfc.Location != null)
// table.Add(TagOutputConstant.EmployeeLocation, olfc.Location.Name);
// else
// table.Add(TagOutputConstant.EmployeeLocation, emp.Location == null ? "________" : emp.Location.Name);
// //Previous Location
// int nLoc = EmpLifeCycle.GetPrvLocationId(oEmp.ID, oEmp.LocationID);
// Location oLoc = Location.Get((nLoc));
// if (oLoc != null)
// table.Add(TagOutputConstant.EmpPrvLocation, oLoc.Name);
// else
// table.Add(TagOutputConstant.EmpPrvLocation, oLoc == null ? "________" : oLoc.Name);
// table.Add(TagOutputConstant.DateOfConfirmation, (emp.ConfirDate != null && emp.ConfirDate != DateTime.MinValue) ? emp.ConfirDate.ToString("dd MMM yyyy") : "_______");
// table.Add(TagOutputConstant.PromotionEffectiveDate, (olfc.EffectDate != null && olfc.EffectDate != DateTime.MinValue) ? olfc.EffectDate.ToString("dd MMM yyyy") : "_______");
// table.Add(TagOutputConstant.PassportNo, (oHREmp.PassportNo != String.Empty) ? oHREmp.PassportNo : "_______");
// //olfc.EffectDate
// table.Add(TagOutputConstant.EmployeePresentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PresentAddress : "_______");
// table.Add(TagOutputConstant.EmployeeBasicSalary, (olfc.BasicSalary == null) ? emp.BasicSalary : olfc.BasicSalary);
// table.Add(TagOutputConstant.BasicInWords, basicSalary);
// table.Add(TagOutputConstant.EmployeeJoiningDate, emp.JoiningDate.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.CurrentDate, DateTime.Now.Date.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.EmpConfirmDate, emp.ConfirDate.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.PermanentAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PermanentAddress : "_______");
// table.Add(TagOutputConstant.BirthDate, emp.BirthDate.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.TIN, oHREmp.TinNo);
// table.Add(TagOutputConstant.FatherName, oHREmp.FatherName);
// table.Add(TagOutputConstant.MotherName, oHREmp.MotherName);
// table.Add(TagOutputConstant.PFDeduction, PayrollPayrollGlobalFunctions.TakaFormat(emp.BasicSalary / 10.00));
// table.Add(TagOutputConstant.Salutation, emp.Gender == EnumGender.Male ? "Mr." : "Ms.");
// table.Add(TagOutputConstant.HeShe, emp.Gender == EnumGender.Male ? "He" : "She");
// table.Add(TagOutputConstant.heshe, emp.Gender == EnumGender.Male ? "he" : "she");
// table.Add(TagOutputConstant.HisHer, emp.Gender == EnumGender.Male ? "His" : "Her");
// table.Add(TagOutputConstant.hisher, emp.Gender == EnumGender.Male ? "his" : "her");
// table.Add(TagOutputConstant.HimHer, emp.Gender == EnumGender.Male ? "Him" : "Her");
// table.Add(TagOutputConstant.himher, emp.Gender == EnumGender.Male ? "him" : "her");
// table.Add(TagOutputConstant.SBUName, Payroll.BO.SystemInformation.CurrentSysInfo.name);
// table.Add(TagOutputConstant.SBUAddress, Payroll.BO.SystemInformation.CurrentSysInfo.corporateAddress);
// if (emp.Department != null && emp.Department.Parent != null && emp.Department.Parent.Parent != null)
// table.Add(TagOutputConstant.EmployeeDiv, emp.Department.Parent.Parent.Name);
// else
// table.Add(TagOutputConstant.EmployeeDiv, "________");
// List<OrganogramEmployee> emps = OrganogramEmployee.GetByEmp(oEmp.ID);
// if (emps == null || emps.Count == 0)
// {
// table.Add(TagOutputConstant.LineManagerName, "");
// table.Add(TagOutputConstant.LineManagerDesig, "");
// //throw new Exception("Employee is not posted in Organ-O-Gram.");
// }
// else
// {
// ogNode = OrganogramBasic.Get(emps[0].NodeID);
// if (ogNode.Parent != null)
// {
// ogNode = ogNode.Parent;
// if (ogNode.EmployeeAssigned == true)
// {
// Employee oOrganEmp = ogNode.GetAssignedEmployee();
// table.Add(TagOutputConstant.LineManagerName, oOrganEmp == null ? "________" : oOrganEmp.Name);
// table.Add(TagOutputConstant.LineManagerDesig, oOrganEmp.Designation == null ? "________" : oOrganEmp.DescriptionText);
// }
// }
// else
// {
// table.Add(TagOutputConstant.LineManagerName, "");
// table.Add(TagOutputConstant.LineManagerDesig, "");
// }
// }
// //table.Add(TagOutputConstant.GroupHeadHRName, "Arif Shahriar");
// //table.Add(TagOutputConstant.GroupHeadHR, "Group Head of HR");
// return table;
//}
//public Hashtable RefreshObjectForemps(Candidate can)
//{
// Hashtable table = new Hashtable();
// Employee emp = Employee.Get(can.EmployeeId);
// table.Add(TagOutputConstant.CandidateName, emp.Name);
// table.Add(TagOutputConstant.StartDate, can.StartDate);
// return table;
//}
//public Hashtable RefreshObjectForcans(Candidate can)
//{
// Hashtable table = new Hashtable();
// CV cv = CV.Get(can.CvId);
// table.Add(TagOutputConstant.CandidateName, cv.Name);
// table.Add(TagOutputConstant.StartDate, can.StartDate);
// return table;
//}
//#region Letter Generate Functions
//public string Generate(int tagoutputID, int objectID, int supportID, int candidateID, string sFPath)
//{
// string[] sBody = { };
// string sFilePath = string.Empty;
// Hashtable table = new Hashtable();
// _LetterTemplte = null;
// objectID = objectID == null ? (0) : objectID;
// supportID = supportID == null ? (0) : supportID;
// PhotoPath oPhotoPath = PhotoPath.Get((1));
// #region Expandable Objects
// // These Objects are create as per demand of diferent letters
// // These variables could grow depending on the type of ObjectID,suppordID etc
// Employee oEmp = null;
// Grade oGrade = null;
// //For Recruitment
// Candidate oCandidate = null;
// CV oCV = null;
// RecruitementProcess oReProcess = null;
// RecruitmentLetters oReqLetter = null;
// RecruitementStep oRStep = null;
// List<ADParameter> adParams;
// ADParameter tempAdParam;
// //Letter Request Notification
// HRRequest oHRRequest = null;
// #endregion
// string sLetterName = string.Empty;
// table = new Hashtable();
// _LetterTemplte = Get((tagoutputID.Integer));
// switch (tagoutputID.Integer)
// {
// case FixedLetterTemplte.Candidate_Offer_Letter:
// #region Offer Letter
// oCandidate = RecruitementProcess.GetByCandediateID(candidateID);
// sLetterName = "Offer Letter";
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(candidateID);
// if (oCandidate.IsEmployee)
// {
// oEmp = Employee.Get(oCandidate.EmployeeId);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// table.Remove(TagOutputConstant.EmployeeJoiningDate);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// }
// else
// {
// oCV = CV.Get(oCandidate.CvId);
// table.Add(TagOutputConstant.FullName, oCV.Name);
// table.Add(TagOutputConstant.CandidateName, oCV.Name);
// table.Add(TagOutputConstant.PermanentAddress, oCV.ContactAddress);
// table.Add(TagOutputConstant.Salutation, "Mr./Ms.");
// table.Add(TagOutputConstant.SBUName, Payroll.BO.SystemInformation.CurrentSysInfo.name);
// table.Add(TagOutputConstant.CurrentDate, DateTime.Now.Date.ToString("dd MMMM yyyy"));
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oCV.TrackNo + "-" + sLetterName + ".doc";
// }
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.EmployeeJoiningDate, oReqLetter == null ? " " :
// (oReqLetter.AcceptOfferBefore == DateTime.MinValue ? " " :
// oReqLetter.AcceptOfferBefore.ToString("dd MMM yyyy")));
// #endregion
// break;
// case FixedLetterTemplte.Candidate_Appointment_Letter:
// #region Appointment Letter
// oCandidate = RecruitementProcess.GetByCandediateID(candidateID);
// double TotalAllowance, Basic, HouseRent, Conveyence, Transport;
// TotalAllowance = Basic = HouseRent = Conveyence = Transport = 0.0;
// sLetterName = "Appointment Letter";
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(candidateID);
// oGrade = Grade.Get(oReqLetter.GradeID);
// adParams = ADParameter.Get(oReqLetter.GradeID, EnumEntitleType.Grade, EnumAllowOrDeduct.Allowance);
// Func<ADParameter, double, double> calculateOther = (a, b) =>
// a != null ? (a.PercentOfBasic == 0.0 ? a.FlatAmount : b * a.PercentOfBasic / 100) : 0.0;
// Basic = oReqLetter.BasicSalary;
// HouseRent = calculateOther(adParams.Where(obj => obj.AllowDeductID.Integer == 1).SingleOrDefault(), Basic);
// Conveyence = calculateOther(adParams.Where(obj => obj.AllowDeductID.Integer == 2).SingleOrDefault(), Basic);
// Transport = calculateOther(adParams.Where(obj => obj.AllowDeductID.Integer == 5).SingleOrDefault(), Basic);
// TotalAllowance = Basic + HouseRent + Conveyence + Transport;
// table = new Hashtable();
// table.Add(TagOutputConstant.CurrentDate, DateTime.Now.Date.ToString("dd MMMM yyyy"));
// table.Add(TagOutputConstant.CandidateDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.CandidateGrade, oGrade != null ? oGrade.Name : " ________ ");
// table.Add(TagOutputConstant.AcceptWithIN, oReqLetter.AppAcceptBefore != DateTime.MinValue ?
// oReqLetter.AppAcceptBefore.ToString("dd MMMM yyyy") :
// " ________ ");
// table.Add(TagOutputConstant.JoiningBefore, oReqLetter.JoiningBeforeDate != DateTime.MinValue ?
// oReqLetter.JoiningBeforeDate.ToString("dd MMMM yyyy") :
// " ________ ");
// table.Add(TagOutputConstant.NoticePeriodMonth, oReqLetter.NoticePeriod);
// table.Add(TagOutputConstant.CarAllowDesript, oReqLetter.CarEligible ?
// "You will be immediately eligible to the bank car scheme policy as per entitlement for your grade." :
// "\n");
// table.Add(TagOutputConstant.CandidateBasic, Basic.ToString());
// table.Add(TagOutputConstant.AllowHR, HouseRent.ToString());
// table.Add(TagOutputConstant.AllowLTA, Transport.ToString());
// table.Add(TagOutputConstant.AllowConveyance, Conveyence.ToString());
// table.Add(TagOutputConstant.AllowTotal, TotalAllowance.ToString());
// table.Add(TagOutputConstant.GroupHeadHR, " ________ ");
// if (oCandidate.IsEmployee)
// {
// HREmployee oHREmp = new HREmployee();
// oHREmp = oHREmp.Get(oCandidate.EmployeeId);
// oEmp = Employee.Get(oCandidate.EmployeeId);
// table.Add(TagOutputConstant.CandidateName, oEmp.Name);
// table.Add(TagOutputConstant.CandidateAddress, oHREmp.Contacts.Count > 0 ? oHREmp.Contacts[0].PresentAddress : " ________ ");
// table.Add(TagOutputConstant.Salutation, oEmp.Gender == EnumGender.Male ? "Mr." : (oEmp.Gender == EnumGender.Female ? "Ms." : "Mr./Ms."));
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// }
// else
// {
// oCV = CV.Get(oCandidate.CvId);
// table.Add(TagOutputConstant.CandidateName, oCV.Name);
// table.Add(TagOutputConstant.CandidateAddress, oCV.ContactAddress);
// table.Add(TagOutputConstant.Salutation, "Mr./Ms.");
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oCV.TrackNo + "-" + sLetterName + ".doc";
// }
// #endregion
// break;
// case FixedLetterTemplte.Visa_Letter_Business_Trip_With_Family:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa Letter Business Trip With Family";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Salary_Certificate:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Salary Certificate";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Visa_Letter_Business_Trip:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa Letter Business Trip";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Visa_Letter_Personal_Trip:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa Letter Personal Trip";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Visa_Letter_With_Family:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa Letter With Family";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Foreign_Currency_Bank_AC_For_secondee:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Foreign Currency Bank AC For secondee";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Visa_for_Business_trip_or_Family:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa for Business trip or Family";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Visa_for_Company_Business:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Visa for Company Business";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Loan_Certificate_Letter_for_Authorization:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Loan Certificate Letter for Authorization";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Loan_Certificate_Take_Home_Salary:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Loan Certificate Take Home Salary";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// case FixedLetterTemplte.Loan_Letter_Bank:
// oEmp = Employee.Get(candidateID);
// oHRRequest = HRRequest.Get(objectID);
// sLetterName = "Loan Letter Bank";
// table = this.RefreshObject(oEmp);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// default:
// _LetterTemplte = _LetterTemplte.Get(tagoutputID);
// sLetterName = _LetterTemplte.Subject;
// if (oCandidate.IsEmployee == false)
// {
// table.Add(TagOutputConstant.CandidateName, oCV.Name);
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oCV.TrackNo + "-" + sLetterName + ".doc";
// }
// else
// {
// sFilePath = sFPath.TrimEnd('\\') + "\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// }
// break;
// }
// if (table != null)
// {
// MSWord file = new MSWord();
// FileInfo ossInfo = null;
// file.OriginalFile = _LetterTemplte.FilePath.Trim();
// ossInfo = new FileInfo(sFilePath);
// if (ossInfo.Exists)
// {
// ossInfo.Delete();
// }
// File.Copy(file.OriginalFile, sFilePath, true);
// file = new MSWord();
// file.OpenWordApplication();
// file.OriginalFile = _LetterTemplte.FilePath.Trim();
// file.ReplaceWords(sFilePath, table);
// file.CloseWordApplication();
// }
// return sFilePath;
//}
//public string Generate(int tagoutputID, int objectID, int supportID, int empOrCVID, FileStream oStream)
//{
// string[] sBody = { };
// string sFilePath = string.Empty;
// Hashtable table = new Hashtable();
// objectID = objectID == null ? (0) : objectID;
// supportID = supportID == null ? (0) : supportID;
// PhotoPath oPhotoPath = PhotoPath.Get((1));
// Employee oEmp = null;
// Candidate oCandidate = null;
// CV oCV = null;
// RecruitementProcess oReProcess = null;
// RecruitmentLetters oReqLetter = null;
// RecruitementStep oRStep = null;
// string sLetterName = string.Empty;
// switch (tagoutputID.Integer)
// {
// case FixedLetterTemplte.Intvw_BrdMember_Notify_Mail:
// #region Board Member Notification
// sLetterName = "Board Member Notification";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(empOrCVID);
// oRStep = RecruitementProcess.GetRecruitmentStep(objectID, supportID);
// table.Add(TagOutputConstant.RecruitmentName, oReProcess.Description.Trim());
// switch (oRStep.Type.Integer)
// {
// case 1:
// table.Add(TagOutputConstant.ExamName, "Written");
// break;
// case 2:
// table.Add(TagOutputConstant.ExamName, "Viva");
// break;
// case 3:
// table.Add(TagOutputConstant.ExamName, "Final Selection");
// break;
// default:
// break;
// }
// table.Add(TagOutputConstant.ExamDateTime, oRStep.MeetingTime + " " + oRStep.StartDate.ToString("dd MMM yyyy"));
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Employee_Intvw_Notify_Mail:
// #region Employee Interview Request
// sLetterName = "Employee Interview Request";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// table.Add(TagOutputConstant.RecruitmentName, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.RecruitmentStartDate, oReProcess.StartDate.ToString("dd MMM yyyy"));
// table.Remove(TagOutputConstant.GroupHeadHR);
// table.Add(TagOutputConstant.GroupHeadHR, "Head of HR");
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Applicant_Intvw_Notify_Mail:
// #region Candidate Interview Request
// sLetterName = "Candidate Interview Request";
// oCV = CV.Get(empOrCVID);
// table = new Hashtable();
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// table.Add(TagOutputConstant.CandidateName, oCV.Name);
// table.Add(TagOutputConstant.RecruitmentName, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.RecruitmentStartDate, oReProcess.StartDate.ToString("dd MMM yyyy"));
// table.Add(TagOutputConstant.GroupHeadHR, "Head of HR");
// table.Add(TagOutputConstant.SBUName, Payroll.BO.SystemInformation.CurrentSysInfo.name);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oCV.TrackNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Welcome_Mail_New_Joiner:
// #region Candidate Welcome Mail
// sLetterName = "Candidate Welcome Mail";
// oCV = CV.Get(empOrCVID);
// table = new Hashtable();
// table.Add(TagOutputConstant.FullName, oCV.Name);
// table.Add(TagOutputConstant.CandidateName, oCV.Name);
// table.Add(TagOutputConstant.PermanentAddress, oCV.ContactAddress);
// table.Add(TagOutputConstant.Salutation, "Mr./Ms.");
// table.Add(TagOutputConstant.SBUName, Payroll.BO.SystemInformation.CurrentSysInfo.name);
// table.Add(TagOutputConstant.CurrentDate, DateTime.Now.Date.ToString("dd MMMM yyyy"));
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// // not needed now,but could be used
// //oReqLetter = RecruitmentLetters.Get(supportID);
// //string sAcceptOfferDate = oReqLetter == null ? " " :
// // (oReqLetter.AcceptOfferBefore == DateTime.MinValue ? " " :
// // oReqLetter.AcceptOfferBefore.ToString("dd MMM yyyy"));
// //table.Add(TagOutputConstant.EmployeeJoiningDate, sAcceptOfferDate);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oCV.TrackNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Welcome_Mail_Employee:
// #region Employee Welcome Mail
// sLetterName = "Employee Welcome Mail";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// // not needed now,but could be used
// //oReqLetter = RecruitmentLetters.Get(supportID);
// //string sAcceptOfferDate = oReqLetter == null ? " " :
// // (oReqLetter.AcceptOfferBefore == DateTime.MinValue ? " " :
// // oReqLetter.AcceptOfferBefore.ToString("dd MMM yyyy"));
// //table.Add(TagOutputConstant.EmployeeJoiningDate, sAcceptOfferDate);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Induction_Request_New_Joiner:
// #region Induction Request
// sLetterName = "Induction Request New Join";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// table.Remove(TagOutputConstant.EmployeeJoiningDate);
// table.Remove(TagOutputConstant.CandidateName);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(supportID);
// oCandidate = RecruitementProcess.GetByCandediateID(supportID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.EmployeeJoiningDate, oReqLetter == null ? " " :
// (oReqLetter.JoiningBeforeDate == DateTime.MinValue ? " " :
// oReqLetter.JoiningBeforeDate.ToString("dd MMM yyyy")));
// table.Add(TagOutputConstant.CandidateName, oCandidate.IsEmployee ?
// Employee.Get(oCandidate.EmployeeId).Name :
// CV.Get(oCandidate.CvId).Name);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Induction_Request_Employee:
// #region Induction Request Empolyee
// sLetterName = "Induction Request";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// table.Remove(TagOutputConstant.EmployeeJoiningDate);
// table.Remove(TagOutputConstant.CandidateName);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(supportID);
// oCandidate = RecruitementProcess.GetByCandediateID(supportID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.EmployeeJoiningDate, oReqLetter == null ? " " :
// (oReqLetter.JoiningBeforeDate == DateTime.MinValue ? " " :
// oReqLetter.JoiningBeforeDate.ToString("dd MMM yyyy")));
// table.Add(TagOutputConstant.CandidateName, oCandidate.IsEmployee ?
// Employee.Get(oCandidate.EmployeeId).Name :
// CV.Get(oCandidate.CvId).Name);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Announcement_New_Joiner:
// #region Joining Announcement New Join
// sLetterName = "Joining Announcement";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// table.Remove(TagOutputConstant.EmployeeJoiningDate);
// table.Remove(TagOutputConstant.CandidateName);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(supportID);
// oCandidate = RecruitementProcess.GetByCandediateID(supportID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.EmployeeJoiningDate, oReqLetter == null ? " " :
// (oReqLetter.JoiningBeforeDate == DateTime.MinValue ? " " :
// oReqLetter.JoiningBeforeDate.ToString("dd MMM yyyy")));
// table.Add(TagOutputConstant.CandidateName, oCandidate.IsEmployee ?
// Employee.Get(oCandidate.EmployeeId).Name :
// CV.Get(oCandidate.CvId).Name);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// case FixedLetterTemplte.Announcement_Employee:
// #region Joining Announcement Employee
// sLetterName = "Joining Announcement";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// table.Remove(TagOutputConstant.EmployeeDesig);
// table.Remove(TagOutputConstant.EmployeeJoiningDate);
// table.Remove(TagOutputConstant.CandidateName);
// oReProcess = RecruitementProcess.GetByProcessId(objectID);
// oReqLetter = RecruitmentLetters.GetByCandidateID(supportID);
// oCandidate = RecruitementProcess.GetByCandediateID(supportID);
// table.Add(TagOutputConstant.EmployeeDesig, oReProcess.Description.Trim());
// table.Add(TagOutputConstant.EmployeeJoiningDate, oReqLetter == null ? " " :
// (oReqLetter.JoiningBeforeDate == DateTime.MinValue ? " " :
// oReqLetter.JoiningBeforeDate.ToString("dd MMM yyyy")));
// table.Add(TagOutputConstant.CandidateName, oCandidate.IsEmployee ?
// Employee.Get(oCandidate.EmployeeId).Name :
// CV.Get(oCandidate.CvId).Name);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// #endregion
// break;
// default:
// sLetterName = "Other Tags";
// oEmp = Employee.Get(empOrCVID);
// table = this.RefreshObject(oEmp);
// sFilePath = oPhotoPath.LetterTempPath + "\\Generated\\" + oEmp.EmployeeNo + "-" + sLetterName + ".doc";
// break;
// }
// if (table != null)
// {
// MSWord file = new MSWord();
// FileInfo ossInfo = null;
// file.OriginalFile = oStream.Name;
// ossInfo = new FileInfo(sFilePath);
// if (ossInfo.Exists)
// {
// ossInfo.Delete();
// }
// File.Copy(file.OriginalFile, sFilePath, true);
// file = new MSWord();
// file.OpenWordApplication();
// file.OriginalFile = oStream.Name;
// file.ReplaceWords(sFilePath, table);
// file.CloseWordApplication();
// }
// return sFilePath;
//}
////public void RecruitmentCheck(int nProcessID, int nTagOutputID, List<ID> oIDs,int nStepID)
////{
//// _IDs = oIDs;
//// switch (nTagOutputID.Integer)
//// {
//// case 1:
//// GenerateForBoardMember(nTagOutputID.Integer, nProcessID,nStepID);
//// break;
//// case 2:
//// break;
//// case 3:
//// break;
//// case 4:
//// break;
//// default:
//// break;
//// }
////}
////public void GenerateForBoardMember(int nTagID, int nProcessID,int nStepID)
////{
//// _LetterTemplte.Get((2));
//// MSWord file = new MSWord();
//// try
//// {
//// Hashtable table = new Hashtable();
//// file.OriginalFile = _LetterTemplte.FilePath;
//// FileInfo oFile = new FileInfo(_LetterTemplte.FilePath.Trim());
//// #region Generating Letter
//// LetterTemplte otmp = new LetterTemplte();
//// foreach (int oID in _IDs)
//// {
//// #region Generate document
//// Employee oEmp = Employee.Get(oID);
//// FileInfo ossInfo = null;
//// ossInfo = new FileInfo(_LetterTemplte.FilePath + "\\" + oEmp.EmployeeNo + "-" + "BoardMember" + ".doc");
//// table = otmp.RefreshTagsForBoarMember(oEmp, nProcessID,nStepID);
//// if (ossInfo.Exists)
//// {
//// ossInfo.Delete();
//// }
//// if (table != null)
//// {
//// File.Copy(_LetterTemplte.FilePath, _LetterTemplte.FilePath.Trim() + "\\" + oEmp.EmployeeNo + "-" + "BoardMember" + ".doc", true);
//// file = new MSWord();
//// file.OpenWordApplication();
//// file.OriginalFile = _LetterTemplte.FilePath;//lblFilePath.Text.Trim();// +".doc";
//// file.ReplaceWords(_LetterTemplte.FilePath.Trim() + "\\" + oEmp.EmployeeNo + "-" + "BoardMember" + ".doc", table);
//// file.CloseWordApplication();
//// }
//// #endregion Generate document
//// }
//// #endregion
//// }
//// catch (Exception ex)
//// {
//// file.CloseWordApplication();
//// }
////}
////public Hashtable RefreshTagsForBoarMember(Employee oEmp, int nProcessID,int nStepID)
////{
//// Hashtable table = RefreshObject(oEmp);
//// RecruitementProcess oReProcess = RecruitementProcess.GetByProcessId(nProcessID);
//// RecruitementStep oRStep = RecruitementProcess.GetRecruitmentStep(nProcessID, nStepID.Integer, 1);
//// table.Add(TagOutputConstant.RecruitmentName, oReProcess.Description);
//// if(nStepID.Integer==1)
//// {
//// table.Add(TagOutputConstant.ExamName, "Written");
//// }
//// else if(nStepID.Integer==2)
//// {
//// table.Add(TagOutputConstant.ExamName, "Viva");
//// }
//// else
//// {
//// table.Add(TagOutputConstant.ExamName, "Final Selection");
//// }
//// table.Add(TagOutputConstant.ExamDateTime, oRStep.StartDate);
//// return table;
////}
//#endregion
////public void InitializeMailMessage()
////{
//// throw new System.NotImplementedException();
////}
////public void GetMessage()
////{
//// throw new System.NotImplementedException();
////}
//public LetterTemplte Get(int documentID)
//{
// LetterTemplte oLetterTemplte = null;
// #region Cache Header
// oLetterTemplte = (LetterTemplte)_cache["Get", documentID];
// if (oLetterTemplte != null)
// return oLetterTemplte;
// #endregion
// oLetterTemplte = LetterTemplte.Service.Get(documentID);
// #region Cache Footer
// _cache.Add(oLetterTemplte, "Get", documentID);
// #endregion
// return oLetterTemplte;
//}
//public int Save(FileStream stream)
//{
// this.SetAuditTrailProperties();
// return LetterTemplte.Service.Save(this, stream);
//}
//public void Delete()
//{
// LetterTemplte.Service.Delete(this.ID);
//}
//public static List<LetterTemplte> Get()
//{
// return LetterTemplte.Service.Get();
//}
//public static List<LetterTemplte> GetWihoutFixed()
//{
// return LetterTemplte.Service.GetWihoutFixed();
//}
//public static List<LetterTemplte> GetWihoutFixed(EnumDocType ntype)
//{
// return LetterTemplte.Service.GetWihoutFixed(ntype);
//}
//#endregion
}
public interface ILetterTemplteService
{
LetterTemplte Get(int id);
List<LetterTemplte> Get();
List<LetterTemplte> Get(EnumDocType type);
int Save(LetterTemplte _document, FileStream stream);
void Delete(int id);
List<LetterTemplte> GetWihoutFixed(EnumDocType type);
List<LetterTemplte> GetWihoutFixed();
}
}