Exemple #1
0
        public List <ProveedoresOnLine.Company.Models.Util.GenericItemInfoModel> GITrackingInfo
            (string GITrackingInfo, string ProviderPublicId)
        {
            if (GITrackingInfo == "true")
            {
                ProveedoresOnLine.Company.Models.Util.GenericItemModel oTrakingInf =
                    ProveedoresOnLine.CompanyProvider.Controller.CompanyProvider.MPCustomerProviderGetAllTracking(
                        SessionModel.CurrentCompany.CompanyPublicId, ProviderPublicId);

                List <ProveedoresOnLine.Company.Models.Util.GenericItemInfoModel> oReturn = new List <ProveedoresOnLine.Company.Models.Util.GenericItemInfoModel>();

                if (oTrakingInf != null && oTrakingInf.ItemInfo.Count > 0)
                {
                    oTrakingInf.ItemInfo.All(x =>
                    {
                        TrackingDetailViewModel oTracking = new TrackingDetailViewModel();
                        oTracking = (TrackingDetailViewModel)(new System.Web.Script.Serialization.JavaScriptSerializer()).
                                    Deserialize(x.LargeValue, typeof(TrackingDetailViewModel));

                        oReturn.Add(new ProveedoresOnLine.Company.Models.Util.GenericItemInfoModel()
                        {
                            LargeValue = oTracking.Description,
                            CreateDate = x.CreateDate,
                            Value      = oTrakingInf.ItemType.ItemName,
                        });
                        return(true);
                    });
                }
                else
                {
                    oReturn.Add(new ProveedoresOnLine.Company.Models.Util.GenericItemInfoModel()
                    {
                        Value = oTrakingInf.ItemType.ItemName,
                    });
                }
                return(oReturn);
            }
            return(null);
        }
Exemple #2
0
 public ProviderReportsViewModel(ProveedoresOnLine.Company.Models.Util.GenericItemModel RelatedReport)
 {
     RelatedReportInfo = RelatedReport;
 }
Exemple #3
0
 public ProviderContactViewModel(ProveedoresOnLine.Company.Models.Util.GenericItemModel oRelatedInfo)
 {
     RelatedContactInfo = oRelatedInfo;
 }
 public ProviderLegalViewModel(ProveedoresOnLine.Company.Models.Util.GenericItemModel RelatedLegal)
 {
     RelatedLegalInfo = RelatedLegal;
 }
