status, pa material na artikel
This commit is contained in:
@@ -9,17 +9,34 @@ using EveryThing.Models.Invoice;
|
|||||||
|
|
||||||
namespace EveryThing.Models.Project
|
namespace EveryThing.Models.Project
|
||||||
{
|
{
|
||||||
|
public class ProjectPartItemStatusAttribute : Attribute
|
||||||
|
{
|
||||||
|
public int Order { get; set; }
|
||||||
|
|
||||||
|
public ProjectPartItemStatusAttribute(int order)
|
||||||
|
{
|
||||||
|
Order = order;
|
||||||
|
}
|
||||||
|
}
|
||||||
public enum ProjectPartItemStatus
|
public enum ProjectPartItemStatus
|
||||||
{
|
{
|
||||||
|
[ProjectPartItemStatus(1)]
|
||||||
[Display(Name = "Odprto")]
|
[Display(Name = "Odprto")]
|
||||||
Opened = 0,
|
Opened = 0,
|
||||||
|
|
||||||
|
[ProjectPartItemStatus(2)]
|
||||||
[Display(Name = "V izdelavi")]
|
[Display(Name = "V izdelavi")]
|
||||||
InProduction = 1,
|
InProduction = 1,
|
||||||
|
|
||||||
|
[ProjectPartItemStatus(3)]
|
||||||
|
[Display(Name = "V koop.")]
|
||||||
|
InCooperation = 10,
|
||||||
|
|
||||||
|
[ProjectPartItemStatus(4)]
|
||||||
[Display(Name = "Zaključeno")]
|
[Display(Name = "Zaključeno")]
|
||||||
Finished = 2,
|
Finished = 2,
|
||||||
|
|
||||||
|
[ProjectPartItemStatus(5)]
|
||||||
[Display(Name = "Odpremljeno")]
|
[Display(Name = "Odpremljeno")]
|
||||||
Shipped = 3
|
Shipped = 3
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,13 +242,15 @@ namespace EveryThing.Pages.Projects
|
|||||||
Discount = 0,
|
Discount = 0,
|
||||||
IdInvoiceFk = idInvoice,
|
IdInvoiceFk = idInvoice,
|
||||||
IdProjectPartItem = projectPartItem.IdProjectPartItem,
|
IdProjectPartItem = projectPartItem.IdProjectPartItem,
|
||||||
IdItemFk = projectPartItem.IdMaterialFk,
|
IdItemFk = projectPartItem.IdItemFk,
|
||||||
ItemDescription = projectPartItem.MaterialDimensions,
|
ItemDescription = "",
|
||||||
Note = "",
|
Note = "",
|
||||||
Price = projectPartItem.MaterialPrice,
|
Price = projectPartItem.MaterialPrice,
|
||||||
Quantity = projectPartItem.NumberOfItems
|
Quantity = projectPartItem.NumberOfItems * projectPartItem.NumberOfSets
|
||||||
};
|
};
|
||||||
_context.InvoiceItems.Add(newInvoiceItem);
|
_context.InvoiceItems.Add(newInvoiceItem);
|
||||||
|
|
||||||
|
projectPartItem.Status = ProjectPartItemStatus.InCooperation;
|
||||||
}
|
}
|
||||||
_context.SaveChanges();
|
_context.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user