Beispiel #1
0
        public static QuickSearchResult LoadSingle(long userId, string entity, string id, string parameters = "")
        {
            var item = new DdlVm.DdlOption();

            switch (entity)
            {
            //case "LOCATION": item = BlLocation.LoadQs(userId, Convert.ToInt64(id)); break;
            //case "LOCATIONEMPLOYEE": item = BlLocation.LoadLocationEmployeeQs(userId, id); break;
            case "EMPLOYEE": item = BlEmployee.LoadQs(userId, Convert.ToInt64(id), parameters); break;

            //case "PRODUCT": item = BlProduct.LoadQs(userId, Convert.ToInt64(id)); break;
            //case "SUPPLIER": item = BlSupplier.LoadQs(userId, Convert.ToInt64(id)); break;
            case "USER": item = BlUser.LoadQs(userId, Convert.ToInt64(id)); break;

            case "MODULE": item = BlModule.LoadQs(userId, id); break;

            case "CODE": item = BlCode.LoadQs(userId, id, parameters); break;
                //case "WAREHOUSE": item = BlWarehouse.LoadQs(userId, Convert.ToInt64(id), parameters); break;
                //case "LOCATIONMORAL": item = BlLocationMoral.LoadQs(userId, Convert.ToInt64(id), parameters); break;
                //case "STOCK": item = BlStock.LoadQs(userId, Convert.ToInt64(id)); break;
            }

            var toRet = new QuickSearchResult
            {
                id   = item.value,
                text = item.label
            };

            return(toRet);
        }
Beispiel #2
0
        private static DdlVm.DdlOption FormatForQs(int languageId, User item)
        {
            var toRet = new DdlVm.DdlOption
            {
                value = item.Id.ToUiString(),
                label = item.UserName
            };

            return(toRet);
        }
Beispiel #3
0
        private static DdlVm.DdlOption FormatForQs(int languageId, Employee item, bool returnPin = false)
        {
            var toRet = new DdlVm.DdlOption
            {
                value = returnPin ? item.Entity.Pin.ToUiString() : item.Id.ToUiString(),
                label = BlEntity.FormatFullName(item.Entity)
            };

            return(toRet);
        }
Beispiel #4
0
        private static DdlVm.DdlOption FormatForDdl(int languageId, Entity item)
        {
            var toRet = new DdlVm.DdlOption
            {
                value = item.Pin.ToUiString(),
                label = languageId == 1 ? item.FullEnShortName : item.FullArShortName
            };

            return(toRet);
        }
Beispiel #5
0
        private static DdlVm.DdlOption FormatForQs(Module item)
        {
            var toRet = new DdlVm.DdlOption
            {
                value = item.Id,
                label = item.Id
            };

            return(toRet);
        }
Beispiel #6
0
        private static DdlVm.DdlOption FormatForQs(long userId, Code item)
        {
            var user = BlUser.LoadSingle(userId);

            var toRet = new DdlVm.DdlOption
            {
                value = item.CodeName,
                label = user.LanguageId == 1 ? item.Value1 : item.Value2
            };

            return(toRet);
        }