signing estimate
This commit is contained in:
parent
d76043d08a
commit
65eebf6409
8 changed files with 64 additions and 49 deletions
|
|
@ -16,6 +16,8 @@ namespace Yavsc.Models.Billing
|
|||
public string Description { get; set; }
|
||||
public BaseProduct Article { get; set; }
|
||||
public int Count { get; set; }
|
||||
|
||||
[DisplayFormat(DataFormatString="{0:C}")]
|
||||
public decimal UnitaryCost { get; set; }
|
||||
|
||||
public long EstimateId { get; set; }
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ namespace Yavsc.Models.Billing
|
|||
{
|
||||
using Interfaces;
|
||||
using Models.Workflow;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public partial class Estimate : IEstimate
|
||||
{
|
||||
|
|
@ -22,7 +23,7 @@ namespace Yavsc.Models.Billing
|
|||
/// it will result in a new estimate template
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[ForeignKey("CommandId")]
|
||||
[ForeignKey("CommandId"),JsonIgnore]
|
||||
public BookQuery Query { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Title { get; set; }
|
||||
|
|
@ -62,12 +63,12 @@ namespace Yavsc.Models.Billing
|
|||
[Required]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("OwnerId")]
|
||||
[ForeignKey("OwnerId"),JsonIgnore]
|
||||
public virtual PerformerProfile Owner { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ClientId { get; set; }
|
||||
[ForeignKey("ClientId")]
|
||||
[ForeignKey("ClientId"),JsonIgnore]
|
||||
public virtual ApplicationUser Client { get; set; }
|
||||
|
||||
public string CommandType
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
|
||||
//
|
||||
// BookQueryEvent.cs
|
||||
//
|
||||
|
|
@ -23,6 +19,12 @@ namespace Yavsc.Models.Messaging
|
|||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces.Workflow;
|
||||
|
||||
|
||||
|
||||
public class BookQueryEvent: BookQueryProviderInfo, IEvent
|
||||
{
|
||||
public BookQueryEvent()
|
||||
|
|
|
|||
|
|
@ -1,16 +1,23 @@
|
|||
using System.Linq;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Yavsc.Helpers;
|
||||
using Yavsc.Models.Billing;
|
||||
|
||||
namespace Yavsc.Models.Messaging
|
||||
{
|
||||
using Interfaces.Workflow;
|
||||
using Billing;
|
||||
using Yavsc.Helpers;
|
||||
using System;
|
||||
|
||||
public class EstimationEvent: IEvent
|
||||
{
|
||||
public EstimationEvent(ApplicationDbContext context, Estimate estimate, IStringLocalizer SR)
|
||||
{
|
||||
Topic = "Estimation";
|
||||
Estimation = estimate;
|
||||
var perfer = context.Performers.FirstOrDefault(
|
||||
var perfer = context.Performers.Include(
|
||||
p=>p.Performer
|
||||
).FirstOrDefault(
|
||||
p => p.PerformerId == estimate.OwnerId
|
||||
);
|
||||
// Use estimate.OwnerId;
|
||||
|
|
@ -27,28 +34,19 @@ namespace Yavsc.Models.Messaging
|
|||
ProviderClientInfo ProviderInfo { get; set; }
|
||||
Estimate Estimation { get; set; }
|
||||
|
||||
private string subtopic = null;
|
||||
string IEvent.Topic
|
||||
{
|
||||
get
|
||||
{
|
||||
return "/topic/estimate"+subtopic!=null?"/"+subtopic:"";
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
subtopic = value;
|
||||
}
|
||||
}
|
||||
|
||||
string IEvent.Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
string IEvent.Message
|
||||
public string Topic
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Sender
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Message
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue