How to make the guest booking allocation page design in

Ankit tewari
Ankit t...
40 Points
20 Posts

I have to make a datewise  guest room allocation report as in . how to make this type of design as i have upload . All room no are dynamic

Views: 9122
Total Answered: 1
Total Marked As Answer: 0
Posted On: 26-May-2018 00:19

Share:   fb twitter linkedin
Rahul Maurya
Rahul M...
1402 Points
236 Posts

Suppose you have class model RoomAllocation as

public class RoomAllocation{
  public int RoomId {get;set;}
  public bool IsAllocated {get;set;}

And then you have roomAllocations list of the above object.

var roomAllocations = new List<RoomAllocation>();

Now generate html div design as:

 public string GetAllocationHtml()
            var opendiv = "<div class='innverdiv'>";
            var closediv = "</div>";
            var roomAllocations = new List<RoomAllocation>();

            roomAllocations.Add(new RoomAllocation() { RoomId = 1, IsAllocated = true });
            roomAllocations.Add(new RoomAllocation() { RoomId = 2, IsAllocated = true });
            roomAllocations.Add(new RoomAllocation() { RoomId = 3, IsAllocated = false });
            roomAllocations.Add(new RoomAllocation() { RoomId = 4, IsAllocated = true });

            var strBuilder = new StringBuilder();
            strBuilder.Append("<div class='outerdiv'>");
            foreach (var roomAllocation in roomAllocations)
                if (roomAllocation.IsAllocated)
                    strBuilder.Append("<img src='crosimage.png'>");

            return strBuilder.ToString();

Use above method to print the design. Use appropriate css to match your design requirement.

Posted On: 26-May-2018 02:01
 Log In to Chat