public static STATIONTRANS GetSTATIONTRANSByID(int id) { STATIONTRANS sTATIONTRANS = new STATIONTRANS(); SqlSTATIONTRANSProvider sqlSTATIONTRANSProvider = new SqlSTATIONTRANSProvider(); sTATIONTRANS = sqlSTATIONTRANSProvider.GetSTATIONTRANSByID(id); return(sTATIONTRANS); }
public bool UpdateSTATIONTRANS(STATIONTRANS sTATIONTRANS) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("AbiMatuEnterprise_UpdateSTATIONTRANS", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@STATIONTRANSID", SqlDbType.Int).Value = sTATIONTRANS.STATIONTRANSID; cmd.Parameters.Add("@DT", SqlDbType.DateTime).Value = sTATIONTRANS.DT; cmd.Parameters.Add("@STATIONFROM", SqlDbType.VarChar).Value = sTATIONTRANS.STATIONFROM; cmd.Parameters.Add("@STATIONTO", SqlDbType.VarChar).Value = sTATIONTRANS.STATIONTO; cmd.Parameters.Add("@AMOUNT", SqlDbType.Int).Value = sTATIONTRANS.AMOUNT; cmd.Parameters.Add("@ISACCEPTED", SqlDbType.Char).Value = sTATIONTRANS.ISACCEPTED; cmd.Parameters.Add("@EMP_ID", SqlDbType.Int).Value = sTATIONTRANS.EMP_ID; cmd.Parameters.Add("@SHIFT_ID", SqlDbType.Int).Value = sTATIONTRANS.SHIFT_ID; cmd.Parameters.Add("@TRANSFER_EMP_ID", SqlDbType.Int).Value = sTATIONTRANS.TRANSFER_EMP_ID; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public STATIONTRANS GetSTATIONTRANSFromReader(IDataReader reader) { try { STATIONTRANS sTATIONTRANS = new STATIONTRANS ( (int)reader["STATIONTRANSID"], (DateTime)reader["DT"], reader["STATIONFROM"].ToString(), reader["STATIONTO"].ToString(), (int)reader["AMOUNT"], (char)reader["ISACCEPTED"], (int)reader["EMP_ID"], (int)reader["SHIFT_ID"], (int)reader["TRANSFER_EMP_ID"] ); return(sTATIONTRANS); } catch (Exception ex) { return(null); } }
public static bool UpdateSTATIONTRANS(STATIONTRANS sTATIONTRANS) { SqlSTATIONTRANSProvider sqlSTATIONTRANSProvider = new SqlSTATIONTRANSProvider(); return(sqlSTATIONTRANSProvider.UpdateSTATIONTRANS(sTATIONTRANS)); }
public static int InsertSTATIONTRANS(STATIONTRANS sTATIONTRANS) { SqlSTATIONTRANSProvider sqlSTATIONTRANSProvider = new SqlSTATIONTRANSProvider(); return(sqlSTATIONTRANSProvider.InsertSTATIONTRANS(sTATIONTRANS)); }