using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
///
/// 职员
///
public class ClsGy_Employee_View:DBUtility.ClsGy_Base_View
{
//
public Model.ClsGy_Employee_Model omodel = new Model.ClsGy_Employee_Model();
public List oEmpList;
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
public ClsGy_Employee_View()
{
base.ViewNameForWeb = "h_v_Gy_Employee_ForWeb";
base.MvarReportTitle = "职员设置";
base.MvarItemKey = "Gy_Employee";
base.SQLName = "Select HItemID,HNumber 职员代码,HName 职员 from Gy_Employee where HStopflag=0 ";
base.SQLList = "";
base.SQLOrder = " Order by HItemID ";
//下拉SQL
base.SQLNameForDown = " Select top 30 HItemID,HNumber 职员代码,HName 职员 from Gy_Employee ";
base.SQLOrderForDown = " Order by HNumber ";
base.SQLWhereForDown = " where HStopflag=0 ";
}
//
public void Dispose()
{
GC.SuppressFinalize(this);
}
//
//返回项目信息
public override bool GetInfoByID(Int64 sItemID)
{
DataSet DS ;
try
{
DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HItemID='" + sItemID + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
if (DS.Tables[0].Rows.Count == 0)
return false;
else
{
return GetInfo(DS);
}
}
catch (Exception e)
{
throw (e);
}
}
//根据代码返回项目信息
public override bool GetInfoByNumber(string sNumber)
{
DataSet DS;
try
{
DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HNumber='" + sNumber + "'", MvarItemKey, ref DBUtility.ClsPub.sExeReturnInfo);
if (DS.Tables[0].Rows.Count == 0)
return false;
else
{
return GetInfo(DS);
}
}
catch (Exception e)
{
throw (e);
}
}
//返回职员根据班组oEmpList
public bool GetInfoByGroup(long sGroupID)
{
oEmpList = new List();
oEmpList.Clear();
try
{
DataSet DS;
DS = oCn.RunProcReturn("Select * from Gy_Employee Where HStopFlag=0 and HGroupID='" + sGroupID + "' order by HNumber", "Gy_Employee");
if (DS.Tables[0].Rows.Count == 0)
return false;
else
{
for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
{
omodel = new Model.ClsGy_Employee_Model();
omodel.HItemID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[i]["HItemID"]);
omodel.HNumber = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[i]["HNumber"]);
omodel.HName = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[i]["HName"]);
omodel.HEmpRate = DBUtility.ClsPub.isDoule(DS.Tables[0].Rows[i]["HEmpRate"]); //职员系数
omodel.HCTPrjID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[i]["HCTPrjID"]); //核算方案
omodel.HWorkTypeID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[i]["HWorkTypeID"]); //工种
omodel.HEmpType = DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[i]["HEmpType"]); //工资类型
omodel.HPostID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[i]["HPostID"]); //岗位
//
oEmpList.Add(omodel);
}
DS.Dispose();
DS = null;
return true;
}
}
catch (Exception e)
{
return false;
}
}
//返回项目信息
public override bool GetInfo(DataSet DS)
{
try
{
omodel = new Model.ClsGy_Employee_Model();
omodel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
omodel.HNumber = DS.Tables[0].Rows[0]["HNumber"].ToString().Trim();
omodel.HName = DS.Tables[0].Rows[0]["HName"].ToString().Trim();
omodel.HShortNumber = DS.Tables[0].Rows[0]["HShortNumber"].ToString().Trim();
omodel.HLevel = (int)DS.Tables[0].Rows[0]["HLevel"];
omodel.HEmpRate = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HEmpRate"]);
omodel.HBasePay = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HBasePay"]);
omodel.HExamRate = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HExamRate"]);
omodel.HInsurance = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HInsurance"]);
omodel.HMedicare = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HMedicare"]);
omodel.HOtherDeduct3 = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HOtherDeduct3"]);
omodel.HDrydock = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HDrydock"]);
omodel.HParentID = Convert.ToInt64(DS.Tables[0].Rows[0]["HParentID"]);
omodel.HEndflag = (bool)DS.Tables[0].Rows[0]["HEndflag"];
omodel.HNoBrushFlag = (bool)DS.Tables[0].Rows[0]["HNoBrushFlag"];
omodel.HStopflag = (bool)DS.Tables[0].Rows[0]["HStopflag"];
omodel.HShiftFlag = (bool)DS.Tables[0].Rows[0]["HShiftFlag"];
omodel.HRemark = DS.Tables[0].Rows[0]["HRemark"].ToString().Trim();
omodel.HHelpCode = DS.Tables[0].Rows[0]["HHelpCode"].ToString().Trim();
omodel.HOverType = (bool)DS.Tables[0].Rows[0]["HOverType"];
omodel.HStopwagesFlag = (bool)DS.Tables[0].Rows[0]["HStopwagesFlag"];
omodel.HBirthDay = DS.Tables[0].Rows[0]["HBirthDay"].ToString().Trim();
omodel.HGradDate = DS.Tables[0].Rows[0]["HGradDate"].ToString().Trim();
omodel.HInsuranceDate = DS.Tables[0].Rows[0]["HInsuranceDate"].ToString().Trim();
omodel.HContractBDate = DS.Tables[0].Rows[0]["HContractBDate"].ToString().Trim();
omodel.HContractEDate = DS.Tables[0].Rows[0]["HContractEDate"].ToString().Trim();
omodel.HJobCardEDate = DS.Tables[0].Rows[0]["HJobCardEDate"].ToString().Trim();
omodel.HCheckCardEDate = DS.Tables[0].Rows[0]["HCheckCardEDate"].ToString().Trim();
omodel.HStayCardEDate = DS.Tables[0].Rows[0]["HStayCardEDate"].ToString().Trim();
omodel.HHealthCardEDate = DS.Tables[0].Rows[0]["HHealthCardEDate"].ToString().Trim();
//
omodel.HDutyID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HDutyID"].ToString());
omodel.HDormID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HDormID"].ToString());
omodel.HAge = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HAge"].ToString());
omodel.HContractYear = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HContractYear"].ToString());
omodel.HInsuranceStatus = DBUtility.ClsPub.isBool(DS.Tables[0].Rows[0]["HInsuranceStatus"].ToString());
omodel.HSignStatus = DBUtility.ClsPub.isBool(DS.Tables[0].Rows[0]["HSignStatus"].ToString());
//
omodel.HEmpType = DS.Tables[0].Rows[0]["HEmpType"].ToString().Trim();
omodel.HPayType = DS.Tables[0].Rows[0]["HPayType"].ToString().Trim();
omodel.HWorkType = DS.Tables[0].Rows[0]["HWorkType"].ToString().Trim();
omodel.HDimissionReason = DS.Tables[0].Rows[0]["HDimissionReason"].ToString().Trim();
omodel.HSalaryLev = DS.Tables[0].Rows[0]["HSalaryLev"].ToString().Trim();
omodel.HMarr = DS.Tables[0].Rows[0]["HMarr"].ToString().Trim();
omodel.HBlighty = DS.Tables[0].Rows[0]["HBlighty"].ToString().Trim();
omodel.HNation = DS.Tables[0].Rows[0]["HNation"].ToString().Trim();
omodel.HBlightyType = DS.Tables[0].Rows[0]["HBlightyType"].ToString().Trim();
omodel.HGovStatus = DS.Tables[0].Rows[0]["HGovStatus"].ToString().Trim();
omodel.HBloodType = DS.Tables[0].Rows[0]["HBloodType"].ToString().Trim();
omodel.HStature = DS.Tables[0].Rows[0]["HStature"].ToString().Trim();
omodel.HAvoird = DS.Tables[0].Rows[0]["HAvoird"].ToString().Trim();
omodel.HKnowLev = DS.Tables[0].Rows[0]["HKnowLev"].ToString().Trim();
omodel.HProTitleID = DS.Tables[0].Rows[0]["HProTitleID"].ToString().Trim();
omodel.HGradSchool = DS.Tables[0].Rows[0]["HGraDSchool"].ToString().Trim();
omodel.HEngLev = DS.Tables[0].Rows[0]["HEngLev"].ToString().Trim();
omodel.HCompLev = DS.Tables[0].Rows[0]["HCompLev"].ToString().Trim();
omodel.HSpec = DS.Tables[0].Rows[0]["HSpec"].ToString().Trim();
omodel.HNowAdd = DS.Tables[0].Rows[0]["HNowAdd"].ToString().Trim();
omodel.HHomeAdd = DS.Tables[0].Rows[0]["HHomeAdd"].ToString().Trim();
omodel.HOldCompany = DS.Tables[0].Rows[0]["HOldCompany"].ToString().Trim();
omodel.HInsuranceNo = DS.Tables[0].Rows[0]["HInsuranceNo"].ToString().Trim();
omodel.HJobCardNo = DS.Tables[0].Rows[0]["HJobCardNo"].ToString().Trim();
omodel.HArchivesNo = DS.Tables[0].Rows[0]["HArchivesNo"].ToString().Trim();
omodel.HInComDate = DS.Tables[0].Rows[0]["HInComDate"].ToString().Trim();
omodel.HRelDate = DS.Tables[0].Rows[0]["HRelDate"].ToString().Trim();
omodel.HDimissionDate = DS.Tables[0].Rows[0]["HDimissionDate"].ToString().Trim();
omodel.HLinkPhone = DS.Tables[0].Rows[0]["HLinkPhone"].ToString().Trim();
omodel.HSex = DS.Tables[0].Rows[0]["HSex"].ToString().Trim();
omodel.HIDCard = DS.Tables[0].Rows[0]["HIDCard"].ToString().Trim();
omodel.HBirthDay = DS.Tables[0].Rows[0]["HBirthDay"].ToString().Trim();
omodel.HPostID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HPostID"].ToString());
omodel.HMobilePhone = DS.Tables[0].Rows[0]["HMobilePhone"].ToString().Trim();
omodel.HFax = DS.Tables[0].Rows[0]["HFax"].ToString().Trim();
omodel.HPostalCode = DS.Tables[0].Rows[0]["HPostalCode"].ToString().Trim();
omodel.HEmail = DS.Tables[0].Rows[0]["HEmail"].ToString().Trim();
omodel.HBank = DS.Tables[0].Rows[0]["HBank"].ToString().Trim();
omodel.HBankAccount = DS.Tables[0].Rows[0]["HBankAccount"].ToString().Trim();
omodel.HGroupID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HGroupID"].ToString());
omodel.HDeptID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HDeptID"].ToString());
omodel.HCTPrjID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HCTPrjID"].ToString());
omodel.HWorkTypeID = DBUtility.ClsPub.isLong(DS.Tables[0].Rows[0]["HWorkTypeID"].ToString());
omodel.HHighestPay = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HHighestPay"]);
omodel.HOverPayRate = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HOverPayRate"]);
omodel.HLeftMoneyRate = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HLeftMoneyRate"]);
omodel.HInsuranceSubsidy = DBUtility.ClsPub.isSingle(DS.Tables[0].Rows[0]["HInsuranceSubsidy"]);
omodel.HExamLevPostMoney = DBUtility.ClsPub.isDoule(DS.Tables[0].Rows[0]["HExamLevPostMoney"].ToString());
omodel.HAddress = DS.Tables[0].Rows[0]["HAddress"].ToString().Trim();
DS.Dispose();
DS = null;
return true;
}
catch (Exception e)
{
throw (e);
}
}
}
}