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