Dear sir,
I couldn't understand another model.
System.Collections.Generic.IEnumerable does not contain a definition for billing
Actually this existing model is only for creating to insert datas to database. I have need all model properties for insertion. I have mentioned my model class below if you don't mind kindly explain with example.
And I have two dynamic dropdownlist list the existing model(BsaModel). Are you told me below same model create once more have any for that. And if i create same model class can we solve our problems.
Sorry for your valuable times spend with me.
@using ASPMVC.Models
@model IEnumerable<BsaModel>
@{
ViewBag.Title = "BSA";
}
<h2>Sales</h2>
@using (Html.BeginForm("Insert", "Test",FormMethod.Post))
{
@Html.AntiForgeryToken()
<div class="bggrdnt">
<div style="overflow:auto">
<table id="tblItems" class="table table-responsive" style="background-color:whitesmoke">
<thead>
<tr>
<th>Items</th>
<th>HSN Code</th>
<th>Rate</th>
<th>Sgst</th>
<th>Cgst</th>
<th>Qty</th>
<th>Dis</th>
<th>Dis Amt</th>
<th>Cgst Amt</th>
<th>Sgst Amt</th>
<th>Amount</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach(BsaModel products in Model)
{
<tr>
<td>@products.billing</td>
<td>@products.Hsncode</td>
<td>@products.Rate</td>
<td>@products.Sgst</td>
<td>@products.Cgst</td>
<td>@products.Discounts</td>
<td>@products.Disamt</td>
<td>@products.Sgstamt</td>
<td>@products.Cgstamt</td>
<td>@products.Amount</td>
<td>@products.Total</td>
<td><input type="button" value="Remove" onclick="Remove(this)" /></td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td>@Html.DropDownListFor(m => m.id, Model.<span style=""color:" #ff0000;"="">billing</span>, "Please select", new { @id = "ddlItems", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Hsncode</span>, new { @id = "txthsncode", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Rate</span>, new { @id = "txtRate", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Sgst</span>, new { @id = "txtSgst", @class = "form-control", onmouseenter = "Sgstpar();" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Cgst</span>, new { @id = "txtCgst", @class = "form-control", onmouseenter = "Cgstpar();" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Quantity</span>, new { @id = "txtqty", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Discounts</span>, new { @id = "txtdisc", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Disamt</span>, new { @id = "txtdisamt", @class = "form-control" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Sgstamt</span>, new { @id = "txtSgstamt", @class = "form-control", onmouseenter = "Sgstpar();" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Cgstamt</span>, new { @id = "txtCgstamt", @class = "form-control", onmouseenter = "Cgstpar();" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Amount</span>, new { @id = "txtamt", @class = "form-control", onmouseenter = "Calculate();" })</td>
<td>@Html.TextBoxFor(m => m.<span style=""color:" #ff0000;"="">Total</span>, new { @id = "txttotal", @class = "form-control" })</td>
<td><input type="button" id="" onclick="Add()" value="Add" /></td>
</tr>
</tfoot>
</table>
</div>
</div>
}
public class BsaModel
{
public List<SelectListItem> customerlist { get; set; }
public string Customer { get; set; }
public string BillNo { get; set; }
public double Balanceamt { get; set; }
public DateTime Date { get; set; }
public List<SelectListItem> billing { get; set; }
public int id { get; set; }
public int Companyid { get; set; }
public string Itemname { get; set; }
public int Rate { get; set; }
public int Sgst { get; set; }
public int Cgst { get; set; }
public int Quantity { get; set; }
public int Discounts { get; set; }
public double Disamt { get; set; }
public double Sgstamt { get; set; }
public double Cgstamt { get; set; }
public double Amount { get; set; }
public double Total { get; set; }
public string Hsncode { get; set; }
public double SubTotal { get; set; }
}
Thanks & Regards
Rajeesh