init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
85
KretaWeb/Areas/GRModul/Models/KotvallGridModel.cs
Normal file
85
KretaWeb/Areas/GRModul/Models/KotvallGridModel.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Kreta.BusinessLogic.HelperClasses;
|
||||
using Kreta.BusinessLogic.Interfaces;
|
||||
using Kreta.Core.CustomAttributes;
|
||||
using Kreta.Resources;
|
||||
|
||||
namespace Kreta.Web.Areas.GRModul.Models
|
||||
{
|
||||
public class KotvallGridModel : IKretaIdentity
|
||||
{
|
||||
public const string KotvallGridExportAttributeId = nameof(KotvallGridExportAttributeId);
|
||||
|
||||
public KotvallGridModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public KotvallGridModel(KotvallItemCo co, Guid felhasznaloIdpEgyediAzonosito)
|
||||
{
|
||||
ID = co.Id.ToString();
|
||||
Sorszam = co.Sorszam;
|
||||
BejelentoNeve = co.BejelentoNeve;
|
||||
BejelentoIdpEgyediAzonosito = co.BejelentoIdpEgyediAzonosito;
|
||||
StatuszNeve = co.StatuszNeve;
|
||||
StatuszId = co.StatuszId;
|
||||
Leiras = co.Leiras;
|
||||
BeszerzesTargya = co.BeszerzesTargya;
|
||||
BruttoErtek = co.BruttoErtek;
|
||||
IsViewEnabled = true;
|
||||
IsEditEnabled = (felhasznaloIdpEgyediAzonosito == BejelentoIdpEgyediAzonosito) && new List<int> { 2 }.Contains(StatuszId);
|
||||
IsDeleteEnabled = (felhasznaloIdpEgyediAzonosito == BejelentoIdpEgyediAzonosito) && new List<int> { 1 }.Contains(StatuszId);
|
||||
IsInfoEnabled = StatuszId == 2 || StatuszId == 7;
|
||||
}
|
||||
|
||||
public string ID { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 00, nameof(KotvallKezelesResource.BeszerzesSorszam), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.Sorszam), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public string Sorszam { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 01, nameof(KotvallKezelesResource.BejelentoNeve), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.BejelentoNeve), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public string BejelentoNeve { get; set; }
|
||||
|
||||
public Guid BejelentoIdpEgyediAzonosito { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 02, nameof(KotvallKezelesResource.BeszerzesStatusz), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.Statusz), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public string StatuszNeve { get; set; }
|
||||
|
||||
public int StatuszId { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 03, nameof(KotvallKezelesResource.BeszerzesTargya), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.BeszerzesTargya), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public string BeszerzesTargya { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 05, nameof(KotvallKezelesResource.BruttoErtek), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.BruttoErtek), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public int BruttoErtek { get; set; }
|
||||
|
||||
[SimpleExportColumn(KotvallGridExportAttributeId, 04, nameof(KotvallKezelesResource.BeszerzesLeirasa), typeof(KotvallKezelesResource))]
|
||||
[Display(Name = nameof(KotvallKezelesResource.BeszerzesLeirasa), ResourceType = typeof(KotvallKezelesResource))]
|
||||
public string Leiras { get; set; }
|
||||
|
||||
public bool IsViewEnabled { get; set; }
|
||||
public bool IsEditEnabled { get; set; }
|
||||
public bool IsDeleteEnabled { get; set; }
|
||||
public bool IsInfoEnabled { get; set; }
|
||||
|
||||
public KotvallItemCo ConvertToCo()
|
||||
{
|
||||
return new KotvallItemCo
|
||||
{
|
||||
BejelentoNeve = BejelentoNeve,
|
||||
BeszerzesTargya = BeszerzesTargya,
|
||||
BruttoErtek = BruttoErtek,
|
||||
Sorszam = Sorszam,
|
||||
StatuszNeve = StatuszNeve,
|
||||
StatuszId = StatuszId,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue