public void GetAllAditionalDocuments()
        {
            int Total = 0;

            ProveedoresOnLine.CompanyCustomer.Models.Customer.CustomerModel oReturn =
                ProveedoresOnLine.CompanyCustomer.Controller.CompanyCustomer.GetAditionalDocumentsByCompany
                    ("DA5C572E", true, 0, 12000, out Total);

            Assert.AreEqual(true, oReturn != null && oReturn.AditionalDocuments != null);
        }
Пример #2
0
        public ProviderAditionalDocumentViewModel(ProveedoresOnLine.Company.Models.Util.GenericItemModel oRelatedAditionalDocument,
                                                  ProveedoresOnLine.CompanyCustomer.Models.Customer.CustomerModel oCustomerList)
        {
            RelatedAditionalDocument = oRelatedAditionalDocument;

            AditionalDocumentId   = RelatedAditionalDocument.ItemId.ToString();
            AditionalDocumentName = RelatedAditionalDocument.ItemName;
            Enable = RelatedAditionalDocument.Enable;

            #region Aditional Document

            AD_FileId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_File).
                        Select(x => x.ItemInfoId.ToString()).
                        DefaultIfEmpty(string.Empty).
                        FirstOrDefault();

            AD_File = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_File).
                      Select(x => x.Value).
                      DefaultIfEmpty(string.Empty).
                      FirstOrDefault();

            AD_RelatedCustomerId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_RelatedCustomer).
                                   Select(x => x.ItemInfoId.ToString()).
                                   DefaultIfEmpty(string.Empty).
                                   FirstOrDefault();

            AD_RelatedCustomer = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_RelatedCustomer).
                                 Select(x => x.Value).
                                 DefaultIfEmpty(string.Empty).
                                 FirstOrDefault();

            AD_RelatedCustomerName = oCustomerList.RelatedProvider.Where(x => x.RelatedProvider.CompanyPublicId == AD_RelatedCustomer).
                                     Select(x => x.RelatedProvider.CompanyName).
                                     DefaultIfEmpty(string.Empty).
                                     FirstOrDefault();

            AD_RelatedUserId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_RelatedUser).
                               Select(x => x.ItemInfoId.ToString()).
                               DefaultIfEmpty(string.Empty).
                               FirstOrDefault();

            AD_RelatedUser = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_RelatedUser).
                             Select(x => x.Value).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault();

            AD_CreateDate = RelatedAditionalDocument.LastModify.ToString();

            AD_Title = RelatedAditionalDocument.ItemName;

            AD_ValueId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Value).
                         Select(x => x.ItemInfoId.ToString()).
                         DefaultIfEmpty(string.Empty).
                         FirstOrDefault();
            AD_Value = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Value).
                       Select(x => x.Value).
                       DefaultIfEmpty(string.Empty).
                       FirstOrDefault();

            AD_InitialDateId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_InitialDate).
                               Select(x => x.ItemInfoId.ToString()).
                               DefaultIfEmpty(string.Empty).
                               FirstOrDefault();
            AD_InitialDate = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_InitialDate).
                             Select(x => x.Value).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault();
            AD_EndDateId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_EndDate).
                           Select(x => x.ItemInfoId.ToString()).
                           DefaultIfEmpty(string.Empty).
                           FirstOrDefault();
            AD_EndDate = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_EndDate).
                         Select(x => x.Value).
                         DefaultIfEmpty(string.Empty).
                         FirstOrDefault();

            AD_VigencyId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Vigency).
                           Select(x => x.ItemInfoId.ToString()).
                           DefaultIfEmpty(string.Empty).
                           FirstOrDefault();
            AD_Vigency = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Vigency).
                         Select(x => x.Value).
                         DefaultIfEmpty(string.Empty).
                         FirstOrDefault();

            AD_DescriptionId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Description).
                               Select(x => x.ItemInfoId.ToString()).
                               DefaultIfEmpty(string.Empty).
                               FirstOrDefault();
            AD_Description = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDocumentInfoType.AD_Description).
                             Select(x => x.LargeValue).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault();

            #endregion

            #region Aditional Data

            ADT_DataTypeId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_DataType).
                             Select(x => x.ItemInfoId.ToString()).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault();

            ADT_DataType = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_DataType).
                           Select(x => x.Value).
                           DefaultIfEmpty(string.Empty).
                           FirstOrDefault();

            ADT_DataValueId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_Value).
                              Select(x => x.ItemInfoId.ToString()).
                              DefaultIfEmpty(string.Empty).
                              FirstOrDefault();

            ADT_DataValue = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_Value).
                            Select(x => x.Value).
                            DefaultIfEmpty(string.Empty).
                            FirstOrDefault();

            ADT_RelatedCustomerId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_RelatedCustomer).
                                    Select(x => x.ItemInfoId.ToString()).
                                    DefaultIfEmpty(string.Empty).
                                    FirstOrDefault();

            ADT_RelatedCustomer = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_RelatedCustomer).
                                  Select(x => x.Value).
                                  DefaultIfEmpty(string.Empty).
                                  FirstOrDefault();

            ADT_RelatedCustomerName = oCustomerList.RelatedProvider.Where(x => x.RelatedProvider.CompanyPublicId == ADT_RelatedCustomer).
                                      Select(x => x.RelatedProvider.CompanyName).
                                      DefaultIfEmpty(string.Empty).
                                      FirstOrDefault();

            ADT_RelatedUserId = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_RelatedUser).
                                Select(x => x.ItemInfoId.ToString()).
                                DefaultIfEmpty(string.Empty).
                                FirstOrDefault();

            ADT_RelatedUser = RelatedAditionalDocument.ItemInfo.Where(x => x.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumAditionalDataInfoType.ADT_RelatedUser).
                              Select(x => x.Value).
                              DefaultIfEmpty(string.Empty).
                              FirstOrDefault();

            ADT_CreateDate = RelatedAditionalDocument.LastModify.ToString();

            ADT_Title = RelatedAditionalDocument.ItemName;

            #endregion
        }