public DataTable GetRiverLocation(BALOpenDates obj) { try { SqlConnection cn = new SqlConnection(strCon); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand("[dbo].[sp_OpenDates]", cn); da.SelectCommand.Parameters.Clear(); da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action); da.SelectCommand.Parameters.AddWithValue("@CountryId", obj._CountryId); da.SelectCommand.CommandType = CommandType.StoredProcedure; cn.Open(); da.SelectCommand.ExecuteReader(); DataTable dtReturnData = new DataTable(); cn.Close(); da.Fill(dtReturnData); if (dtReturnData != null) { return(dtReturnData); } else { return(null); } } catch (Exception) { return(null); } }
public int DeleteOpenDates(BALOpenDates obj) { try { SqlConnection cn = new SqlConnection(strCon); SqlDataAdapter da = new SqlDataAdapter(); da.DeleteCommand = new SqlCommand("[dbo].[sp_OpenDates]", cn); da.DeleteCommand.Parameters.AddWithValue("@Action", obj._Action); da.DeleteCommand.Parameters.AddWithValue("@Id", obj.Id); da.DeleteCommand.CommandType = CommandType.StoredProcedure; cn.Open(); int InsertStatus = da.DeleteCommand.ExecuteNonQuery(); cn.Close(); if (InsertStatus > 0) { return(InsertStatus); } else { return(0); } } catch (Exception) { return(0); } }
public DataTable checkDuplicateDepartures(BALOpenDates obj) { try { SqlConnection cn = new SqlConnection(strCon); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand("[dbo].[sp_OpenDates]", cn); da.SelectCommand.Parameters.Clear(); da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action); da.SelectCommand.Parameters.AddWithValue("@CheckOutDate", obj._checkOutDate); da.SelectCommand.Parameters.AddWithValue("@CheckinDate", obj._checkInDate); da.SelectCommand.Parameters.AddWithValue("@packageid", obj._PackageId); da.SelectCommand.Parameters.AddWithValue("@accomid", obj._AccomId); da.SelectCommand.Parameters.AddWithValue("@Id", obj.Id); da.SelectCommand.CommandType = CommandType.StoredProcedure; cn.Open(); da.SelectCommand.ExecuteReader(); DataTable dtReturnData = new DataTable(); cn.Close(); da.Fill(dtReturnData); if (dtReturnData != null) { return(dtReturnData); } else { return(null); } } catch (Exception) { return(null); } }
public int UpdateOpenDates(BALOpenDates obj) { try { SqlConnection cn = new SqlConnection(strCon); SqlDataAdapter da = new SqlDataAdapter(); da.UpdateCommand = new SqlCommand("[dbo].[sp_OpenDates]", cn); da.UpdateCommand.Parameters.AddWithValue("@Action", obj._Action); da.UpdateCommand.Parameters.AddWithValue("@CountryId", obj._CountryId); da.UpdateCommand.Parameters.AddWithValue("@AccomID", obj._AccomId); da.UpdateCommand.Parameters.AddWithValue("@RiverId", obj._RiverId); da.UpdateCommand.Parameters.AddWithValue("@packageId", obj._PackageId); da.UpdateCommand.Parameters.AddWithValue("@CheckinDate", obj._checkInDate); da.UpdateCommand.Parameters.AddWithValue("@checkOutDate", obj._checkOutDate); da.UpdateCommand.Parameters.AddWithValue("@Status", obj.Status); da.UpdateCommand.Parameters.AddWithValue("@Id", obj.Id); da.UpdateCommand.CommandType = CommandType.StoredProcedure; cn.Open(); int InsertStatus = da.UpdateCommand.ExecuteNonQuery(); cn.Close(); if (InsertStatus > 0) { return(InsertStatus); } else { return(0); } } catch (Exception) { return(0); } }