コード例 #1
0
        private async Task<ImportValidationResultInfo> ValidateCommodityOwnerTypeAsync(CommodityOwnerType commodityType)
        {
            return await Task.Run(() =>
            {
                var res = _commodityOwnerTypeRepository.Validate(commodityType);
                return new ImportValidationResultInfo()
                {
                    Results = res.Results,
                    // Description = "Row-" + count,
                    Entity = commodityType
                };
            });

        }
コード例 #2
0
ファイル: MasterDataUsage.cs プロジェクト: asanyaga/BuildTest
 public bool CheckCommodityOwnerTypeIsUsed(CommodityOwnerType commodityOwnerType, EntityStatus intendedStatus)
 {
     if (intendedStatus == EntityStatus.Inactive)
     {
         if (_ctx.tblCommodityOwner.Any(n => n.CommodityOwnerTypeId == commodityOwnerType.Id && n.IM_Status == (int)EntityStatus.Active))
             return true;
     }
     else if (intendedStatus == EntityStatus.Deleted)
     {
         if (_ctx.tblCommodityOwner.Any(n => n.CommodityOwnerTypeId == commodityOwnerType.Id &&
             (n.IM_Status == (int)EntityStatus.Inactive || n.IM_Status == (int)EntityStatus.Active)))
             return true;
     }
     return false;
 }
コード例 #3
0
 public CommodityOwnerTypeDTO Map(CommodityOwnerType commodityOwnerType)
 {
     if (commodityOwnerType == null) return null;
     var commodityOwnerTypeDto = Mapper.Map<CommodityOwnerType, CommodityOwnerTypeDTO>(commodityOwnerType);
     return commodityOwnerTypeDto;
 }
コード例 #4
0
 private ValidationResultInfo Validate(CommodityOwnerType commodityTypeImport)
 {
    return _commodityOwnerTypeRepository.Validate(commodityTypeImport);
 }
コード例 #5
0
        private void ClearViewModel()
        {
            AccountFullName = "";
            AccountName = "";
            AccountNumber = "";
            PinNumber = "";
            CostCenterCode ="";

            SelectedBank = new Bank(Guid.Empty){Name="--Select Bank--"};
            SelectedBankBranch = new BankBranch(Guid.Empty) { Name = "--Select Bank Branch--" };
            SelectedCommoditySupplierType = CommoditySupplierType.Default;
            SelectedCommoditySupplierType = CommoditySupplierType.Individual;
            SelectedMaritalStatus = MaritalStatas.Default;
            SelectedMaritalStatus = MaritalStatas.Single;
            FarmCode = "";
            FarmName ="";
            Acerage = "";
            FarmRegistrationNo = "";
            FarmPhysicalAddress = "";
            FarmDescription = "";

            Surname = "";
            FirstName = "";
            MiddleName = "";
            OwnerCode = "";
            IdNumber = "";
            PinNumber = "";
            PhysicalAddress = "";
            PostalAddress = "";
            Email = "";
            PhoneNumber = "";
            BusinessNumber = "";
            FaxNumber = "";
            OfficeNumber = "";
            Description = "";
            DateOfBirth = DateTime.Now;

            AssignedCentresList.Clear();
            SupplierIsEnabled = true;
            SelectedCommodityOwnerType = new CommodityOwnerType(Guid.Empty){Name="--Select Commodity Type--"};
        }
コード例 #6
0
 protected Guid AddCommodityOwnerType(string code,string name)
 {
     CommodityOwnerType cot = new CommodityOwnerType(Guid.NewGuid())
                                  {
                                      Code = code,
                                      Name = name,
                                      Description = "desc",
                                      _Status = EntityStatus.Active,
                                  };
     return _commodityOwnerTypeRepository.Save(cot);
 }
コード例 #7
0
 private void AssertCommodityType(CommodityOwnerType commodityOwnerType, CommodityOwnerType savedCommodityOwnerType)
 {
     Assert.AreEqual(commodityOwnerType.Code,savedCommodityOwnerType.Code);
     Assert.AreEqual(commodityOwnerType.Name,savedCommodityOwnerType.Name);
     Assert.AreEqual(commodityOwnerType.Description,savedCommodityOwnerType.Description);
     Assert.AreEqual(commodityOwnerType._Status,savedCommodityOwnerType._Status);
 }