public string DeleteEmployeeAttendance(EmployeeAttendanceMaster argEmployeeAttendanceMaster, DataAccess da, List <ErrorHandlerClass> lstErr) { da.Open_Connection(); SqlParameter[] param = new SqlParameter[6]; param[0] = new SqlParameter("@AttendanceId", argEmployeeAttendanceMaster.AttendanceId); param[1] = new SqlParameter("@ModifiedBy", argEmployeeAttendanceMaster.ModifiedBy); param[2] = new SqlParameter("@Type", SqlDbType.Char); param[2].Size = 1; param[2].Direction = ParameterDirection.Output; param[3] = new SqlParameter("@Message", SqlDbType.VarChar); param[3].Size = 255; param[3].Direction = ParameterDirection.Output; param[4] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[4].Size = 20; param[4].Direction = ParameterDirection.Output; param[5] = new SqlParameter("@IsDeleted", argEmployeeAttendanceMaster.IsDeleted); int i = da.NExecuteNonQuery("Proc_DeleteEmployeeAttendance", param); string strMessage = Convert.ToString(param[3].Value); string strType = Convert.ToString(param[2].Value); string strRetValue = Convert.ToString(param[4].Value); objErrorHandlerClass.Type = strType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = strMessage.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; objErrorHandlerClass.ReturnValue = strRetValue; lstErr.Add(objErrorHandlerClass); return(strRetValue); }
public ICollection <ErrorHandlerClass> SaveEmployeeAttendanceCollection(EmployeeAttendanceMaster objEmployeeAttendanceMaster, ICollection <EmployeeAttendanceMaster> colEmployeeAttendanceMaster) { List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>(); DataAccess da = new DataAccess(); try { da.Open_Connection(); da.BEGIN_TRANSACTION(); //string strTrainingId = InsertEmployeeAttendance(objEmployeeAttendanceMaster, da, lstErr); foreach (ErrorHandlerClass objerr in lstErr) { if (objerr.Type == "E") { da.ROLLBACK_TRANSACTION(); return(lstErr); } } //if (strTrainingId != "") //{ if (colEmployeeAttendanceMaster.Count > 0) { foreach (EmployeeAttendanceMaster argEmployeeAttendanceMaster in colEmployeeAttendanceMaster) { //argEmployeeAttendanceMaster.TrainingId = Convert.ToInt32(strTrainingId); SaveEmployeeAttendance(argEmployeeAttendanceMaster); } } // } da.COMMIT_TRANSACTION(); } catch (Exception ex) { if (da != null) { da.ROLLBACK_TRANSACTION(); } objErrorHandlerClass.Type = ErrorConstant.strAboartType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = ex.Message.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; lstErr.Add(objErrorHandlerClass); } finally { if (da != null) { da.Close_Connection(); da = null; } } return(lstErr); }
public void InsertEmployeeAttendance(EmployeeAttendanceMaster argEmployeeAttendanceMaster, DataAccess da, List <ErrorHandlerClass> lstErr) { da.Open_Connection(); SqlParameter[] param = new SqlParameter[23]; param[0] = new SqlParameter("@AttendanceId", argEmployeeAttendanceMaster.AttendanceId); param[1] = new SqlParameter("@EmployeeId", argEmployeeAttendanceMaster.EmployeeId); param[2] = new SqlParameter("@MarkInRemark", argEmployeeAttendanceMaster.MarkInRemark); param[3] = new SqlParameter("@MarkInDate", clsConvert.ToDateTime1(argEmployeeAttendanceMaster.MarkInDate)); param[4] = new SqlParameter("@MarkInTime", argEmployeeAttendanceMaster.MarkIntime); param[5] = new SqlParameter("@CreatedBy", argEmployeeAttendanceMaster.CreatedBy); param[6] = new SqlParameter("@MarkInIPAddress", argEmployeeAttendanceMaster.MarkInIPAddress); param[7] = new SqlParameter("@Type", SqlDbType.Char); param[7].Size = 1; param[7].Direction = ParameterDirection.Output; param[8] = new SqlParameter("@Message", SqlDbType.VarChar); param[8].Size = 255; param[8].Direction = ParameterDirection.Output; param[9] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[9].Size = 20; param[9].Direction = ParameterDirection.Output; param[10] = new SqlParameter("@AlertMessasg", argEmployeeAttendanceMaster.AlertMessasg); param[11] = new SqlParameter("@MarkOutDate", clsConvert.ToDateTime1(argEmployeeAttendanceMaster.MarkOutDate)); param[12] = new SqlParameter("@MarkOutTime", argEmployeeAttendanceMaster.MarkOutTime); param[13] = new SqlParameter("@IsSubmitted", argEmployeeAttendanceMaster.IsSubmitted); param[14] = new SqlParameter("@SubmittedBy", argEmployeeAttendanceMaster.SubmittedBy); param[15] = new SqlParameter("@SubmittedDate", argEmployeeAttendanceMaster.SubmittedDate); param[16] = new SqlParameter("@IsApprived", argEmployeeAttendanceMaster.IsApprived); param[17] = new SqlParameter("@ApprovedDate", argEmployeeAttendanceMaster.ApprovedDate); param[18] = new SqlParameter("@ApprovedBy", argEmployeeAttendanceMaster.ApprovedBy); param[19] = new SqlParameter("@ApprovalRemark", argEmployeeAttendanceMaster.ApprovalRemark); param[20] = new SqlParameter("@UpdatedMarkInTime", argEmployeeAttendanceMaster.UpdatedMarkInTime); param[21] = new SqlParameter("@UpdatedMarkOutTime", argEmployeeAttendanceMaster.UpdatedMarkOutTime); param[22] = new SqlParameter("@MarkOutAlertMessasg", argEmployeeAttendanceMaster.MarkOutAlertMessasg); int i = da.NExecuteNonQuery("Proc_InsertEmployeeAttendance", param); string strMessage = Convert.ToString(param[8].Value); string strType = Convert.ToString(param[7].Value); string strRetValue = Convert.ToString(param[9].Value); objErrorHandlerClass.Type = strType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = strMessage.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; objErrorHandlerClass.ReturnValue = strRetValue; lstErr.Add(objErrorHandlerClass); //return i; }
public ICollection <ErrorHandlerClass> DeleteEmployeeAttendance(EmployeeAttendanceMaster objEmployeeAttendanceMaster) { List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>(); DataAccess da = new DataAccess(); try { da.Open_Connection(); da.BEGIN_TRANSACTION(); DeleteEmployeeAttendance(objEmployeeAttendanceMaster, da, lstErr); foreach (ErrorHandlerClass objerr in lstErr) { if (objerr.Type == "E") { da.ROLLBACK_TRANSACTION(); return(lstErr); } } da.COMMIT_TRANSACTION(); } catch (Exception ex) { if (da != null) { da.ROLLBACK_TRANSACTION(); } objErrorHandlerClass.Type = ErrorConstant.strAboartType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = ex.Message.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; lstErr.Add(objErrorHandlerClass); } finally { if (da != null) { da.Close_Connection(); da = null; } } return(lstErr); }
public string UpdateEmployeeAttendance(EmployeeAttendanceMaster argEmployeeAttendanceMaster, DataAccess da, List <ErrorHandlerClass> lstErr) { da.Open_Connection(); SqlParameter[] param = new SqlParameter[11]; param[0] = new SqlParameter("@AttendanceId", argEmployeeAttendanceMaster.AttendanceId); param[1] = new SqlParameter("@EmployeeId", argEmployeeAttendanceMaster.EmployeeId); param[2] = new SqlParameter("@MarkoutRemark", argEmployeeAttendanceMaster.MarkoutRemark); param[3] = new SqlParameter("@MarkoutDate", clsConvert.ToDateTime1(argEmployeeAttendanceMaster.MarkOutDate)); param[4] = new SqlParameter("@MarkoutTime", argEmployeeAttendanceMaster.MarkOutTime); param[5] = new SqlParameter("@ModifiedBy", argEmployeeAttendanceMaster.ModifiedBy); param[6] = new SqlParameter("@MarkOutIPAddress", argEmployeeAttendanceMaster.MarkOutIPAddress); param[7] = new SqlParameter("@Type", SqlDbType.Char); param[7].Size = 1; param[7].Direction = ParameterDirection.Output; param[8] = new SqlParameter("@Message", SqlDbType.VarChar); param[8].Size = 255; param[8].Direction = ParameterDirection.Output; param[9] = new SqlParameter("@returnvalue", SqlDbType.VarChar); param[9].Size = 20; param[9].Direction = ParameterDirection.Output; param[10] = new SqlParameter("@MarkOutAlertMessasg", argEmployeeAttendanceMaster.MarkOutAlertMessasg); int i = da.NExecuteNonQuery("Proc_UpdateEmployeeAttendance", param); string strMessage = Convert.ToString(param[8].Value); string strType = Convert.ToString(param[7].Value); string strRetValue = Convert.ToString(param[9].Value); objErrorHandlerClass.Type = strType; objErrorHandlerClass.MsgId = 0; objErrorHandlerClass.Message = strMessage.ToString(); objErrorHandlerClass.RowNo = 0; objErrorHandlerClass.FieldName = ""; objErrorHandlerClass.LogCode = ""; objErrorHandlerClass.ReturnValue = strRetValue; lstErr.Add(objErrorHandlerClass); return(strRetValue); }