Hi guys, I have my main supplier model and the default identity user model. However my requirements are below and I dont know the best way to get there.
Do I need to create new models and link them together? Do I need to create a user model or am I still ok using the default model so login is already set up?
So it should be like this:
Main dashboard grid showing all suppliers > add/edit/delete supplier
Main dashboard grid showing all suppliers > click view products > show all products for this supplier in grid > add/edit/delete product for this supplier
Main dashboard grid showing all suppliers > click view details> form/grid showing details address etc > edit details
Main dashboard grid showing all suppliers > click view users> grid showing all users for this supplier > add/edit/delete user (currently I have altered the aspnetuser table to contain supplierid so I can link users to a supplier and also login).
thanks
Current supplier model:
public partial class supplier
{
public int supplierid { get; set; }
[Required]
[StringLength(50)]
public string suppliername { get; set; }
[StringLength(50)]
public string address1 { get; set; }
[StringLength(50)]
public string county { get; set; }
[StringLength(50)]
public string country { get; set; }
[StringLength(50)]
public string telephone { get; set; }
[StringLength(50)]
public string address2 { get; set; }
[StringLength(11)]
public string postcode { get; set; }
[StringLength(20)]
public string webstatus { get; set; }
public status status { get; set; }
[StringLength(50)]
public string LastreviewedBy { get; set; }
[Column(TypeName = "datetime2")]
public DateTime Whencompliant { get; set; }
[Column(TypeName = "datetime2")]
public DateTime Reviewdate { get; set; }
}
public enum status
{
InProgress,
Started,
NotStarted,
}Main grid / dashboard - currently only the important fields showing, I want to then be able to edit supplierdetails and supplierproducts:
<asp:GridView ID="GridView1" runat="server" CssClass="col-md-8 table table-bordered table-hover table-responsive" SelectMethod="GridView1_GetData" DeleteMethod="GridView1_DeleteItem" UpdateMethod="GridView1_UpdateItem"
DataKeyNames="supplierid" GridLines="Horizontal" ItemType="PrincePortalWeb.Models.supplier" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" SelectedRowStyle-BackColor="#ddf7ff"><Columns><asp:CommandField ButtonType="Image" ShowSelectButton="true" SelectImageUrl="~/Content/Images/select.png" ItemStyle-HorizontalAlign="Center" /><asp:DynamicField DataField="suppliername" HeaderText="Supplier Name" /><asp:DynamicField DataField="status" HeaderText="Status" /><asp:DynamicField DataField="whencompliant" HeaderText="When Compliant" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="false" /><asp:DynamicField DataField="reviewdate" HeaderText="Review Date" DataFormatString="{0:MM/dd/yyyy}" /><asp:DynamicField DataField="lastreviewedby" HeaderText="Reviewed By" /><asp:DynamicField DataField="webstatus" ReadOnly="true" HeaderText="Portal Status" /><asp:TemplateField ItemStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ImageUrl="~/Content/Images/producticon.png" CommandName="ViewProducts" ImageAlign="Middle" ToolTip="View Supplier Products" runat="server" /></ItemTemplate></asp:TemplateField><asp:TemplateField FooterStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ImageUrl="~/Content/Images/detailicon.png" ImageAlign="Middle" CommandName="ViewDetails" ToolTip="View Supplier Details" runat="server" /></ItemTemplate></asp:TemplateField><asp:CommandField ButtonType="Image" ItemStyle-HorizontalAlign="Center" ShowDeleteButton="true" DeleteImageUrl="~/Content/Images/deleteicon.png" CancelImageUrl="~/Content/Images/cancelicon.png" EditImageUrl="~/Content/Images/editicon.png" ShowEditButton="True" UpdateImageUrl="~/Content/Images/tickicon.png" /></Columns></asp:GridView>