using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using HRHO_Entities;
using HRHO_Utilities;
namespace HRHO_DAL
{
public class SalaryDAL:DataProviderBase
{
public bool InsertSalary(SalaryEntities S_Ent)
{
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
//try
//{
dbManager.Open();
dbManager.CreateParameters(28);
dbManager.AddParameters(0, "@staffID", S_Ent.staffID);
dbManager.AddParameters(1, "@staffCode", S_Ent.staffCode);
dbManager.AddParameters(2,"@designation",S_Ent.designation);
dbManager.AddParameters(3, "@PF", S_Ent.PF);
dbManager.AddParameters(4, "@HRA",S_Ent.HRA);
dbManager.AddParameters(5, "@TA", S_Ent.TA);
dbManager.AddParameters(6, "@DA",S_Ent.DA);
dbManager.AddParameters(7, "@targetAmount",S_Ent.targetAmount);
dbManager.AddParameters(8, "@achievedAmount",S_Ent.achievedAmount);
dbManager.AddParameters(9, "@businessIncentive",S_Ent.businessIncentive);
dbManager.AddParameters(10, "@advance",S_Ent.advance);
dbManager.AddParameters(11, "@loanAdvance",S_Ent.loanAdvance);
dbManager.AddParameters(12, "@totalWorkingDays",S_Ent.totalWorkingDays);
dbManager.AddParameters(13, "@leaveTaken",S_Ent.leaveTaken);
dbManager.AddParameters(14, "@LOP",S_Ent.LOP);
dbManager.AddParameters(15, "@totalPaidDays",S_Ent.totalPaidDays);
dbManager.AddParameters(16, "@totalSalary",S_Ent.totalSalary);
dbManager.AddParameters(17, "@salaryAfterDeduction",S_Ent.salaryAfterDeduction);
dbManager.AddParameters(18, "@cautionDeposit",S_Ent.cautionDeposit);
dbManager.AddParameters(19, "@netSalary",S_Ent.netSalary);
dbManager.AddParameters(20, "@salaryMonth",S_Ent.salaryMonth);
dbManager.AddParameters(21, "@loginedUser",S_Ent.loginedUser);
dbManager.AddParameters(22, "@flag",1);
dbManager.AddParameters(23, "@salaryYear", S_Ent.salaryYear);
dbManager.AddParameters(24, "@branch", S_Ent.branch);
dbManager.AddParameters(25, "@basicSalary",S_Ent.basicSalary);
dbManager.AddParameters(26, "@groupedIncentive", S_Ent.groupedIncentive);
dbManager.AddParameters(27, "@groupedBusiness", S_Ent.groupedBusiness);
int a=dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "[sp_GENERATE_SALARY]");
//}
//catch (Exception ex)
//{
// ex.GetBaseException();
// return false;
//}
return true;
}
public bool ModifySalary(SalaryEntities S_Ent)
{
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
dbManager.Open();
dbManager.CreateParameters(28);
dbManager.AddParameters(0, "@staffID", S_Ent.staffID);
dbManager.AddParameters(1, "@staffCode", S_Ent.staffCode);
dbManager.AddParameters(2, "@designation", S_Ent.designation);
dbManager.AddParameters(3, "@PF", S_Ent.PF);
dbManager.AddParameters(4, "@HRA", S_Ent.HRA);
dbManager.AddParameters(5, "@TA", S_Ent.TA);
dbManager.AddParameters(6, "@DA", S_Ent.DA);
dbManager.AddParameters(7, "@targetAmount", S_Ent.targetAmount);
dbManager.AddParameters(8, "@achievedAmount", S_Ent.achievedAmount);
dbManager.AddParameters(9, "@businessIncentive", S_Ent.businessIncentive);
dbManager.AddParameters(10, "@advance", S_Ent.advance);
dbManager.AddParameters(11, "@loanAdvance", S_Ent.loanAdvance);
dbManager.AddParameters(12, "@totalWorkingDays", S_Ent.totalWorkingDays);
dbManager.AddParameters(13, "@leaveTaken", S_Ent.leaveTaken);
dbManager.AddParameters(14, "@LOP", S_Ent.LOP);
dbManager.AddParameters(15, "@totalPaidDays", S_Ent.totalPaidDays);
dbManager.AddParameters(16, "@totalSalary", S_Ent.totalSalary);
dbManager.AddParameters(17, "@salaryAfterDeduction", S_Ent.salaryAfterDeduction);
dbManager.AddParameters(18, "@cautionDeposit", S_Ent.cautionDeposit);
dbManager.AddParameters(19, "@netSalary", S_Ent.netSalary);
dbManager.AddParameters(20, "@salaryMonth", S_Ent.salaryMonth);
dbManager.AddParameters(21, "@loginedUser", S_Ent.loginedUser);
dbManager.AddParameters(22, "@flag",2);
dbManager.AddParameters(23, "@salaryYear", S_Ent.salaryYear);
dbManager.AddParameters(24, "@branch", S_Ent.branch);
dbManager.AddParameters(25, "@basicSalary",S_Ent.basicSalary);
dbManager.AddParameters(26, "@groupedIncentive", S_Ent.groupedIncentive);
dbManager.AddParameters(27, "@groupedBusiness", S_Ent.groupedBusiness);
int a = dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "[sp_GENERATE_SALARY]");
//ex.GetBaseException();
//return false;
return true;
}
public List<SalaryEntities> SelectStaffs(SalaryEntities S_Ent)
{
List<SalaryEntities> staffList = new List<SalaryEntities>();
/*
DataSet objDSet = new DataSet();
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
dbManager.Open();
dbManager.CreateParameters(2);
dbManager.AddParameters(0, "@branch", S_Ent.branch);
dbManager.AddParameters(1, "@flag", S_Ent.flag);
objDSet = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "[sp_SALARY_STAFF]");
if (objDSet.Tables.Count > 0)
{
foreach (DataRow drow in objDSet.Tables[0].Rows)
{
SalaryEntities enty = new SalaryEntities();
enty.staffID = Convert.ToInt32(drow["staffID"]);
enty.staffName = Convert.ToString(drow["staffName"]);
enty.staffCode = Convert.ToString(drow["staffCode"]);
enty.RegionalDesigID = Convert.ToInt32(drow["RegionalDesigID"]);
enty.designationID = Convert.ToInt32(drow["designationID"]);
enty.basic = Convert.ToInt64(drow["basic"]);
enty.target = Convert.ToInt64(drow["target"]);
enty.PF = Convert.ToInt64(drow["pf"]);
enty.HRA = Convert.ToInt64(drow["hra"]);
enty.DA = Convert.ToInt64(drow["da"]);
enty.TA = Convert.ToInt64(drow["ta"]);
enty.dailyAllowance = Convert.ToInt64(drow["dailyAllowance"]);
enty.medicalAllowance = Convert.ToInt64(drow["medicalAllowance"]);
enty.familyPlan = Convert.ToInt64(drow["familyPlan"]);
enty.storeCard = Convert.ToInt64(drow["storeCard"]);
enty.extraIncentive = Convert.ToInt64(drow["extraIncentive"]);
staffList.Add(enty);
}
}
*/
return staffList;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using HRHO_Entities;
using HRHO_Utilities;
namespace HRHO_DAL
{
public class SalaryDAL:DataProviderBase
{
public bool InsertSalary(SalaryEntities S_Ent)
{
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
//try
//{
dbManager.Open();
dbManager.CreateParameters(28);
dbManager.AddParameters(0, "@staffID", S_Ent.staffID);
dbManager.AddParameters(1, "@staffCode", S_Ent.staffCode);
dbManager.AddParameters(2,"@designation",S_Ent.designation);
dbManager.AddParameters(3, "@PF", S_Ent.PF);
dbManager.AddParameters(4, "@HRA",S_Ent.HRA);
dbManager.AddParameters(5, "@TA", S_Ent.TA);
dbManager.AddParameters(6, "@DA",S_Ent.DA);
dbManager.AddParameters(7, "@targetAmount",S_Ent.targetAmount);
dbManager.AddParameters(8, "@achievedAmount",S_Ent.achievedAmount);
dbManager.AddParameters(9, "@businessIncentive",S_Ent.businessIncentive);
dbManager.AddParameters(10, "@advance",S_Ent.advance);
dbManager.AddParameters(11, "@loanAdvance",S_Ent.loanAdvance);
dbManager.AddParameters(12, "@totalWorkingDays",S_Ent.totalWorkingDays);
dbManager.AddParameters(13, "@leaveTaken",S_Ent.leaveTaken);
dbManager.AddParameters(14, "@LOP",S_Ent.LOP);
dbManager.AddParameters(15, "@totalPaidDays",S_Ent.totalPaidDays);
dbManager.AddParameters(16, "@totalSalary",S_Ent.totalSalary);
dbManager.AddParameters(17, "@salaryAfterDeduction",S_Ent.salaryAfterDeduction);
dbManager.AddParameters(18, "@cautionDeposit",S_Ent.cautionDeposit);
dbManager.AddParameters(19, "@netSalary",S_Ent.netSalary);
dbManager.AddParameters(20, "@salaryMonth",S_Ent.salaryMonth);
dbManager.AddParameters(21, "@loginedUser",S_Ent.loginedUser);
dbManager.AddParameters(22, "@flag",1);
dbManager.AddParameters(23, "@salaryYear", S_Ent.salaryYear);
dbManager.AddParameters(24, "@branch", S_Ent.branch);
dbManager.AddParameters(25, "@basicSalary",S_Ent.basicSalary);
dbManager.AddParameters(26, "@groupedIncentive", S_Ent.groupedIncentive);
dbManager.AddParameters(27, "@groupedBusiness", S_Ent.groupedBusiness);
int a=dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "[sp_GENERATE_SALARY]");
//}
//catch (Exception ex)
//{
// ex.GetBaseException();
// return false;
//}
return true;
}
public bool ModifySalary(SalaryEntities S_Ent)
{
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
dbManager.Open();
dbManager.CreateParameters(28);
dbManager.AddParameters(0, "@staffID", S_Ent.staffID);
dbManager.AddParameters(1, "@staffCode", S_Ent.staffCode);
dbManager.AddParameters(2, "@designation", S_Ent.designation);
dbManager.AddParameters(3, "@PF", S_Ent.PF);
dbManager.AddParameters(4, "@HRA", S_Ent.HRA);
dbManager.AddParameters(5, "@TA", S_Ent.TA);
dbManager.AddParameters(6, "@DA", S_Ent.DA);
dbManager.AddParameters(7, "@targetAmount", S_Ent.targetAmount);
dbManager.AddParameters(8, "@achievedAmount", S_Ent.achievedAmount);
dbManager.AddParameters(9, "@businessIncentive", S_Ent.businessIncentive);
dbManager.AddParameters(10, "@advance", S_Ent.advance);
dbManager.AddParameters(11, "@loanAdvance", S_Ent.loanAdvance);
dbManager.AddParameters(12, "@totalWorkingDays", S_Ent.totalWorkingDays);
dbManager.AddParameters(13, "@leaveTaken", S_Ent.leaveTaken);
dbManager.AddParameters(14, "@LOP", S_Ent.LOP);
dbManager.AddParameters(15, "@totalPaidDays", S_Ent.totalPaidDays);
dbManager.AddParameters(16, "@totalSalary", S_Ent.totalSalary);
dbManager.AddParameters(17, "@salaryAfterDeduction", S_Ent.salaryAfterDeduction);
dbManager.AddParameters(18, "@cautionDeposit", S_Ent.cautionDeposit);
dbManager.AddParameters(19, "@netSalary", S_Ent.netSalary);
dbManager.AddParameters(20, "@salaryMonth", S_Ent.salaryMonth);
dbManager.AddParameters(21, "@loginedUser", S_Ent.loginedUser);
dbManager.AddParameters(22, "@flag",2);
dbManager.AddParameters(23, "@salaryYear", S_Ent.salaryYear);
dbManager.AddParameters(24, "@branch", S_Ent.branch);
dbManager.AddParameters(25, "@basicSalary",S_Ent.basicSalary);
dbManager.AddParameters(26, "@groupedIncentive", S_Ent.groupedIncentive);
dbManager.AddParameters(27, "@groupedBusiness", S_Ent.groupedBusiness);
int a = dbManager.ExecuteNonQuery(CommandType.StoredProcedure, "[sp_GENERATE_SALARY]");
//ex.GetBaseException();
//return false;
return true;
}
public List<SalaryEntities> SelectStaffs(SalaryEntities S_Ent)
{
List<SalaryEntities> staffList = new List<SalaryEntities>();
/*
DataSet objDSet = new DataSet();
IDBManager dbManager = new DBManager(base.GetProvider(), ConfigurationManager.AppSettings["connection"].ToString());
dbManager.Open();
dbManager.CreateParameters(2);
dbManager.AddParameters(0, "@branch", S_Ent.branch);
dbManager.AddParameters(1, "@flag", S_Ent.flag);
objDSet = dbManager.ExecuteDataSet(CommandType.StoredProcedure, "[sp_SALARY_STAFF]");
if (objDSet.Tables.Count > 0)
{
foreach (DataRow drow in objDSet.Tables[0].Rows)
{
SalaryEntities enty = new SalaryEntities();
enty.staffID = Convert.ToInt32(drow["staffID"]);
enty.staffName = Convert.ToString(drow["staffName"]);
enty.staffCode = Convert.ToString(drow["staffCode"]);
enty.RegionalDesigID = Convert.ToInt32(drow["RegionalDesigID"]);
enty.designationID = Convert.ToInt32(drow["designationID"]);
enty.basic = Convert.ToInt64(drow["basic"]);
enty.target = Convert.ToInt64(drow["target"]);
enty.PF = Convert.ToInt64(drow["pf"]);
enty.HRA = Convert.ToInt64(drow["hra"]);
enty.DA = Convert.ToInt64(drow["da"]);
enty.TA = Convert.ToInt64(drow["ta"]);
enty.dailyAllowance = Convert.ToInt64(drow["dailyAllowance"]);
enty.medicalAllowance = Convert.ToInt64(drow["medicalAllowance"]);
enty.familyPlan = Convert.ToInt64(drow["familyPlan"]);
enty.storeCard = Convert.ToInt64(drow["storeCard"]);
enty.extraIncentive = Convert.ToInt64(drow["extraIncentive"]);
staffList.Add(enty);
}
}
*/
return staffList;
}
}
}
No comments:
Post a Comment