Exemple #5
0
        public AdminCategoryViewModel(ProveedoresOnLine.Company.Models.Util.GenericItemModel oCategory)
        {
            #region Banks

            B_Bank       = oCategory.ItemName;
            B_BankId     = oCategory.ItemId.ToString();
            B_BankEnable = oCategory.Enable;

            B_BankCodeId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                           Where(y => y.ItemInfoType.ItemId != null && y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.B_Code).
                           Select(y => y.ItemInfoId.ToString()).
                           DefaultIfEmpty(string.Empty).
                           FirstOrDefault() : string.Empty;

            B_BankCode = oCategory.ItemInfo != null?oCategory.ItemInfo.
                         Where(y => y.ItemInfoType.ItemId != null && y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.B_Code).
                         Select(y => !string.IsNullOrEmpty(y.Value) ? y.Value.ToString() : string.Empty).
                         DefaultIfEmpty(string.Empty).
                         FirstOrDefault() : string.Empty;

            B_City = oCategory.ItemInfo != null?oCategory.ItemInfo.
                     Where(y => y.ItemInfoType.ItemId != null && y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.B_Location).
                     Select(y => !string.IsNullOrEmpty(y.Value) ? y.Value.ToString() : string.Empty).
                     DefaultIfEmpty(string.Empty).
                     FirstOrDefault() : string.Empty;

            B_CityId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                       Where(y => y.ItemInfoType.ItemId != null && y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.B_Location).
                       Select(y => y.ItemInfoId.ToString()).
                       DefaultIfEmpty(string.Empty).
                       FirstOrDefault() : string.Empty;

            #endregion

            #region CompanyRules

            CR_CompanyRule       = oCategory.ItemName;
            CR_CompanyRuleId     = oCategory.ItemId.ToString();
            CR_CompanyRuleEnable = oCategory.Enable;

            #endregion

            #region Rules

            R_Rule       = oCategory.ItemName;
            R_RuleId     = oCategory.ItemId.ToString();
            R_RuleEnable = oCategory.Enable;

            #endregion

            #region Resolutions

            RS_Resolution       = oCategory.ItemName;
            RS_ResolutionId     = oCategory.ItemId.ToString();
            RS_ResolutionEnable = oCategory.Enable;

            #endregion

            #region StandarCustomerActivity

            ECS_EconomyActivityId = oCategory.ItemId.ToString();
            ECS_EconomyActivity   = oCategory.ItemName;


            ECS_TypeId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                         Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Type).
                         Select(y => y.ItemInfoId.ToString()).
                         DefaultIfEmpty(string.Empty).
                         FirstOrDefault() : string.Empty;

            ECS_Type = oCategory.ItemInfo != null?oCategory.ItemInfo.
                       Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Type).
                       Select(y => y.ValueName).
                       DefaultIfEmpty(string.Empty).
                       FirstOrDefault().
                       Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).
                       Where(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length >= 2).
                       Select(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0]).FirstOrDefault() : "";

            ECS_CategoryId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                             Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Category).
                             Select(y => y.ItemInfoId.ToString()).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault() : string.Empty;

            ECS_Category = oCategory.ItemInfo != null?oCategory.ItemInfo.
                           Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Category).
                           Select(y => y.ValueName).
                           DefaultIfEmpty(string.Empty).
                           FirstOrDefault().
                           Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).
                           Where(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length >= 2).
                           Select(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0]).FirstOrDefault() : "";

            ECS_GroupId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                          Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Group).
                          Select(y => y.ItemInfoId.ToString()).
                          DefaultIfEmpty(string.Empty).
                          FirstOrDefault() : string.Empty;

            ECS_Group = oCategory.ItemInfo != null?oCategory.ItemInfo.
                        Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Group).
                        Select(y => y.ValueName).
                        DefaultIfEmpty(string.Empty).
                        FirstOrDefault().
                        Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).
                        Where(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length >= 2).
                        Select(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0]).FirstOrDefault() : "";

            ECS_GroupName = oCategory.ItemInfo != null?oCategory.ItemInfo.
                            Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_Group).
                            Select(y => y.ValueName).
                            DefaultIfEmpty(string.Empty).
                            FirstOrDefault().
                            Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).
                            Where(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length >= 2).
                            Select(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[1]).FirstOrDefault() : "";

            ECS_ProviderTypeId = oCategory.ItemInfo != null?oCategory.ItemInfo.
                                 Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_ProviderType).
                                 Select(y => y.ItemInfoId.ToString()).
                                 DefaultIfEmpty(string.Empty).
                                 FirstOrDefault() : string.Empty;

            ECS_ProviderTypeJoin = oCategory.ItemInfo != null?oCategory.ItemInfo.
                                   Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.EA_ProviderType).
                                   Select(y => y.ValueName).
                                   DefaultIfEmpty(string.Empty).
                                   FirstOrDefault().
                                   Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).
                                   Where(y => y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Length >= 2).
                                   Select(y => new CatalogModel()
            {
                ItemId   = Convert.ToInt32(y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[0]),
                ItemName = y.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)[1],
            }).ToList() : null;

            ECS_Enable = oCategory.Enable;

            #endregion

            #region Standar Group

            G_Group       = oCategory.ItemName;
            G_GroupId     = oCategory.ItemId.ToString();
            G_GroupEnable = oCategory.Enable;

            #endregion

            #region ICA

            I_ICA       = oCategory.ItemName;
            I_ICAId     = oCategory.ItemId.ToString();
            I_ICAEnable = oCategory.Enable;
            string codeICA = oCategory.ItemInfo != null?oCategory.ItemInfo.
                             Where(y => y.ItemInfoType.ItemId == (int)BackOffice.Models.General.enumCategoryInfoType.I_ICACode).
                             Select(y => y.Value).
                             DefaultIfEmpty(string.Empty).
                             FirstOrDefault().Trim() : string.Empty.Trim();

            I_ICACode = oCategory.ItemName.Trim() + " - " + codeICA;

            #endregion

            #region Tree

            T_TreeId     = oCategory.ItemId.ToString();
            T_TreeName   = oCategory.ItemName;
            T_TreeEnable = oCategory.Enable;

            #endregion
        }