public ActionResult Index(String FileNames) { //get weight pass from setweight page ControlStructureWeight Weight = TempData["Weight"] as ControlStructureWeight; ControlStructureWeight weight = new ControlStructureWeight() { ifElseIfWeight = Weight.ifElseIfWeight, forWileDoWhileWeight = Weight.forWileDoWhileWeight, SwitchWeight = Weight.SwitchWeight, CaseWeight = Weight.CaseWeight }; ControlStructureDetector controlStructure = new ControlStructureDetector(); //set filename pass from URL controlStructure.SetFileName(FileNames); //calculate conrol structure in files controlStructure.ProcessFile(weight); List <Controlstructure> controlstructuresList = new List <Controlstructure>(); //retun list controlstructuresList = controlStructure.result(); return(View(controlstructuresList)); }
public ActionResult SetWeight(ControlStructureWeight controlStructureWeight, String fileName) { //set the weight ControlStructureWeight weight = new ControlStructureWeight() { ifElseIfWeight = controlStructureWeight.ifElseIfWeight, forWileDoWhileWeight = controlStructureWeight.forWileDoWhileWeight, SwitchWeight = controlStructureWeight.SwitchWeight, CaseWeight = controlStructureWeight.CaseWeight }; //return weight to index controller TempData["Weight"] = weight; return(RedirectToAction("Index", "ControlStrcture", new { FileNames = fileName })); }