Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WTPBuilder
- {
- public IList<WTP_block> WTPblocks { get; set; }
- public IList<Contamination> contams { get; set; }
- public IList<FilterMaterial> filtermaterials { get; set; }
- //public List<Price> prices { get; set; }
- public IList<Effort> efforts { get; set; }
- public PriceList priceList { get; set; }
- public double flow { get; set; }
- public double price { get; set; }
- public int longestList { get; set; }
- public string typeofdew { get; set; }
- public string wtp_luxury { get; set; }
- public double pipe_size { get; set; }
- public string pipe_type { get; set; }
- public double overcapacity { get; set; }
- public int duration_days { get; set; }
- public double distance { get; set; }
- public string discharge_point { get; set; }
- public bool prov1 { get; set; } // these will go in a list at some point.
- public bool prov2 { get; set; }
- public bool prov3 { get; set; }
- public bool prov4 { get; set; }
- public bool prov5 { get; set; }
- public bool prov6 { get; set; }
- public bool prov7 { get; set; }
- public bool prov8 { get; set; }
- public bool prov9 { get; set; }
- public bool prov10 { get; set; }
- public bool prov11 { get; set; }
- public bool prov12 { get; set; }
- public WTPBuilder()
- {
- //WTPblocks = new IList<WTP_block>();
- //filtermaterials = new List<FilterMaterial>();
- //contams = new List<Contamination>();
- }
- public WTPBuilder(List<Contamination> conta, double flow, string typeofdew, int duration_days, string dischargeto, string wtp_luxurity)
- {
- this.flow = flow;
- this.contams = conta;
- this.typeofdew = typeofdew;
- this.duration_days = duration_days;
- this.discharge_point = dischargeto;
- this.wtp_luxurity = wtp_luxurity;
- }
- }
- namespace App2.Models
- {
- public class WTP_block
- {
- [Key]
- public int id { get; set; }
- [Required]
- public string name { get; set; }
- [Required]
- public double size { get; set; }
- public double? length { get; set; }
- public double? width { get; set; }
- public double? height { get; set; }
- public double? weight { get; set; }
- public bool necessity { get; set; }
- public string uniquename()
- {
- string[] s = { this.name, this.size.ToString() };
- return string.Join("_",s);
- }
- }
- }
- [HttpPost]
- public IActionResult remove_wtp_part(int? id, WTPBuilder model)
- {
- if (ModelState.IsValid)
- {
- var wtpblock = model.WTPblocks.SingleOrDefault(b => b.id == id); //here model.WTPblocks.Count = 0 or null if this list is not initialized in the constructor WTPBuilder()
- model.WTPblocks.Remove(wtpblock);
- return RedirectToAction("CreateOldWTP", "WTPBuilder", new { wtp = model });
- }
- return View("Index"); //random never reaches it as model.state is true...
- }
- @model App2.Models.WTP_block
- @Html.HiddenFor(x => x.id)
- @Html.EditorFor(x => x.name)
- @Html.EditorFor(x => x.size)
- @Html.EditorFor(x => x.length)
- @Html.EditorFor(x => x.width)
- @Html.EditorFor(x => x.height)
- @Html.EditorFor(x => x.weight)
- @Html.CheckBoxFor(x => x.necessity)
- @model App2.Models.WTPBuilder
- @{
- ViewData["Title"] = "InputUse";
- }
- <h2>WTP WAS BUILT</h2>
- <h1>The WTP contains</h1>
- <h3>Flow: @Model.flow</h3>
- <h3>Type: @Model.typeofdew </h3>
- <h3>Blocks: @Model.longestList</h3>
- <h3>WTP Luxury status: @Model.wtp_luxury</h3>
- <h3>WTP pipe type: @Model.pipe_type</h3>
- <h3>WTP pipe size: @Model.pipe_size</h3>
- <h3>WTP parts</h3>
- <table class="table">
- <thead>
- <tr>
- <th>
- @Html.DisplayNameFor(model => model.contams)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.filtermaterials)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.WTPblocks)
- </th>
- <th>
- @Html.DisplayNameFor(model => model.WTPblocks[0].size)
- </th>
- </tr>
- </thead>
- <tbody>
- @for (int i = 0; i < Model.longestList; i++)
- {
- <tr>
- @if (i < Model.contams.Count)
- {
- <td>@Html.DisplayFor(modelItem => Model.contams[i].Name)</td>
- }
- else
- {
- <td></td>
- }
- @if (i < Model.filtermaterials.Count)
- {
- <td>@Html.DisplayFor(modelItem => Model.filtermaterials[i].Name)</td>
- }
- else
- {
- <td></td>
- }
- @if (i < Model.WTPblocks.Count)
- {
- <td>@Html.DisplayFor(modelItem => Model.WTPblocks[i].name)</td>
- <td>@Html.DisplayFor(modelItem => Model.WTPblocks[i].size)</td>
- <td><a asp-action="getEfforts" asp-route-id="@Model.WTPblocks[i].id">show Efforts</a>|</td>
- <td>
- @using (Html.BeginForm("remove_wtp_part", "WTPBuilder", new { id = Model.WTPblocks[i].id }))
- {
- @Html.HiddenFor(m=>m.WTPblocks[i].id)
- <input type="submit" value="Remove"/>
- }
- </td>
- }
- else
- {
- < td ></ td >
- }
- </tr>
- }
- </tbody>
- </table>
- HERE ENDS THE INTERESTING PART, I ASSUME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- <h3>Efforts to install</h3>
- <table class="table">
- <thead>
- <tr>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].WTP_block_name)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].Name)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].category)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].effort)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].unit)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].temp_section)
- </th>
- <th>
- @Html.DisplayNameFor(modelItem => Model.efforts[0].wtp_luxurity)
- </th>
- </tr>
- </thead>
- <tbody>
- @for (int i = 0; i < Model.efforts.Count; i++)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].WTP_block_name)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].Name)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].category)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].effort)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].unit)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].temp_section)</td>
- <td>@Html.DisplayFor(modelItem => Model.efforts[i].wtp_luxurity)</td>
- <td><a asp-action="EditEffort" asp-route-id="@Model.efforts[i].id">Edit</a></td>
- </tr>
- }
- </tbody>
- </table>
- Mobilisation ( total = @Html.DisplayFor(Model => Model.priceList.total_price_mob) )
- <table class="table">
- <thead>
- <tr>
- <th>
- Name
- </th>
- <th>
- Amount
- </th>
- <th>
- Price
- </th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.priceList.prices_mob)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => item.Key)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.quantities_mob[item.Key])</td>
- <td>@Html.DisplayFor(modelItem => item.Value)</td>
- </tr>
- }
- </tbody>
- </table>
- De-Mobilisation ( total = @Html.DisplayFor(Model => Model.priceList.total_price_demob) )
- <table class="table">
- <thead>
- <tr>
- <th>
- Name
- </th>
- <th>
- Amount
- </th>
- <th>
- Price
- </th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.priceList.prices_demob)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => item.Key)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.quantities_demob[item.Key])</td>
- <td>@Html.DisplayFor(modelItem => item.Value)</td>
- </tr>
- }
- </tbody>
- </table>
- Operation and Maintenance ( total = @Html.DisplayFor(Model => Model.priceList.total_price_operation) )
- <table class="table">
- <thead>
- <tr>
- <th>
- Name
- </th>
- <th>
- Amount
- </th>
- <th>
- Price
- </th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.priceList.prices_operation)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => item.Key)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.quantities_operation[item.Key])</td>
- <td>@Html.DisplayFor(modelItem => item.Value)</td>
- </tr>
- }
- </tbody>
- </table>
- Rent ( total = @Html.DisplayFor(Model => Model.priceList.total_price_rent) )
- <table class="table">
- <thead>
- <tr>
- <th>
- Name
- </th>
- <th>
- Amount
- </th>
- <th>
- Price
- </th>
- </tr>
- </thead>
- <tbody>
- @foreach (var item in Model.priceList.prices_rent)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => item.Key)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.quantities_rent[item.Key])</td>
- <td>@Html.DisplayFor(modelItem => item.Value)</td>
- </tr>
- }
- </tbody>
- </table>
- <h3>Complete Price List</h3>
- <table class="table">
- <thead>
- <tr>
- <th>
- @Html.LabelFor(m=>m.priceList.prices_all[0].id)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].id)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].EkdT)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].size)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].unit)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].price)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].unit_p)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].rent)
- </th>
- <th>
- @Html.LabelFor(m => m.priceList.prices_all[0].unit_r)
- </th>
- </tr>
- </thead>
- <tbody>
- @for (int i = 0; i < Model.priceList.prices_all.Count; i++)
- {
- <tr>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].id)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].name)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].EkdT)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].size)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].unit)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].price)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].unit_p)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].rent)</td>
- <td>@Html.DisplayFor(modelItem => Model.priceList.prices_all[i].unit_r)</td>
- <td><a asp-action="editThePrice" asp-route-id="@Model.priceList.prices_all[i].id">Edit Price</a></td>
- </tr>
- }
- </tbody>
- </table>
- <div class="row">
- <div class="col-sm-8">
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov1)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov2)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov3)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov4)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov5)
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov6)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov7)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov8)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov9)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov10)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov11)
- </div>
- </div>
- <div class="form-inline">
- <div class="form-group">
- @Html.DisplayFor(m => m.prov12)
- </div>
- </div>
- </div>
- </div>
- </div>
- @using (Html.BeginForm("remove_wtp_part", "WTPBuilder", new { id = Model.WTPblocks[i].id }))
- {
- @Html.HiddenFor(m=>m.WTPblocks[i].id)
- <input type="submit" value="Remove"/>
- }
Add Comment
Please, Sign In to add comment