Beispiel #1
0
        public DataTable GetExists(BALAgentRooms obj)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(strCon);
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
                da.SelectCommand.Parameters.Clear();
                da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.SelectCommand.Parameters.AddWithValue("@AccomId", obj._AccomId);
                da.SelectCommand.Parameters.AddWithValue("@AgentId", obj._AgentId);

                da.SelectCommand.Parameters.AddWithValue("@date", obj._Date);
                da.SelectCommand.Parameters.AddWithValue("@ToDate", obj.toDate);
                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);
            }
        }
Beispiel #2
0
 public int DeletebookableInfo(BALAgentRooms obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.DeleteCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
         da.DeleteCommand.Parameters.AddWithValue("@Action", obj._Action);
         da.DeleteCommand.Parameters.AddWithValue("@Id", obj._id);
         da.DeleteCommand.CommandType = CommandType.StoredProcedure;
         cn.Open();
         int Status = da.DeleteCommand.ExecuteNonQuery();
         cn.Close();
         if (Status > 0)
         {
             return(Status);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception)
     {
         return(0);
     }
 }
Beispiel #3
0
 public DataTable GetBookableRoomDetails(BALAgentRooms obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
         da.SelectCommand.Parameters.Clear();
         da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
         da.SelectCommand.Parameters.AddWithValue("@AgentId", obj._AgentId);
         da.SelectCommand.CommandType = CommandType.StoredProcedure;
         cn.Open();
         da.SelectCommand.ExecuteReader();
         DataTable dtReturnData = new DataTable();
         cn.Close();
         da.Fill(dtReturnData);
         if (dtReturnData != null && dtReturnData.Rows.Count > 0)
         {
             foreach (DataRow row in dtReturnData.Rows)
             {
                 row["AgentName"] = DataSecurityManager.Decrypt(row["AgentName"].ToString());
             }
             return(dtReturnData);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception)
     {
         return(null);
     }
 }
Beispiel #4
0
        public int UpdateRoomImages(BALAgentRooms obj)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(strCon);
                SqlDataAdapter da = new SqlDataAdapter();
                da.UpdateCommand = new SqlCommand("sp_RoomCategoryImages", cn);
                da.UpdateCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.UpdateCommand.Parameters.AddWithValue("@Id", obj._id);
                da.UpdateCommand.Parameters.AddWithValue("@AccomId", obj._AccomId);
                da.UpdateCommand.Parameters.AddWithValue("@RoomCategoryId", obj.RoomCategoryId);
                da.UpdateCommand.Parameters.AddWithValue("@ImagePath", obj.ImagePath);

                da.UpdateCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                int Status = da.UpdateCommand.ExecuteNonQuery();
                cn.Close();
                if (Status > 0)
                {
                    return(Status);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }
Beispiel #5
0
 public DataTable getImageById(BALAgentRooms obj)
 {
     try
     {
         SqlConnection  cn = new SqlConnection(strCon);
         SqlDataAdapter da = new SqlDataAdapter();
         da.SelectCommand = new SqlCommand("sp_RoomCategoryImages", cn);
         da.SelectCommand.Parameters.Clear();
         da.SelectCommand.Parameters.AddWithValue("@Action", obj._Action);
         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);
     }
 }
Beispiel #6
0
        public int UpdateRooms(BALAgentRooms obj)
        {
            try
            {
                SqlConnection  cn = new SqlConnection(strCon);
                SqlDataAdapter da = new SqlDataAdapter();
                da.UpdateCommand = new SqlCommand("[dbo].[sp_agentMaxRooms]", cn);
                da.UpdateCommand.Parameters.AddWithValue("@Action", obj._Action);
                da.UpdateCommand.Parameters.AddWithValue("@AccomId", obj._AccomId);
                da.UpdateCommand.Parameters.AddWithValue("@AgentId", obj._AgentId);
                da.UpdateCommand.Parameters.AddWithValue("@maxRooms", obj._maxRooms);
                da.UpdateCommand.Parameters.AddWithValue("@date", obj._Date);
                da.UpdateCommand.Parameters.AddWithValue("@ToDate", obj.toDate);

                da.UpdateCommand.CommandType = CommandType.StoredProcedure;
                cn.Open();
                int Status = da.UpdateCommand.ExecuteNonQuery();
                cn.Close();
                if (Status > 0)
                {
                    return(Status);
                }
                else
                {
                    return(0);
                }
            }
            catch (Exception)
            {
                return(0);
            }
        }