* PaypalApiController.cs: starting a paypal account access
* Catalog.xml: tests input with multiple values * FileSystemController.cs: Xml catalog path is now specified ala ~/ * WorkFlowController.cs: Gives the response a message * SimpleFormatter.cs: * FrontOfficeApiController.cs: document formatting * Global.asax.cs: due to refactoring * SimpleJsonPostMethod.cs: (code formatting) * Web.config: due to refactoring * Web.config: - document formatting - PayPal configuration * Web.csproj: references the PayPalCoreSdk.1.6.0 * packages.config: using the .Net 4.5.1 plateform
This commit is contained in:
parent
3c6c3f19aa
commit
da87d0ea97
12 changed files with 264 additions and 177 deletions
|
|
@ -49,23 +49,23 @@ namespace Yavsc.ApiControllers
|
|||
/// <summary>
|
||||
/// Catalog this instance.
|
||||
/// </summary>
|
||||
[AcceptVerbs("GET")]
|
||||
[AcceptVerbs ("GET")]
|
||||
public Catalog Catalog ()
|
||||
{
|
||||
Catalog c = CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath);
|
||||
return c;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the product categorie.
|
||||
/// </summary>
|
||||
/// <returns>The product categorie.</returns>
|
||||
/// <param name="brandName">Brand name.</param>
|
||||
/// <param name="prodCategorie">Prod categorie.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
[AcceptVerbs ("GET")]
|
||||
public ProductCategory GetProductCategorie (string brandName, string prodCategorie)
|
||||
{
|
||||
return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie)
|
||||
;
|
||||
return CatalogManager.GetCatalog (Request.RequestUri.AbsolutePath).GetBrand (brandName).GetProductCategory (prodCategorie);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -81,30 +81,32 @@ namespace Yavsc.ApiControllers
|
|||
return est;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the estim tex.
|
||||
/// </summary>
|
||||
/// <returns>The estim tex.</returns>
|
||||
/// <param name="estimid">Estimid.</param>
|
||||
[AcceptVerbs("GET")]
|
||||
public HttpResponseMessage GetEstimTex(long estimid)
|
||||
[AcceptVerbs ("GET")]
|
||||
public HttpResponseMessage GetEstimTex (long estimid)
|
||||
{
|
||||
string texest = null;
|
||||
try {
|
||||
texest = getEstimTex (estimid);
|
||||
}
|
||||
catch (TemplateException ex) {
|
||||
return new HttpResponseMessage (HttpStatusCode.OK){ Content =
|
||||
} catch (TemplateException ex) {
|
||||
return new HttpResponseMessage (HttpStatusCode.OK) { Content =
|
||||
new ObjectContent (typeof(string),
|
||||
ex.Message, new ErrorHtmlFormatter(HttpStatusCode.NotAcceptable,
|
||||
LocalizedText.DocTemplateException
|
||||
))};
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ex.Message, new ErrorHtmlFormatter (HttpStatusCode.NotAcceptable,
|
||||
LocalizedText.DocTemplateException
|
||||
))
|
||||
};
|
||||
} catch (Exception ex) {
|
||||
|
||||
return new HttpResponseMessage (HttpStatusCode.OK){ Content =
|
||||
return new HttpResponseMessage (HttpStatusCode.OK) { Content =
|
||||
new ObjectContent (typeof(string),
|
||||
ex.Message, new SimpleFormatter("text/text")) };
|
||||
ex.Message, new SimpleFormatter ("text/text"))
|
||||
};
|
||||
}
|
||||
if (texest == null)
|
||||
return new HttpResponseMessage (HttpStatusCode.OK) { Content =
|
||||
|
|
@ -119,20 +121,20 @@ namespace Yavsc.ApiControllers
|
|||
};
|
||||
}
|
||||
|
||||
private string getEstimTex(long estimid)
|
||||
private string getEstimTex (long estimid)
|
||||
{
|
||||
Yavsc.templates.Estim tmpe = new Yavsc.templates.Estim();
|
||||
Yavsc.templates.Estim tmpe = new Yavsc.templates.Estim ();
|
||||
Estimate e = wfmgr.GetEstimate (estimid);
|
||||
tmpe.Session = new Dictionary<string,object>();
|
||||
tmpe.Session = new Dictionary<string,object> ();
|
||||
tmpe.Session.Add ("estim", e);
|
||||
|
||||
Profile prpro = new Profile(ProfileBase.Create(e.Responsible));
|
||||
Profile prpro = new Profile (ProfileBase.Create (e.Responsible));
|
||||
if (!prpro.HasBankAccount)
|
||||
throw new TemplateException ("NotBankable:"+e.Responsible);
|
||||
throw new TemplateException ("NotBankable:" + e.Responsible);
|
||||
|
||||
Profile prcli = new Profile(ProfileBase.Create(e.Client));
|
||||
Profile prcli = new Profile (ProfileBase.Create (e.Client));
|
||||
if (!prcli.IsBillable)
|
||||
throw new TemplateException ("NotBillable:"+e.Client);
|
||||
throw new TemplateException ("NotBillable:" + e.Client);
|
||||
tmpe.Session.Add ("from", prpro);
|
||||
tmpe.Session.Add ("to", prcli);
|
||||
tmpe.Init ();
|
||||
|
|
@ -145,7 +147,7 @@ namespace Yavsc.ApiControllers
|
|||
/// </summary>
|
||||
/// <returns>The estim pdf.</returns>
|
||||
/// <param name="estimid">Estimid.</param>
|
||||
public HttpResponseMessage GetEstimPdf(long estimid)
|
||||
public HttpResponseMessage GetEstimPdf (long estimid)
|
||||
{
|
||||
Estimate estim = wfmgr.GetEstimate (estimid);
|
||||
//TODO better with pro.IsBankable && cli.IsBillable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue