public int Delete(JBHistory JBH) { SqlConnection connection = new SqlConnection(cls.setConnectionString()); connection.Open(); String selectStr = "DELETE FROM Job_HSDetails WHERE (jh_EmpID = '" + JBH.JBEMPID + "')"; SqlCommand command = new SqlCommand(selectStr, connection); command.CommandType = CommandType.Text; try { command.Parameters.AddWithValue("@jbheid", JBH.JBEMPID); return(command.ExecuteNonQuery()); } catch (Exception) { throw; } finally { command.Dispose(); connection.Close(); } }
public int Update(JBHistory JBH) { SqlConnection connection = new SqlConnection(cls.setConnectionString()); connection.Open(); String selectStr = "UPDATE Job_HSDetails SET Jh_Joingdate='" + JBH.JBJOINGDATE + "',jh_Resigndate='" + JBH.JBRSGDATE + "',jh_Jobtitle='" + JBH.JBTITLE + "',jh_comment= '" + JBH.COMMENT + "' WHERE (jh_EmpID = '" + JBH.JBHID + "')"; SqlCommand command = new SqlCommand(selectStr, connection); command.CommandType = CommandType.Text; try { command.Parameters.AddWithValue("@jbhid", JBH.JBHID); command.Parameters.AddWithValue("@jbempid", JBH.JBEMPID); command.Parameters.AddWithValue("@jbjoingdate", JBH.JBJOINGDATE); command.Parameters.AddWithValue("@jbrsgdate", JBH.JBRSGDATE); command.Parameters.AddWithValue("@jbtitle", JBH.JBTITLE); command.Parameters.AddWithValue("@comment", JBH.COMMENT); return(command.ExecuteNonQuery()); } catch (Exception) { throw; } finally { command.Dispose(); connection.Close(); } }
public int InsertJBH(JBHistory JBH) { SqlConnection connection = new SqlConnection(cls.setConnectionString()); connection.Open(); //SqlCommand command = new SqlCommand("InsertData",connection); //command.CommandType = CommandType.StoredProcedure; SqlCommand command = new SqlCommand("INSERT INTO Job_HSDetails VALUES('" + JBH.JBHID + "','" + JBH.JBEMPID + "','" + JBH.JBJOINGDATE + "','" + JBH.JBRSGDATE + "','" + JBH.JBTITLE + "','" + JBH.COMMENT + "')", connection); command.CommandType = CommandType.Text; try { command.Parameters.AddWithValue("@jbhid", JBH.JBHID); command.Parameters.AddWithValue("@jbempid", JBH.JBEMPID); command.Parameters.AddWithValue("@jbjoingdate", JBH.JBJOINGDATE); command.Parameters.AddWithValue("@jbrsgdate", JBH.JBRSGDATE); command.Parameters.AddWithValue("@jbtitle", JBH.JBTITLE); command.Parameters.AddWithValue("@jbcomment", JBH.COMMENT); return(command.ExecuteNonQuery()); } catch (Exception) { throw; } finally { command.Dispose(); connection.Close(); } }
public int Delete_JBH(JBHistory JBH) { try { return(JBDAL.Delete(JBH)); } catch (Exception) { throw; } finally { JBDAL = null; } }
public int Update_JBH(JBHistory JBH) { try { return(JBDAL.Update(JBH)); } catch (Exception) { throw; } finally { //JBDAL = null; } }
public int InsertJBH(JBHistory JBH) { try { return(JBDAL.InsertJBH(JBH)); } catch (Exception) { throw; } finally { //JBDAL = null; } }