// after the above 3 functions(conditions) are satisfied(return false) the employee is allowed to sign-in. public void SignIn(SignInSignOutModel objSignInSignOutModel) { try { SqlDataReader sdrSignIn = objSignInSignOutBOL.SignIn(objSignInSignOutModel); Guid gSignInSignOutWFID = new Guid("00000000-0000-0000-0000-000000000000"); int SignInSignOutID = 0; while (sdrSignIn.Read()) { if (sdrSignIn[1].ToString() != "") { SignInSignOutID = Convert.ToInt32(sdrSignIn[0].ToString()); gSignInSignOutWFID = new Guid(sdrSignIn[1].ToString()); System.Workflow.Runtime.WorkflowRuntime wr = (System.Workflow.Runtime.WorkflowRuntime)Application["WokflowRuntime"]; Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("SignInSignOutID", SignInSignOutID); WorkflowInstance wi = wr.CreateWorkflow(typeof(SignInSignOutWF.SignInSignOutWF), parameters, gSignInSignOutWFID); wi.Start(); } } } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOut.cs", "SignIn", ex.StackTrace); throw new V2Exceptions(); } }
public DataSet CheckAndGetDateData(SignInSignOutModel objSignInSignOutModel) { SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@SignInTime", SqlDbType.DateTime); param[0].Value = objSignInSignOutModel.SignInTime; //@UserID param[1] = new SqlParameter("@UserID", SqlDbType.BigInt); param[1].Value = objSignInSignOutModel.EmployeeID; //@UserID dsManualSignInSignOutDAL = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "GetSignInSignOutData", param); for (int i = 0; i < dsManualSignInSignOutDAL.Tables[0].Rows.Count; i++) { if (dsManualSignInSignOutDAL.Tables[0].Rows[i]["SignInComment"].ToString() != "") { string str = dsManualSignInSignOutDAL.Tables[0].Rows[i]["SignInComment"].ToString(); char[] chrSplit = { ':' }; string[] strArray = new string[2]; strArray = str.Split(chrSplit); if (strArray[0] == "##Leave") { str = str.Replace(strArray[0], ""); str = str.Replace(":", ""); dsManualSignInSignOutDAL.Tables[0].Rows[i]["SignInComment"] = str; } } } return(dsManualSignInSignOutDAL); }
// Check if the Employee has already Signed_in for the day public DataSet CheckForMultipleSignIn(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); param[0].Value = objSignInSignOutModel.EmployeeID; param[1] = new SqlParameter("@Signin", SqlDbType.DateTime); param[1].Value = objSignInSignOutModel.SignInTime; dsSignInSignOutDAL = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "CheckForMultipleSignIns", param); return(dsSignInSignOutDAL); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutDAL", "CheckForMultipleSignIn", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
// after the above 3 functions(conditions) are satisfied(return false) the employee is allowed to sign-in. public SqlDataReader SignIn(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); param[0].Value = objSignInSignOutModel.EmployeeID; param[1] = new SqlParameter("@IsSignInManual", SqlDbType.Bit); param[1].Value = objSignInSignOutModel.IsSignInManual; param[2] = new SqlParameter("@IsSignOutManual", SqlDbType.Bit); param[2].Value = objSignInSignOutModel.IsSignOutManual; param[3] = new SqlParameter("@signin", SqlDbType.DateTime); param[3].Value = objSignInSignOutModel.SignInTime; SqlDataReader sdrSignIn = SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "SignIn", param); return(sdrSignIn); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutDAL", "SignIn", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public SqlDataReader ModifyInTime(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] param = new SqlParameter[4]; param[0] = new SqlParameter("@SignInSignOutID", SqlDbType.Int); param[0].Value = objSignInSignOutModel.SignInSignOutID; param[1] = new SqlParameter("@SignInTime", objSignInSignOutModel.SignInTime); param[2] = new SqlParameter("@IsSignInManual", SqlDbType.Bit); param[2].Value = objSignInSignOutModel.IsSignInManual; param[3] = new SqlParameter("@SignInComment", SqlDbType.NVarChar); param[3].Value = objSignInSignOutModel.SignInComment; SqlDataReader sdrModifyInTime = SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "ModifyInTime", param); return(sdrModifyInTime); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ManualSignInSignOutDAL.cs", "ModifyInTime", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
//get the Sign In Sign Out Data public DataSet GetOldData(SignInSignOutModel objSignInSignOutModel) { /*dsManualSignInSignOutBOL = objManualSignInSignOutDAL.GetOldData(objSignInSignOutModel.SignInSignOutID); * return dsManualSignInSignOutBOL;*/ return(objManualSignInSignOutDAL.GetOldData(objSignInSignOutModel)); }
//Check if the Employee has already signed out for the day /*Commented by rahul : * Reason: This was working for the old SP.The SP has been changed.*/ public string MultipleSignOuts(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); param[0].Value = objSignInSignOutModel.EmployeeID; SqlDataReader sdrMultipleSignOuts = SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "MultipleSignOuts", param); string SignInSignOutID = ""; if (sdrMultipleSignOuts.Read()) { SignInSignOutID = sdrMultipleSignOuts["SignInSignOutID"].ToString(); } else { SignInSignOutID = ""; } return(SignInSignOutID); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutDAL", "MultipleSignOuts", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet SearchBulkDetails(SignInSignOutModel objSignInSignOutModel) { DataSet dsSearchBulkDetails; SqlParameter[] objSqlparam = new SqlParameter[3]; objSqlparam[0] = new SqlParameter("@UserID", SqlDbType.Int); objSqlparam[0].Value = objSignInSignOutModel.EmployeeID; objSqlparam[1] = new SqlParameter("@SignIn", SqlDbType.DateTime); objSqlparam[1].Value = objSignInSignOutModel.SignInTime; objSqlparam[2] = new SqlParameter("@SignOut", SqlDbType.DateTime); objSqlparam[2].Value = objSignInSignOutModel.SignOutTime; try { dsSearchBulkDetails = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "SearchBulkDetails", objSqlparam); return(dsSearchBulkDetails); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "LeaveDeatilsDAL.cs", "SearchTeamMembersLeaveDetails", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet GetWeeklyOff(SignInSignOutModel objWeeklyOffModel) { SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@EmployeeID", SqlDbType.Int); param[0].Value = objWeeklyOffModel.EmployeeID; DateTime nullDate = new DateTime(); if (objWeeklyOffModel.FromDate == nullDate) { param[1] = new SqlParameter("@StartDate", DBNull.Value); } else { param[1] = new SqlParameter("@StartDate", objWeeklyOffModel.FromDate); } if (objWeeklyOffModel.Todate == nullDate) { param[2] = new SqlParameter("@EndDate", DBNull.Value); } else { param[2] = new SqlParameter("@EndDate", objWeeklyOffModel.Todate); } dsWeeklyOffDAL = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "GetWeekOffDate", param); return(dsWeeklyOffDAL); }
//Auto Sign Out public void SignOut(SignInSignOutModel objSignInSignOutModel) { try { grdSignInSignOut.PageIndex = 0; //Checking if the user has already Signed-Out string SignInSignOutID = objSignInSignOutBOL.MultipleSignOuts(objSignInSignOutModel); if (SignInSignOutID == "") { lblErrorMess.Text = "You have already Signed out"; } else { objSignInSignOutModel.SignInSignOutID = Convert.ToInt32(SignInSignOutID); SqlDataReader sdrSignOut = objSignInSignOutBOL.SignOut(objSignInSignOutModel); //workflow Guid gMSignInSignOutWFID = new Guid("00000000-0000-0000-0000-000000000000"); int SignInSignOutID1 = 0; while (sdrSignOut.Read()) { if (sdrSignOut.FieldCount.ToString() == "2") { if (sdrSignOut[1].ToString() != "") { SignInSignOutID1 = Convert.ToInt32(sdrSignOut[0].ToString()); gMSignInSignOutWFID = new Guid(sdrSignOut[1].ToString()); WorkflowRuntime wr = (WorkflowRuntime)Application["WokflowRuntime"]; Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("SignInSignOutID", SignInSignOutID1); WorkflowInstance wi = wr.CreateWorkflow(typeof(SignInSignOutWF.SignInSignOutWF), parameters, gMSignInSignOutWFID); wi.Start(); } } } //workflow lblSuccess.Text = "You have successfully Signed Out for the day"; } ViewState["ColumnName"] = "date"; ViewState["Order"] = "DESC"; objSignInSignOutModel.ColumnName = ViewState["ColumnName"].ToString(); objSignInSignOutModel.SortOrder = ViewState["Order"].ToString(); BindSignInSignOut(objSignInSignOutModel); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOut.cs", "SignOut", ex.StackTrace); throw new V2Exceptions(); } }
public DataSet GetEmployeeJoiningData(SignInSignOutModel objSignInSignOutModel) { SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@UserID", SqlDbType.BigInt); param[0].Value = objSignInSignOutModel.EmployeeID; //@UserID dsManualSignInSignOutDAL = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "GetEmployeeJoiningData", param); return(dsManualSignInSignOutDAL); }
public DataSet GetBulkEntriesForEmployees(SignInSignOutModel objSignInSignOutModel) { try { return(objBulkDAL.GetBulkEntriesForEmployees(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "BulkEntriesBOL.cs", "GetBulkEntriesForEmployees", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public void UpdateStatus(SignInSignOutModel objSignInSignOutModel) { try { objSignInSignOutBOL.UpdateStatus(objSignInSignOutModel); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutApproval.cs", "UpdateStatus", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
// after the above 3 functions(conditions) are satisfied(return false) the employee is allowed to sign-in. public SqlDataReader SignIn(SignInSignOutModel objSignInSignOutModel) { try { return(objSignInSignOutDAL.SignIn(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL.cs", "SignIn", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public int UpdateEmployeeLeaveAndComp(SignInSignOutModel objSignInSignOutModel) { try { return(objSignInSignOutDAL.UpdateEmployeeLeaveAndComp(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutModelBOL.cs", "UpdateEmployeeLeaveAndComp", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public SqlDataReader ModifyAddRecordsInsignInSignOut(SignInSignOutModel objSignInSignOutModel) { try { return(objManualSignInSignOutBOL.ModifyAddRecordsInsignInSignOut(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "ManualSignInSignOut.cs", "ModifyAddRecordsInsignInSignOut", ex.StackTrace); throw new V2Exceptions(); } }
//display data in the grid public DataSet BindApprovalData(SignInSignOutModel objSignInSignOutModel) { try { return(objSignInSignOutDAL.BindApprovalData(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL", "BindApprovalData", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
// Check if the Employee has already Signed_in for the day public DataSet CheckForMultipleSignIn(SignInSignOutModel objSignInSignOutModel) { try { dsSignInSignOutBOL = objSignInSignOutDAL.CheckForMultipleSignIn(objSignInSignOutModel); return(dsSignInSignOutBOL); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL.cs", "CheckForMultipleSignIn", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
// Search Signin Signout Report #region SearchSigninSignOutRpt public DataSet SearchSigninSignOutRpt(SignInSignOutModel objSignInSignOutModel, bool IsAdmin, bool AllTeammembers) { try { return(objSignInSignOutDAL.SearchSigninSignOutRpt(objSignInSignOutModel, IsAdmin, AllTeammembers)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL", "SearchSigninSignOutRpt", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
// //Check if the Employee has already signed out for the day public string MultipleSignOuts(SignInSignOutModel objSignInSignOutModel) { try { string SignInSignOutID = objSignInSignOutDAL.MultipleSignOuts(objSignInSignOutModel); return(SignInSignOutID); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL.cs", "MultipleSignOuts", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public DataSet Search(SignInSignOutModel objSignInSignOutModel) { try { return(objSignInSignOutBOL.Search(objSignInSignOutModel)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOut.aspx.cs", "Search", ex.StackTrace); throw new V2Exceptions(); } }
public DataSet SearchApproval(SignInSignOutModel objSignInSignOutModel) { try { dsSignInSignOutBOL = objSignInSignOutDAL.SearchApproval(objSignInSignOutModel); return(dsSignInSignOutBOL); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutBOL", "SearchApproval", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
//check for the missing Sign out entries. Employee will not be allowed to sign in unless he has singed out for the corr sign-ins. public DataSet CheckMissingSignOut(SignInSignOutModel objSignInSignOutModel) { try { DataSet dsCheckMissingSignOut = new DataSet(); dsCheckMissingSignOut = objSignInSignOutBOL.CheckMissingSignOut(objSignInSignOutModel); return(dsCheckMissingSignOut); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOut.cs", "CheckMissingSignOut", ex.StackTrace); throw new V2Exceptions(); } }
public void BindSignInSignOut(SignInSignOutModel objSignInSignOutModel) { try { dsLoadSignInSigOutData = objSignInSignOutBOL.BindSignInSignOut(objSignInSignOutModel); grdSignInSignOut.DataSource = dsLoadSignInSigOutData.Tables[0]; grdSignInSignOut.DataBind(); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOut.aspx.cs", "BindSignInSignOut", ex.StackTrace); throw new V2Exceptions(); } }
public int UpdateEmployeeLeaveAndComp(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] objParam = new SqlParameter[1]; objParam[0] = new SqlParameter("@UserID", objSignInSignOutModel.EmployeeID); return(SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "UpdateLeaveCompBalance", objParam)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutDAL.cs", "UpdateEmployeeLeaveAndComp", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public int FetchID(SignInSignOutModel objSignInSignOutModel) { SqlParameter[] param = new SqlParameter[2]; DateTime NewDate = new DateTime(); if (objSignInSignOutModel.SignInTime.Date == NewDate) { param[0] = new SqlParameter("@SignInTime", objSignInSignOutModel.SignOutTime); } else { param[0] = new SqlParameter("@SignInTime", objSignInSignOutModel.SignInTime); } param[1] = new SqlParameter("@EmployeeID", SqlDbType.Int); param[1].Value = objSignInSignOutModel.EmployeeID; int intSignInSignOutID = Convert.ToInt32(SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "FindIdOfExistingRecord", param)); return(intSignInSignOutID); }
public DataSet GetBulkEntries(SignInSignOutModel objSignInSignOutModel) { DataSet GetBulkEntries; SqlParameter[] objParam = new SqlParameter[1]; objParam[0] = new SqlParameter("@EmployeeID", objSignInSignOutModel.EmployeeID); try { return(GetBulkEntries = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "GetBulkEntries", objParam)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "BulkEntriesDAL.cs", "GetBulkEntries", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
public int DeleteSignInSignOutDetails(SignInSignOutModel objSignInSignOutModel) { SqlParameter[] ParamDelete = new SqlParameter[1]; ParamDelete[0] = new SqlParameter("@SignInSignOutID", Convert.ToInt32(objSignInSignOutModel.SignInSignOutID.ToString())); try { return(SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "DeleteSignInSignOutDetails", ParamDelete)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "BulkEntriesDAL.cs", "DeleteSignInSignOutDetails", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }
//public SqlDataReader AddBulkEntriesDetails(SignInSignOutModel objSignInSignOutModel) //{ // SqlParameter[] objParam = new SqlParameter[11]; // objParam[0] = new SqlParameter("@UserID", objSignInSignOutModel.EmployeeID); // objParam[1] = new SqlParameter("@SignInTime", objSignInSignOutModel.SignInTime); // objParam[2] = new SqlParameter("@SignOutTime", objSignInSignOutModel.SignOutTime); // objParam[3] = new SqlParameter("@TotalWorkedHours", objSignInSignOutModel.TotalHoursWorked); // objParam[4] = new SqlParameter("@IsSignInManual", objSignInSignOutModel.IsSignInManual); // objParam[5] = new SqlParameter("@IsSignOutManual", objSignInSignOutModel.IsSignOutManual); // objParam[6] = new SqlParameter("@SignInComments", objSignInSignOutModel.SignInComment); // objParam[7] = new SqlParameter("@ApproverID", objSignInSignOutModel.ApproverID); // objParam[8] = new SqlParameter("@ApproverComments", objSignInSignOutModel.ApproverComments); // //objParam[9] = new SqlParameter("@ReportingTime", objSignInSignOutModel.ReportingTime); // objParam[9] = new SqlParameter("@StatusID", objSignInSignOutModel.StatusID); // objParam[10] = new SqlParameter("@IsBulk", objSignInSignOutModel.IsBulk); // try // { // return SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, "AddBulkEntriesDetails", objParam); // } // catch (V2Exceptions ex) // { // throw; // } // catch (System.Exception ex) // { // if (ex.Message.CompareTo("Already leave applied for this dates.") != 0) // { // FileLog objFileLog = FileLog.GetLogger(); // objFileLog.WriteLine(LogType.Error, ex.Message, "BulkEntriesDAL.cs", "AddBulkEntriesDetails", ex.StackTrace); // throw new V2Exceptions(ex.ToString(),ex); // } // else // { // throw ex; // } // } //} public int AddBulkEntriesDetails(SignInSignOutModel objSignInSignOutModel) { SqlParameter[] objParam = new SqlParameter[11]; objParam[0] = new SqlParameter("@UserID", objSignInSignOutModel.EmployeeID); objParam[1] = new SqlParameter("@SignInTime", objSignInSignOutModel.SignInTime); objParam[2] = new SqlParameter("@SignOutTime", objSignInSignOutModel.SignOutTime); objParam[3] = new SqlParameter("@TotalWorkedHours", objSignInSignOutModel.TotalHoursWorked); objParam[4] = new SqlParameter("@IsSignInManual", objSignInSignOutModel.IsSignInManual); objParam[5] = new SqlParameter("@IsSignOutManual", objSignInSignOutModel.IsSignOutManual); objParam[6] = new SqlParameter("@SignInComments", objSignInSignOutModel.SignInComment); objParam[7] = new SqlParameter("@ApproverID", objSignInSignOutModel.ApproverID); objParam[8] = new SqlParameter("@ApproverComments", objSignInSignOutModel.ApproverComments); //objParam[9] = new SqlParameter("@ReportingTime", objSignInSignOutModel.ReportingTime); objParam[9] = new SqlParameter("@StatusID", objSignInSignOutModel.StatusID); objParam[10] = new SqlParameter("@IsBulk", objSignInSignOutModel.IsBulk); try { return(SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, "AddBulkEntriesDetails", objParam)); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { if (ex.Message.CompareTo("Already leave applied for this dates.") != 0) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "BulkEntriesDAL.cs", "AddBulkEntriesDetails", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } else { throw ex; } } }
public void UpdateStatus(SignInSignOutModel objSignInSignOutModel) { try { SqlParameter[] param = new SqlParameter[5]; param[0] = new SqlParameter("@SignInSignOutID", SqlDbType.Int); param[0].Value = objSignInSignOutModel.SignInSignOutID; param[1] = new SqlParameter("@Status", SqlDbType.Int); param[1].Value = objSignInSignOutModel.StatusID; param[2] = new SqlParameter("@InTime", SqlDbType.DateTime); param[2].Value = objSignInSignOutModel.SignInTime; param[3] = new SqlParameter("@OutTime", SqlDbType.DateTime); if (objSignInSignOutModel.SignOutTime.ToString() == "1/1/0001 12:00:00 AM") { param[3].Value = null; } else { param[3].Value = objSignInSignOutModel.SignOutTime; } param[4] = new SqlParameter("@ApproversComments", SqlDbType.NVarChar); param[4].Value = objSignInSignOutModel.ApproverComments; SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, "SignInSignOutApprovalUpdate", param); } catch (V2Exceptions ex) { throw; } catch (System.Exception ex) { FileLog objFileLog = FileLog.GetLogger(); objFileLog.WriteLine(LogType.Error, ex.Message, "SignInSignOutDAL", "UpdateStatus", ex.StackTrace); throw new V2Exceptions(ex.ToString(), ex); } }