// GET: Inventories/Create public ActionResult Create(int?Maincategory, int?Status) { InventoryModel model = new InventoryModel(); string maincat = ""; model.ddlMaincategory = GetddlMainCategory(); model.Maincategory = (Maincategory == null ? 0 : Convert.ToInt32(Maincategory)); int main = model.Maincategory.Value; var lstresult = dal.CodeByID(main); if (lstresult != null) { maincat = lstresult.Code; } if (maincat != "" && maincat != null) { model.CodeNo = dal.GenerateCodeNo(maincat); model.GenNo = Convert.ToInt32(model.CodeNo.Replace(maincat, "")); } model.ddlCategory = GetddlCategory(main); model.ddlDepartment = GetddlDepartment(); model.ddlEmp = GetddlEmp(); List <RadioType> l = new List <RadioType> { new RadioType { ID = 4, Name = "Size" }, new RadioType { ID = 5, Name = "Model" }, }; model.radiotypes = l; model.rdo = 4; //Size model.ddlTypeID = GetddlType(1); //Model model.ddlTypeModel = GetddlType(2); model.ddlCurrency = GetddlCurrency(); List <RadioType> ll = new List <RadioType> { new RadioType { ID = 1, Name = "In Use" }, new RadioType { ID = 2, Name = "Not In Use" }, new RadioType { ID = 3, Name = "Damage" } }; model.llradiotypes = ll; model.Status = (Status == null ? 1 : Convert.ToInt32(Status)); int status = model.Status.Value; return(View(model)); }