- a module for IT services business
- Mvc-like action binding in the WF web api ... ? * Yavsc.sln: * Web.csproj: * MvcActionValueBinder.cs: * yavscModel.csproj: * WFOrder.cs: * IWFOrder.cs: * BasketImpact.cs: * ProjectInfo.cs: * IWFModule.cs: * IWFCommand.cs: * WorkFlowController.cs: * NewProjectModel.cs: * IContentProvider.cs: * ITCPNpgsqlProvider.cs: * WorkFlowProvider.csproj: * ITContentProvider.csproj: * AssemblyInfo.cs: * OrderStatusChangedEventArgs.cs: * NpgsqlContentProvider.cs:
This commit is contained in:
parent
04804b89a9
commit
fa93ce7fee
19 changed files with 412 additions and 122 deletions
|
|
@ -4,36 +4,34 @@ using NpgsqlTypes;
|
|||
using System.Configuration;
|
||||
using System.Collections.Specialized;
|
||||
using yavscModel.WorkFlow;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace WorkFlowProvider
|
||||
{
|
||||
public class NpgsqlContentProvider: IContentProvider
|
||||
{
|
||||
public string Order (IWFCommand c)
|
||||
public IWFOrder CreateOrder ()
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public IContent Get (string orderId)
|
||||
public IWFOrder ImapctOrder (string orderid, FormCollection col)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void AddDevRessource (int prjId, string userName)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void AddPrjRessource(int prjId, string owner)
|
||||
{
|
||||
}
|
||||
|
||||
public void NewRelease (int projectId, string Version)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
public bool[] IsFinalStatus {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
string applicationName=null;
|
||||
|
||||
public string ApplicationName {
|
||||
get {
|
||||
return applicationName;
|
||||
}
|
||||
}
|
||||
|
||||
string cnxstr = null;
|
||||
|
||||
public NpgsqlContentProvider ()
|
||||
|
|
@ -47,7 +45,7 @@ namespace WorkFlowProvider
|
|||
applicationName = config["applicationName"] ?? "/";
|
||||
}
|
||||
|
||||
NpgsqlConnection CreateConnection ()
|
||||
protected NpgsqlConnection CreateConnection ()
|
||||
{
|
||||
return new NpgsqlConnection (cnxstr);
|
||||
}
|
||||
|
|
@ -59,88 +57,30 @@ namespace WorkFlowProvider
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region IContentProvider implementation
|
||||
|
||||
public int NewTask (int projectId, string name, string desc)
|
||||
public string Order (IWFOrder c)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetProjectName (int projectId, string name)
|
||||
public IContent GetBlob (string orderId)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetProjectDesc (int projectId, string desc)
|
||||
public int GetStatus (string orderId)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetTaskName (int taskId, string name)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetStartDate (int taskId, DateTime d)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetEndDate (int taskId, DateTime d)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void SetTaskDesc (int taskId, string desc)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void RemoveProject (int prjId)
|
||||
{
|
||||
using (var cnx = CreateConnection()) {
|
||||
cnx.Open ();
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand()) {
|
||||
cmd.CommandText = "delete from projets where id = @id";
|
||||
cmd.Parameters.Add ("@id", prjId);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
cnx.Close ();
|
||||
public string[] StatusLabels {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveTask (int taskId)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
#region IITContentProvider implementation
|
||||
|
||||
public void SetManager (int projectId, string user)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public void RemoveUser (string user)
|
||||
{
|
||||
throw new System.NotImplementedException ();
|
||||
}
|
||||
|
||||
public int NewProject (string name, string desc, string ownerId)
|
||||
{
|
||||
int id = 0;
|
||||
using (var cnx = CreateConnection()) {
|
||||
cnx.Open ();
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand()) {
|
||||
cmd.CommandText = "insert into projets (name,managerid,ApplicatonName,prdesc) values (@name,@mid,@appname,@pdesc)";
|
||||
cmd.Parameters.Add ("@name", name);
|
||||
cmd.Parameters.Add ("@mid", ownerId);
|
||||
cmd.Parameters.Add ("@appname", applicationName);
|
||||
cmd.Parameters.Add ("@desc", desc);
|
||||
id = (int)cmd.ExecuteScalar ();
|
||||
}
|
||||
cnx.Close ();
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,9 @@
|
|||
<Reference Include="Npgsql" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue