Fixes the default of lines at updating
This commit is contained in:
@ -46,7 +46,6 @@ namespace Yavsc.Controllers
|
|||||||
&& username != model.Client
|
&& username != model.Client
|
||||||
&& !Roles.IsUserInRole ("FrontOffice"))
|
&& !Roles.IsUserInRole ("FrontOffice"))
|
||||||
throw new UnauthorizedAccessException ("You're not allowed to view this estimate");
|
throw new UnauthorizedAccessException ("You're not allowed to view this estimate");
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
string username = HttpContext.User.Identity.Name;
|
string username = HttpContext.User.Identity.Name;
|
||||||
@ -64,16 +63,15 @@ namespace Yavsc.Controllers
|
|||||||
model = WorkFlowManager.CreateEstimate (
|
model = WorkFlowManager.CreateEstimate (
|
||||||
username,
|
username,
|
||||||
model.Client, model.Title, model.Description);
|
model.Client, model.Title, model.Description);
|
||||||
else
|
else {
|
||||||
WorkFlowManager.UpdateEstimate (model);
|
WorkFlowManager.UpdateEstimate (model);
|
||||||
|
model = WorkFlowManager.GetEstimate (model.Id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[AcceptVerbs("GET")]
|
[AcceptVerbs("GET")]
|
||||||
public ActionResult Catalog ()
|
public ActionResult Catalog ()
|
||||||
{
|
{
|
||||||
@ -81,6 +79,7 @@ namespace Yavsc.Controllers
|
|||||||
CatalogManager.GetCatalog ()
|
CatalogManager.GetCatalog ()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Catalog this instance.
|
/// Catalog this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -136,7 +135,6 @@ namespace Yavsc.Controllers
|
|||||||
p.CommandForm = b.DefaultForm;
|
p.CommandForm = b.DefaultForm;
|
||||||
|
|
||||||
return View ((p is Service)?"Service":"Product", p);
|
return View ((p is Service)?"Service":"Product", p);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Command()
|
public ActionResult Command()
|
||||||
@ -178,12 +176,11 @@ namespace Yavsc.Controllers
|
|||||||
// Add specified product command to the basket,
|
// Add specified product command to the basket,
|
||||||
basket.Add(new Commande(0,0,collection));
|
basket.Add(new Commande(0,0,collection));
|
||||||
return View (collection);
|
return View (collection);
|
||||||
} catch (Exception e) {
|
} catch (Exception e)
|
||||||
|
{
|
||||||
ViewData ["Message"] = "Exception:"+e.Message;
|
ViewData ["Message"] = "Exception:"+e.Message;
|
||||||
return View (collection);
|
return View (collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user