Example #1
0
        public ActionResult materialone()
        {
            dynamic  data  = new System.Dynamic.ExpandoObject();
            string   id    = WebRequest.GetString("id");
            string   type  = WebRequest.GetString("type");
            Material model = new Material();

            if (id != "" && type == "edit")
            {
                model = manageService.GetMaterialList("").FirstOrDefault(p => p.materialNo == id);
            }
            else
            {
                type = "add";
            }

            var units = stockinService.GetMaterialUnit().Select(x => new SelectListItem {
                Text = x.text, Value = x.value
            }).ToList();
            var units2 = stockinService.GetMaterialUnit().Select(x => new SelectListItem {
                Text = x.text, Value = x.value
            }).ToList();

            data.units  = units;
            data.units2 = units2;
            var nofix = stockinService.GetMaterialNoFix().Select(x => new SelectListItem {
                Text = x.text, Value = x.value
            }).ToList();

            data.nofix = nofix;
            data.id    = id;
            data.type  = type;
            data.model = model;
            return(View(data));
        }