* ITContentProvider/ITCPNpgsqlProvider.cs:
* ITContentProvider/ITContentProvider.csproj: * ITContentProvider/Model/NewProjectModel.cs: * ITContentProvider/ProjectInfo.cs: * web/Web.csproj: * web/Web.config: * yavscModel/WorkFlow/WorkFlowManager.cs: Namespace ITContentProvider has been removed, implementation has moved to Yavsc namespace * yavscModel/WorkFlow/WorkFlowManager.cs: Xml doc
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using Yavsc;
|
||||
using Npgsql;
|
||||
using Yavsc.Model;
|
||||
|
||||
namespace ITContentProvider
|
||||
namespace Yavsc
|
||||
{
|
||||
/// <summary>
|
||||
/// ITCP npgsql provider.
|
||||
@ -23,9 +24,9 @@ namespace ITContentProvider
|
||||
void NewRelease(int projectId, string Version);
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ITContentProvider.ITCPNpgsqlProvider"/> class.
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Yavsc.ITCPNpgsqlProvider"/> class.
|
||||
/// </summary>
|
||||
public ITCPNpgsqlProvider ()
|
||||
{
|
||||
}
|
||||
|
@ -58,7 +58,7 @@
|
||||
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
|
||||
<Name>YavscModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
|
||||
<ProjectReference Include="..\NpgsqlContentProvider\NpgsqlContentProvider.csproj">
|
||||
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
|
||||
<Name>NpgsqlContentProvider</Name>
|
||||
</ProjectReference>
|
||||
|
@ -2,7 +2,7 @@ using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ITContentProvider.Model
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// New project model.
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using Yavsc;
|
||||
|
||||
namespace ITContentProvider
|
||||
namespace Yavsc.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Project info.
|
||||
|
@ -243,7 +243,8 @@ namespace Yavsc
|
||||
throw new InvalidOperationException (
|
||||
"username cannot be" +
|
||||
" null at searching for estimates");
|
||||
|
||||
List<long> ids = new List<long> ();
|
||||
List<Estimate> ests = new List<Estimate> ();
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
@ -251,14 +252,18 @@ namespace Yavsc
|
||||
|
||||
cmd.Parameters.AddWithValue ("@uname", username);
|
||||
cnx.Open ();
|
||||
List<Estimate> ests = new List<Estimate> ();
|
||||
|
||||
using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) {
|
||||
while (rdr.Read ()) {
|
||||
ests.Add(GetEstimate(rdr.GetInt64(0)));
|
||||
ids.Add (rdr.GetInt64 (0));
|
||||
}
|
||||
rdr.Close ();
|
||||
}
|
||||
return ests.ToArray();
|
||||
cnx.Close ();
|
||||
}
|
||||
foreach (long id in ids)
|
||||
ests.Add(GetEstimate(id));
|
||||
return ests.ToArray();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@ -273,7 +278,8 @@ namespace Yavsc
|
||||
throw new InvalidOperationException (
|
||||
"client and responsible cannot be" +
|
||||
" both null at searching for estimates");
|
||||
|
||||
List<long> ids = new List<long> ();
|
||||
List<Estimate> ests = new List<Estimate> ();
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
@ -291,12 +297,15 @@ namespace Yavsc
|
||||
}
|
||||
|
||||
cnx.Open ();
|
||||
List<Estimate> ests = new List<Estimate> ();
|
||||
|
||||
using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) {
|
||||
while (rdr.Read ()) {
|
||||
ests.Add(GetEstimate(rdr.GetInt64(0)));
|
||||
ids.Add (rdr.GetInt64 (0));
|
||||
}
|
||||
rdr.Close ();
|
||||
}
|
||||
foreach (long id in ids)
|
||||
ests.Add(GetEstimate(id));
|
||||
return ests.ToArray();
|
||||
}
|
||||
}
|
||||
@ -346,6 +355,7 @@ namespace Yavsc
|
||||
/// <param name="estimid">Estimid.</param>
|
||||
public Estimate GetEstimate (long estimid)
|
||||
{
|
||||
Estimate est = null;
|
||||
using (NpgsqlConnection cnx = CreateConnection ()) {
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText =
|
||||
@ -353,7 +363,6 @@ namespace Yavsc
|
||||
|
||||
cmd.Parameters.AddWithValue ("@estid", estimid);
|
||||
cnx.Open ();
|
||||
Estimate est = null;
|
||||
using (NpgsqlDataReader rdr = cmd.ExecuteReader ()) {
|
||||
if (!rdr.Read ()) {
|
||||
return null;
|
||||
@ -371,39 +380,39 @@ namespace Yavsc
|
||||
if (!rdr.IsDBNull (index))
|
||||
est.Description = rdr.GetString (index);
|
||||
est.Id = estimid;
|
||||
using (NpgsqlCommand cmdw = new NpgsqlCommand ("select _id, productid, ucost, count, description from writtings where estimid = @estid", cnx)) {
|
||||
cmdw.Parameters.AddWithValue("@estid", estimid);
|
||||
using (NpgsqlDataReader rdrw = cmdw.ExecuteReader ()) {
|
||||
List<Writting> lw = null;
|
||||
if (rdrw.HasRows) {
|
||||
lw = new List<Writting> ();
|
||||
while (rdrw.Read ()) {
|
||||
Writting w = new Writting ();
|
||||
int dei = rdrw.GetOrdinal ("description");
|
||||
if (!rdrw.IsDBNull (dei))
|
||||
w.Description = rdrw.GetString (dei);
|
||||
int opi = rdrw.GetOrdinal ("productid");
|
||||
if (!rdrw.IsDBNull (opi))
|
||||
w.ProductReference = rdrw.GetString(opi);
|
||||
int oco = rdrw.GetOrdinal ("count");
|
||||
if (!rdrw.IsDBNull (oco))
|
||||
w.Count = rdrw.GetInt32 (oco);
|
||||
int ouc = rdrw.GetOrdinal ("ucost");
|
||||
if (!rdrw.IsDBNull (ouc))
|
||||
w.UnitaryCost = rdrw.GetDecimal (ouc);
|
||||
w.Id = rdrw.GetInt64 (rdrw.GetOrdinal ("_id"));
|
||||
lw.Add (w);
|
||||
}
|
||||
est.Lines = lw.ToArray ();
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO est.Ciffer = somme des ecritures
|
||||
// TODO read into est.Lines
|
||||
|
||||
rdr.Close ();
|
||||
}
|
||||
cnx.Close ();
|
||||
return est;
|
||||
}
|
||||
// assert est != null
|
||||
using (NpgsqlCommand cmdw = new NpgsqlCommand ("select _id, productid, ucost, count, description from writtings where estimid = @estid", cnx)) {
|
||||
cmdw.Parameters.AddWithValue("@estid", estimid);
|
||||
using (NpgsqlDataReader rdrw = cmdw.ExecuteReader ()) {
|
||||
List<Writting> lw = null;
|
||||
if (rdrw.HasRows) {
|
||||
lw = new List<Writting> ();
|
||||
while (rdrw.Read ()) {
|
||||
Writting w = new Writting ();
|
||||
int dei = rdrw.GetOrdinal ("description");
|
||||
if (!rdrw.IsDBNull (dei))
|
||||
w.Description = rdrw.GetString (dei);
|
||||
int opi = rdrw.GetOrdinal ("productid");
|
||||
if (!rdrw.IsDBNull (opi))
|
||||
w.ProductReference = rdrw.GetString(opi);
|
||||
int oco = rdrw.GetOrdinal ("count");
|
||||
if (!rdrw.IsDBNull (oco))
|
||||
w.Count = rdrw.GetInt32 (oco);
|
||||
int ouc = rdrw.GetOrdinal ("ucost");
|
||||
if (!rdrw.IsDBNull (ouc))
|
||||
w.UnitaryCost = rdrw.GetDecimal (ouc);
|
||||
w.Id = rdrw.GetInt64 (rdrw.GetOrdinal ("_id"));
|
||||
lw.Add (w);
|
||||
}
|
||||
est.Lines = lw.ToArray ();
|
||||
}
|
||||
}
|
||||
}
|
||||
return est;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<ProjectGuid>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>WorkFlowProvider</RootNamespace>
|
||||
<AssemblyName>WorkFlowProvider</AssemblyName>
|
||||
<AssemblyName>NpgsqlContentProvider</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
@ -11,7 +11,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SalesCatalog", "SalesCatalo
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscModel", "yavscModel\YavscModel.csproj", "{68F5B80A-616E-4C3C-91A0-828AA40000BD}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NpgsqlContentProvider", "WorkFlowProvider\NpgsqlContentProvider.csproj", "{821FF72D-9F4B-4A2C-B95C-7B965291F119}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NpgsqlContentProvider", "NpgsqlContentProvider\NpgsqlContentProvider.csproj", "{821FF72D-9F4B-4A2C-B95C-7B965291F119}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "YavscClient", "yavscclient\YavscClient.csproj", "{EEFCECE6-3B7F-4BBE-B7AF-69377AF3CF39}"
|
||||
EndProject
|
||||
|
@ -13,7 +13,6 @@ using Npgsql.Web.Blog;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc;
|
||||
using System.Web.Mvc;
|
||||
using ITContentProvider;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
|
@ -6,6 +6,7 @@ body {
|
||||
color: #D0FFD0;
|
||||
font-family: 'Arial', cursive;
|
||||
padding: .5em;
|
||||
margin-bottom:2.8em;
|
||||
}
|
||||
|
||||
textarea {
|
||||
@ -56,12 +57,11 @@ footer {
|
||||
background-color: rgba(32,16,16,0.8);
|
||||
border-radius:5px; border: solid 1px #000060;
|
||||
float: right;
|
||||
margin:.5em;
|
||||
}
|
||||
|
||||
.bsh { float: right; }
|
||||
|
||||
|
||||
|
||||
#login {
|
||||
top:0;
|
||||
right:0;
|
||||
@ -243,5 +243,3 @@ a.actionlink:hover + .hidcom {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -41,7 +41,6 @@
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("textarea.mdd_editor").MarkdownDeep({
|
||||
|
@ -99,7 +99,7 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
|
||||
<workflow defaultProvider="ITProvider">
|
||||
<providers>
|
||||
<clear />
|
||||
<add name="ITProvider" type="ITContentProvider.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc" />
|
||||
<add name="ITProvider" type="Yavsc.ITCPNpgsqlProvider, ITContentProvider" applicationName="/" connectionStringName="yavsc" />
|
||||
</providers>
|
||||
</workflow>
|
||||
<profile defaultProvider="NpgsqlProfileProvider">
|
||||
@ -260,4 +260,4 @@ http://msdn2.microsoft.com/en-us/library/b5ysx397.aspx
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||
<add key="PayPalLogger" value="PayPal.Log.Log4netLogger" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
</configuration>
|
@ -396,10 +396,6 @@
|
||||
<Project>{68F5B80A-616E-4C3C-91A0-828AA40000BD}</Project>
|
||||
<Name>YavscModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WorkFlowProvider\NpgsqlContentProvider.csproj">
|
||||
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
|
||||
<Name>NpgsqlContentProvider</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ITContentProvider\ITContentProvider.csproj">
|
||||
<Project>{9D7D892E-9B77-4713-892D-C26E1E944119}</Project>
|
||||
<Name>ITContentProvider</Name>
|
||||
@ -408,6 +404,10 @@
|
||||
<Project>{B5F49C21-7BB3-4DC0-AE65-F4ED0F6D15BD}</Project>
|
||||
<Name>fortune</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\NpgsqlContentProvider\NpgsqlContentProvider.csproj">
|
||||
<Project>{821FF72D-9F4B-4A2C-B95C-7B965291F119}</Project>
|
||||
<Name>NpgsqlContentProvider</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="instdbws.sql" />
|
||||
|
@ -68,10 +68,16 @@ namespace Yavsc.Model.WorkFlow
|
||||
return ContentProvider.GetEstimates (client, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user estimates.
|
||||
/// </summary>
|
||||
/// <returns>The user estimates.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
public Estimate [] GetUserEstimates (string username)
|
||||
{
|
||||
return ContentProvider.GetEstimates (username);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the stock for a given product reference.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user