public DataSet GetEmployeeAttendanceRealTimeInsertAndDelete(HistoryAttendanceModel haModel, out string strErrMsg) { SqlParameter[] sqlpara = new SqlParameter[] { new SqlParameter("@BlockID",SqlDbType.Int,4), new SqlParameter("@EmployeeName",SqlDbType.VarChar,10), new SqlParameter("@DeptID",SqlDbType.Int,4), new SqlParameter("@ClassID",SqlDbType.Int,4), new SqlParameter("@ClassShortName",SqlDbType.VarChar,10), new SqlParameter("@BeginWorkTime",SqlDbType.VarChar,20), new SqlParameter("@EndWorkTime",SqlDbType.VarChar,20), new SqlParameter("@OperatorID",SqlDbType.Int,4), new SqlParameter("@Remark",SqlDbType.VarChar,200), new SqlParameter("@TimerIntervalID",SqlDbType.Int,4), new SqlParameter("@DataAttendance",SqlDbType.VarChar,20) }; sqlpara[0].Value = haModel.BlockID; sqlpara[1].Value = haModel.EmployeeName; sqlpara[2].Value = haModel.DeptID; sqlpara[3].Value = haModel.ClassID; sqlpara[4].Value = haModel.ClassShortName; sqlpara[5].Value = haModel.BeginWorkTime; sqlpara[6].Value = haModel.EndWorkTime; sqlpara[7].Value = haModel.OperatorID; sqlpara[8].Value = haModel.Remark; sqlpara[9].Value = haModel.TimerIntervalID; sqlpara[10].Value = haModel.DataAttendance; return DB.RunProcedureByDataSet("Shine_Shen_EmployeeAttendanceRealTimeDeleteAndInsert", "dst", sqlpara, out strErrMsg); }
/// <summary> /// 更新历史出勤数据 /// </summary> /// <param name="haModel">历史出勤对象</param> /// <param name="strErrMsg">带出的结果</param> /// <returns>返回的参数 -1为操作失败 1为操作成功</returns> public int UpdateEmployeeAttendanceHistory(HistoryAttendanceModel haModel, out string strErrMsg) { SqlParameter[] sqlpara = new SqlParameter[] { new SqlParameter("@ID",SqlDbType.BigInt), new SqlParameter("@BlockID",SqlDbType.Int,4), new SqlParameter("@EmployeeName",SqlDbType.VarChar,10), new SqlParameter("@DeptID",SqlDbType.Int,4), new SqlParameter("@ClassID",SqlDbType.Int,4), new SqlParameter("@ClassShortName",SqlDbType.VarChar,20), new SqlParameter("@BeginWorkTime",SqlDbType.VarChar,20), new SqlParameter("@EndWorkTime",SqlDbType.VarChar,20), new SqlParameter("@OperatorID",SqlDbType.Int,4), new SqlParameter("@Remark",SqlDbType.VarChar,200), new SqlParameter("@TimerIntervalID",SqlDbType.Int,4), new SqlParameter("@DataAttendance",SqlDbType.VarChar,20) }; sqlpara[0].Value = haModel.ID_HistoryAttendance; sqlpara[1].Value = haModel.BlockID; sqlpara[2].Value = haModel.EmployeeName; sqlpara[3].Value = haModel.DeptID; sqlpara[4].Value = haModel.ClassID; sqlpara[5].Value = haModel.ClassShortName; sqlpara[6].Value = haModel.BeginWorkTime; sqlpara[7].Value = haModel.EndWorkTime; sqlpara[8].Value = haModel.OperatorID; sqlpara[9].Value = haModel.Remark; sqlpara[10].Value = haModel.TimerIntervalID; sqlpara[11].Value = haModel.DataAttendance; return DB.RunProcedureByInt("Shine_Shen_HistoryAttendanceUpdate", sqlpara, out strErrMsg); }
/// <summary> /// 添加到历史考勤信息 /// </summary> /// <returns></returns> public int AddEmployeeAttendanceHistory(HistoryAttendanceModel haModel, string strTableName, out string strErrMsg) { SqlParameter[] sqlParmeters = { new SqlParameter("ID",SqlDbType.BigInt), new SqlParameter("BlockID",SqlDbType.Int), new SqlParameter("EmployeeID",SqlDbType.Int), new SqlParameter("EmployeeName",SqlDbType.VarChar,10), new SqlParameter("DeptID",SqlDbType.Int), new SqlParameter("ClassID",SqlDbType.VarChar,20), new SqlParameter("ClassShortName",SqlDbType.VarChar,10), new SqlParameter("BeginWorkTime",SqlDbType.VarChar,50), new SqlParameter("EndWorkTime",SqlDbType.VarChar,50), new SqlParameter("WorkTime",SqlDbType.Int), new SqlParameter("TimerIntervalID",SqlDbType.Int), new SqlParameter("DataAttendance",SqlDbType.VarChar,50), new SqlParameter("IsMend",SqlDbType.Bit), new SqlParameter("TableName",SqlDbType.VarChar,20) }; sqlParmeters[0].Value = Int64.Parse(DateTime.Now.ToString("yyyyMMddHHmmss") + haModel.BlockID.ToString("0000")); sqlParmeters[1].Value = haModel.BlockID; sqlParmeters[2].Value = haModel.EmployeeID; sqlParmeters[3].Value = haModel.EmployeeName; sqlParmeters[4].Value = haModel.DeptID; sqlParmeters[5].Value = haModel.ClassID; sqlParmeters[6].Value = haModel.ClassShortName; sqlParmeters[7].Value = haModel.BeginWorkTime; sqlParmeters[8].Value = haModel.EndWorkTime; sqlParmeters[9].Value = (int)(((TimeSpan)(DateTime.Parse(haModel.EndWorkTime) - DateTime.Parse(haModel.BeginWorkTime))).TotalSeconds); sqlParmeters[10].Value = haModel.TimerIntervalID; sqlParmeters[11].Value = haModel.DataAttendance; sqlParmeters[12].Value = true; sqlParmeters[13].Value = strTableName; return DB.RunProcedureByInt("proc_AddHisAttendance", sqlParmeters, out strErrMsg); }
/// <summary> /// 判断历史表中是不是有该员工补单日的班次信息 /// </summary> /// <param name="haModel"></param> /// <returns></returns> private bool IsExists(HistoryAttendanceModel haModel) { return hisWellBll.GetEmpClassInfo(DateTime.Parse(haModel.BeginWorkTime).ToString("yyyyM"), haModel.BlockID.ToString(), haModel.EmployeeID.ToString(), haModel.ClassID.ToString(), haModel.ClassShortName, haModel.DataAttendance); }
private void AddHisInOutStation(HistoryAttendanceModel haModel) { string strStatHead = hisWellBll.GetStationHeadInfo(); DataTable dtHisInOutMine = CreateHisInOutMine(); DataRow drHis = dtHisInOutMine.NewRow(); DataSet dsEmp = hisWellBll.GetEmpInfoBll(haModel.EmployeeID.ToString()); if (String.IsNullOrEmpty(strStatHead)) { strStatHead = "0,0,0"; } string[] strSta = strStatHead.Split(','); if (dsEmp != null && dsEmp.Tables.Count > 0) { drHis["HisInOutMineID"] = Int64.Parse(DateTime.Now.ToString("yyyyMMddHHmmss") + int.Parse(haModel.BlockID.ToString()).ToString("0000")); drHis["InStationAddress"] = Int32.Parse(strSta[0].ToString()); drHis["InStationHeadAddress"] = Int32.Parse(strSta[1].ToString()); drHis["InWellPlace"] = strSta[2].ToString(); drHis["CodeSenderAddress"] = haModel.BlockID.ToString(); drHis["UserID"] = dsEmp.Tables[0].Rows[0]["EmpId"]; drHis["UserNo"] = dsEmp.Tables[0].Rows[0]["EmpNo"]; drHis["UserName"] = dsEmp.Tables[0].Rows[0]["EmpName"]; drHis["DeptID"] = dsEmp.Tables[0].Rows[0]["DeptID"]; drHis["DeptName"] = dsEmp.Tables[0].Rows[0]["DeptName"]; drHis["DutyID"] = dsEmp.Tables[0].Rows[0]["DutyID"]; drHis["DutyName"] = dsEmp.Tables[0].Rows[0]["DutyName"]; drHis["WorkTypeID"] = dsEmp.Tables[0].Rows[0]["workTypeID"]; drHis["WorkTypeName"] = dsEmp.Tables[0].Rows[0]["WorkTypeName"]; drHis["InTime"] = haModel.BeginWorkTime; drHis["OutStationAddress"] = Int32.Parse(strSta[0].ToString()); drHis["OutStationHeadAddress"] = Int32.Parse(strSta[1].ToString()); drHis["OutWellPlace"] = strSta[2].ToString(); drHis["OutTime"] = haModel.EndWorkTime; drHis["ContinueTime"] = (int)(((TimeSpan)(DateTime.Parse(haModel.EndWorkTime) - DateTime.Parse(haModel.BeginWorkTime))).TotalSeconds); drHis["IsMend"] = 1; hisWellBll.AddHisInOutMineBll(drHis, DateTime.Parse(haModel.BeginWorkTime).ToString("yyyyM")); } }
public DataSet GetEmployeeAttendanceRealTimeInsertAndDelete(HistoryAttendanceModel haModel, out string strErrMsg) { return dal.GetEmployeeAttendanceRealTimeInsertAndDelete(haModel, out strErrMsg); }
public int AddEmployeeAttendanceHistory(HistoryAttendanceModel haModel,string strTableName, out string strErrMsg) { return dal.AddEmployeeAttendanceHistory(haModel,strTableName, out strErrMsg); }
/// <summary> /// 更新历史出勤数据 /// </summary> /// <param name="haModel">历史出勤对象</param> /// <param name="strErrMsg">带出的结果</param> /// <returns>返回的参数 -1为操作失败 1为操作成功</returns> public int UpdateEmployeeAttendanceHistory(HistoryAttendanceModel haModel, out string strErrMsg) { return dal.UpdateEmployeeAttendanceHistory(haModel, out strErrMsg); }