Jun 28, 2014, 7:21 PM
[CLOSED] Master Details entry form
Hi
I need some code help .I stuck into this from last 15 days.I attach a screen shot ,please look into this and please provide me sample code .
I stuck into view code.
CONTROLLER CODE
I need some code help .I stuck into this from last 15 days.I attach a screen shot ,please look into this and please provide me sample code .
I stuck into view code.
CONTROLLER CODE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace ERP_test.Controllers
{
public class masterdetailsController : Controller
{
//
// GET: /masterdetails/
public ActionResult Index()
{
ViewBag.loadcategory = category.categoryGetAll();
return View();
}
}
}
public class material
{
public int materialID { get; set; }
public string code { get; set; }
public string materialIDName { get; set; }
public int unitid { get; set; }
public int categoryid { get; set; }
public static List<material> materialGetAll()
{
return new List<material>
{
new material {materialID = 1,code="m001", materialIDName = "material A",unitid=1,categoryid=1},
new material {materialID = 2, code="m002",materialIDName = "material B",unitid=1,categoryid=1},
new material {materialID = 3, code="m003",materialIDName = "material C",unitid=2,categoryid=2}
};
}
}
public class unit
{
public int unitid { get; set; }
public string unitName { get; set; }
public static List<unit> unitGetAll()
{
return new List<unit>
{
new unit { unitid=1,unitName = "unit A"},
new unit { unitid=2,unitName = "unit B"},
};
}
}
public class category
{
public int categoryid { get; set; }
public string categoryName { get; set; }
public static List<category> categoryGetAll()
{
return new List<category>
{
new category { categoryid=1,categoryName = "category A"},
new category { categoryid=2,categoryName = "category B"},
};
}
}
Last edited by Daniil; Jul 08, 2014 at 5:26 AM.
Reason: [CLOSED]