Пример #1
0
        public DataSet AuthinticateManager(Attendance.Entities.Entities entities)
        {
            DataSet dsManagerLogin = new DataSet();

            try
            {
                SqlDataAdapter daManager = new SqlDataAdapter("[USP_Manager]", connectionString);
                daManager.SelectCommand.Parameters.Add(new SqlParameter("@EMPID", entities.EMPID));
                daManager.SelectCommand.Parameters.Add(new SqlParameter("@LocationName", entities.LocationName));
                daManager.SelectCommand.Parameters.Add(new SqlParameter("@PassCode", entities.passcode));
                daManager.SelectCommand.Parameters.Add(new SqlParameter("@UserID", entities.UserID));
                daManager.SelectCommand.CommandType = CommandType.StoredProcedure;
                daManager.Fill(dsManagerLogin);
                return(dsManagerLogin);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public DataSet SaveLogoutDetails(Attendance.Entities.Entities objEntity, int UserLogID)
        {
            DataSet dsLogoutDet = new DataSet();

            try
            {
                SqlDataAdapter daLogout = new SqlDataAdapter("[USP_AddLogout]", connectionString);
                daLogout.SelectCommand.Parameters.Add(new SqlParameter("@UserID", objEntity.UserID));
                daLogout.SelectCommand.Parameters.Add(new SqlParameter("@loguserID", UserLogID));
                daLogout.SelectCommand.Parameters.Add(new SqlParameter("@LogOutDate", objEntity.LogOutDate));
                daLogout.SelectCommand.Parameters.Add(new SqlParameter("@LogOutNotes", objEntity.LogOutNotes));
                daLogout.SelectCommand.CommandType = CommandType.StoredProcedure;
                daLogout.Fill(dsLogoutDet);
                return(dsLogoutDet);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #3
0
        public DataSet SaveLogDetails(Attendance.Entities.Entities entities)
        {
            DataSet dsLoginDet = new DataSet();

            try
            {
                SqlDataAdapter daLogin = new SqlDataAdapter("[USP_AddLogin1]", connectionString);
                daLogin.SelectCommand.Parameters.Add(new SqlParameter("@UserID", entities.UserID));
                daLogin.SelectCommand.Parameters.Add(new SqlParameter("@passcode", entities.passcode));
                daLogin.SelectCommand.Parameters.Add(new SqlParameter("@LoginDate", Convert.ToDateTime((entities.LoginDate))));
                daLogin.SelectCommand.Parameters.Add(new SqlParameter("@LoginNotes", entities.LoginNotes));
                daLogin.SelectCommand.CommandType = CommandType.StoredProcedure;
                daLogin.Fill(dsLoginDet);
                return(dsLoginDet);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dsLoginDet);
        }
Пример #4
0
        public void SaveManagerDetails(Attendance.Entities.Entities entities)
        {
            try
            {
                SqlConnection con = new SqlConnection(connectionString);
                SqlCommand    cmd = new SqlCommand("USP_AddIP", con);
                cmd.CommandType = CommandType.StoredProcedure;
                con.Open();
                cmd.Parameters.AddWithValue("@LocationName", entities.LocationName);
                cmd.Parameters.AddWithValue("@PassCode", entities.passcode);
                cmd.Parameters.AddWithValue("@EMPID", entities.EMPID);
                cmd.Parameters.AddWithValue("@IpAddress", entities.IpAddress);
                cmd.Parameters.AddWithValue("@CurrentDate", entities.StartTime);

                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #5
0
        public void UpdateIP(Attendance.Entities.Entities entities)
        {
            try
            {
                SqlConnection con = new SqlConnection(connectionString);
                SqlCommand    cmd = new SqlCommand("[USP_UpdateIP]", con);
                cmd.CommandType = CommandType.StoredProcedure;
                //cmd.CommandText = ();
                con.Open();
                //cmd.Parameters.AddWithValue("@FirstName",entities.FirstName);
                cmd.Parameters.AddWithValue("@LocationName", entities.LocationName);
                cmd.Parameters.AddWithValue("@CurrentDate", entities.StartTime);
                cmd.Parameters.AddWithValue("@EMPID", entities.EMPID);
                cmd.Parameters.AddWithValue("@IpAddress", entities.IpAddress);

                cmd.ExecuteNonQuery();
                con.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }