Ejemplo n.º 1
0
        public async Task <IActionResult> CreateStudyGroup(string returnUrl = null)
        {
            returnUrl = NormalizeReturnUrl(returnUrl);
            var model = new CreateStudyGroupViewModel
            {
                Input     = new CreateStudyGroupInput(),
                ReturnUrl = returnUrl
            };
            var resultGetTeachers = await _teacherService.GetTeachers(new GetTeachersInput());

            if (resultGetTeachers.IsSuccessed)
            {
                var teachers = resultGetTeachers.Value;
                foreach (var teacher in teachers.Items)
                {
                    var comboboxItem = new ComboboxItemDto(teacher.Id.ToString(), teacher.FullName);
                    model.Input.TeacherComboboxes.Add(comboboxItem);
                }
            }
            var resultGetAcademicSubjects = await _academicSubjectService.GetAcademicSubjects(new GetAcademicSubjectsInput());

            if (resultGetAcademicSubjects.IsSuccessed)
            {
                var academicSubjects = resultGetAcademicSubjects.Value;
                foreach (var academicSubject in academicSubjects.Items)
                {
                    var comboboxItem = new ComboboxItemDto(academicSubject.Id.ToString(), academicSubject.Name);
                    model.Input.AcademicSubjectComboboxes.Add(comboboxItem);
                }
            }
            return(View(model));
        }
        public IList <ComboboxItemDto> GetBool(GetStructForCombboxInput input)
        {
            var list = base.LocalizationSource.GetBool().Select(c => new ComboboxItemDto(c.Key.ToString(), c.Value)).ToList();

            var temp = new ComboboxItemDto {
                Value = null
            };

            if (input.ForType > 0 && !input.ParentText.IsNullOrWhiteSpace())
            {
                if (input.LocationSourceName.IsNullOrWhiteSpace())
                {
                    temp.DisplayText = L(input.ParentText);
                }
                else
                {
                    temp.DisplayText = base.LocalizationManager.GetSource(input.LocationSourceName).GetString(input.ParentText);
                }
                list.Insert(0, temp);
            }
            else if (input.ForType <= 2)
            {
                temp.DisplayText = L("==不限==");
            }
            else
            {
                temp.DisplayText = L("==请选择==");
            }
            return(list);
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> EditInfoAcademicSubject(long id)
        {
            var returnUrl = NormalizeReturnUrl(null);
            var result    = await _academicSubjectService.GetAcademicSubject(new EntityDto <long>(id));

            if (result.IsSuccessed)
            {
                var academicSubject = result.Value;
                var model           = new EditInfoAcademicSubjectViewModel();
                model.Input.AcademicSubjectId = academicSubject.Id;
                model.Input.Name = academicSubject.Name;
                model.ReturnUrl  = returnUrl;
                var resultGetStudyGroups = await _studyGroupService.GetStudyGroups(new GetStudyGroupsInput());

                if (resultGetStudyGroups.IsSuccessed)
                {
                    var studyGroups = resultGetStudyGroups.Value;
                    foreach (var studyGroup in studyGroups.Items)
                    {
                        var comboboxItem     = new ComboboxItemDto(studyGroup.Id.ToString(), studyGroup.Name);
                        var findedStudyGroup = academicSubject.StudyGroups.FirstOrDefault(studyGroup => studyGroup.Id == studyGroup.Id);
                        if (findedStudyGroup != null)
                        {
                            comboboxItem.IsSelected = true;
                        }
                        model.Input.StudyGroupComboboxes.Add(comboboxItem);
                    }
                }
                return(View(model));
            }
            return(Redirect(returnUrl));
        }
Ejemplo n.º 4
0
        public async Task <List <ComboboxItemDto> > GetEditionComboboxItems(int?selectedEditionId = null)
        {
            var editions = await _editionManager.Editions.ToListAsync();

            var editionItems = new ListResultDto <ComboboxItemDto>(editions.Select(e => new ComboboxItemDto(e.Id.ToString(), e.DisplayName)).ToList()).Items.ToList();

            var defaultItem = new ComboboxItemDto("", L("NotAssigned"));

            editionItems.Insert(0, defaultItem);

            if (selectedEditionId.HasValue)
            {
                var selectedEdition = editionItems.FirstOrDefault(e => e.Value == selectedEditionId.Value.ToString());
                if (selectedEdition != null)
                {
                    selectedEdition.IsSelected = true;
                }
            }
            else
            {
                defaultItem.IsSelected = true;
            }

            return(editionItems);
        }
 public static SelectListItem ToSelectListItem(this ComboboxItemDto comboboxItem)
 {
     return(new SelectListItem
     {
         Value = comboboxItem.Value,
         Text = comboboxItem.DisplayText,
         Selected = comboboxItem.IsSelected
     });
 }
Ejemplo n.º 6
0
        public async Task <IActionResult> EditInfoStudyGroup(EditInfoStudyGroupViewModel model)
        {
            if (ModelState.IsValid)
            {
                var result = await _studyGroupService.UpdateStudyGroupInfo(model.Input);

                if (result.IsSuccessed)
                {
                    return(Redirect(model.ReturnUrl));
                }
                var resultGetStudyGroup = await _studyGroupService.GetStudyGroup(new EntityDto <long>(model.Input.StudyGroupId));

                if (resultGetStudyGroup.IsSuccessed)
                {
                    var studyGroup = resultGetStudyGroup.Value;
                    var resultGetAcademicSubjects = await _academicSubjectService.GetAcademicSubjects(new GetAcademicSubjectsInput());

                    if (resultGetAcademicSubjects.IsSuccessed)
                    {
                        var academicSubjects = resultGetAcademicSubjects.Value;
                        foreach (var academicSubject in academicSubjects.Items)
                        {
                            var comboboxItem          = new ComboboxItemDto(academicSubject.Id.ToString(), academicSubject.Name);
                            var findedAcademicSubject = studyGroup.AcademicSubjects.FirstOrDefault(acadSubj => acadSubj.Id == academicSubject.Id);
                            if (findedAcademicSubject != null)
                            {
                                comboboxItem.IsSelected = true;
                            }
                            model.Input.AcademicSubjectComboboxes.Add(comboboxItem);
                        }
                    }
                    var resultGetTeachers = await _teacherService.GetTeachers(new GetTeachersInput());

                    if (resultGetTeachers.IsSuccessed)
                    {
                        var teachers = resultGetTeachers.Value;
                        foreach (var teacher in teachers.Items)
                        {
                            var comboboxItem  = new ComboboxItemDto(teacher.Id.ToString(), teacher.FullName);
                            var findedTeacher = studyGroup.Teachers.FirstOrDefault(teach => teach.Id == teacher.Id);
                            if (findedTeacher != null)
                            {
                                comboboxItem.IsSelected = true;
                            }
                            model.Input.TeacherComboboxes.Add(comboboxItem);
                        }
                    }
                }
                AddResultErros(result);
                AddResultErros(resultGetStudyGroup);
            }
            return(View(model));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 将阶段的枚举类型转换为ComboBoxItemDto列表
        /// </summary>
        /// <returns></returns>
        private List <ComboboxItemDto> GetStagesToComboBoxItemList()
        {
            var list = new List <ComboboxItemDto>();

            foreach (int value in Enum.GetValues(typeof(ProductStage)))
            {
                var item = new ComboboxItemDto(value.ToString(), Enum.GetName(typeof(ProductStage), value));
                list.Add(item);
            }

            return(list);
        }
Ejemplo n.º 8
0
        public async Task <List <ComboboxItemDto> > GetRentsaleinfoTypesForCombo()
        {
            var items = await _rentsaleinfotypeRepository.GetAll().OrderByDescending(t => t.Sort).ToListAsync();

            var list = items.Select(result =>
            {
                var item         = new ComboboxItemDto();
                item.DisplayText = result.Name;
                item.Value       = result.Id.ToString();
                return(item);
            }).ToList();

            return(list);
        }
Ejemplo n.º 9
0
        public async Task <List <ComboboxItemDto> > GetSupplierForCombo()
        {
            var items = await _supplierRepository.GetAllListAsync();

            var list = items.Select(result =>
            {
                var item         = new ComboboxItemDto();
                item.DisplayText = result.Name;
                item.Value       = result.Id.ToString();
                return(item);
            }).ToList();

            return(list);
        }
Ejemplo n.º 10
0
        public List <ComboboxItemDto> GetCommandTypesToItem(int selectValue)
        {
            List <ComboboxItemDto> listItem = new List <ComboboxItemDto>();

            foreach (var item in ReportDefine.CommandTypes)
            {
                ComboboxItemDto comboxItem = new ComboboxItemDto(item.Value.ToString(), item.Key)
                {
                    IsSelected = item.Value == selectValue
                };
                listItem.Add(comboxItem);
            }
            return(listItem);
        }
Ejemplo n.º 11
0
        public async Task <List <ComboboxItemDto> > GetCategoryForCombo()
        {
            var items = await _categoryRepository.GetAll().OrderBy(t => t.Sort).ToListAsync();

            var list = items.Select(result =>
            {
                var item         = new ComboboxItemDto();
                item.DisplayText = result.Name;
                item.Value       = result.Id.ToString();
                return(item);
            }).ToList();

            return(list);
        }
Ejemplo n.º 12
0
        public List <ComboboxItemDto> GetConnkeysToItem(string selectValue)
        {
            List <ComboboxItemDto> listItem = new List <ComboboxItemDto>();
            var connStrs = ConfigurationManager.ConnectionStrings;

            for (int i = 0; i < connStrs.Count; i++)
            {
                ComboboxItemDto comboxItem = new ComboboxItemDto(connStrs[i].Name, connStrs[i].Name)
                {
                    IsSelected = connStrs[i].Name == selectValue
                };
                listItem.Add(comboxItem);
            }
            return(listItem);
        }
Ejemplo n.º 13
0
        public async Task <List <ComboboxItemDto> > GetProductsForCombo()
        {
            var items = await _productRepository.GetAll().OrderByDescending(t => t.CreationTime).ToListAsync();

            var list = items.Select(result =>
            {
                var item = new ComboboxItemDto
                {
                    DisplayText = result.Name,
                    Value       = result.Id.ToString()
                };
                return(item);
            }).ToList();

            return(list);
        }
        public List <ComboboxItemDto> GetCommandTypesToItem(int selectValue)
        {
            List <ComboboxItemDto> listItem = new List <ComboboxItemDto>();

            foreach (int v in Enum.GetValues(typeof(ReportDefine.CommandTypes)))
            {
                string key = Enum.GetName(typeof(ReportDefine.CommandTypes), v);

                ComboboxItemDto comboxItem = new ComboboxItemDto(v.ToString(), key)
                {
                    IsSelected = v == selectValue
                };
                listItem.Add(comboxItem);
            }
            return(listItem);
        }
Ejemplo n.º 15
0
        public async Task <IActionResult> EditInfoTeacher(EditInfoTeacherViewModel model)
        {
            if (ModelState.IsValid)
            {
                var result = await _teacherService.UpdateTeacherInfo(model.Input);

                if (result.IsSuccessed)
                {
                    return(Redirect(model.ReturnUrl));
                }
                var resultGetTeacher = await _teacherService.GetTeacherById(new EntityDto <long>(model.Input.TeacherId));

                if (resultGetTeacher.IsSuccessed)
                {
                    var teacher            = resultGetTeacher.Value;
                    var resultGetAcadSubjs = await _academicSubjectService.GetAcademicSubjects(new GetAcademicSubjectsInput());

                    if (resultGetAcadSubjs.IsSuccessed)
                    {
                        ViewBag.AcademicSubjects =
                            new SelectList(resultGetAcadSubjs.Value.Items, "Id", "Name");
                    }
                    var resultGetStudyGroups = await _studyGroupService.GetStudyGroups(new GetStudyGroupsInput());

                    if (resultGetStudyGroups.IsSuccessed)
                    {
                        var studyGroups = resultGetStudyGroups.Value;
                        foreach (var studyGroup in studyGroups.Items)
                        {
                            var comboboxItem     = new ComboboxItemDto(studyGroup.Id.ToString(), studyGroup.Name);
                            var findedStudyGroup = teacher.StudyGroups.FirstOrDefault(studyGroup => studyGroup.Id == studyGroup.Id);
                            if (findedStudyGroup != null)
                            {
                                comboboxItem.IsSelected = true;
                            }
                            model.Input.StudyGroupComboboxes.Add(comboboxItem);
                        }
                    }
                }
                AddResultErros(result);
                AddResultErros(resultGetTeacher);
            }
            return(View(model));
        }
        public IList <ComboboxItemDto> GetByName(GetEnumForCombboxInput input)
        {
            var cfgItem = cfg.Enums.Single(c => c.Name.Equals(input.EnumTypeName, StringComparison.OrdinalIgnoreCase));

            var list = base.LocalizationManager.GetEnum(cfgItem.LocationSourceName, cfgItem.Type);
            var b    = list.Select(c => new ComboboxItemDto {
                Value = c.Key.ToString(), DisplayText = c.Value
            }).ToList();

            if (input.ForType == 0)
            {
                return(b);
            }

            var temp = new ComboboxItemDto {
                Value = null
            };

            //列表页 不限 类型名    表单页  请选择
            if (input.ForType > 0 && !input.ParentText.IsNullOrWhiteSpace())
            {
                temp.DisplayText = base.LocalizationManager.GetSource(cfgItem.LocationSourceName).GetStringOrNull(input.ParentText);
                if (temp.DisplayText.IsNullOrWhiteSpace())
                {
                    temp.DisplayText = L(input.ParentText);
                }
            }
            else if (input.ForType == 1)
            {
                temp.DisplayText = base.LocalizationManager.GetForType(cfgItem.LocationSourceName, cfgItem.Type);
            }
            else if (input.ForType == 2)
            {
                temp.DisplayText = L("==不限==");
            }
            else
            {
                temp.DisplayText = L("==请选择==");
            }
            b.Insert(0, temp);
            return(b);
        }
Ejemplo n.º 17
0
        public void Ctor()
        {
            var dto = new ComboboxItemDto();

            Assert.Null(dto.Name);
            Assert.Null(dto.Value);

            var _int    = Util.RandInt();
            var _bool   = Util.RandBool();
            var _string = Util.RandString();

            dto.Value = _int;
            Assert.AreEqual(_int, dto.GetValue <int>());

            dto.Value = _bool;
            Assert.AreEqual(_bool, dto.GetValue <bool>());

            dto.Value = _string;
            Assert.AreEqual(_string, dto.GetValue <string>());
        }
Ejemplo n.º 18
0
        private List <ComboboxItemDto> GetCategroyTargets(CategoryTarget target)
        {
            var blank = CategoryTarget.BLANK;
            var self  = CategoryTarget.SELF;

            List <ComboboxItemDto> list      = new List <ComboboxItemDto>();
            ComboboxItemDto        blankItem = new ComboboxItemDto(((int)blank).ToString(), blank.ToString() + "(新开页面)");
            ComboboxItemDto        selfItem  = new ComboboxItemDto(((int)self).ToString(), self.ToString() + "(本页面)");

            if (target == blank)
            {
                blankItem.IsSelected = true;
            }
            else if (target == self)
            {
                selfItem.IsSelected = true;
            }
            list.Add(blankItem);
            list.Add(selfItem);
            return(list);
        }
Ejemplo n.º 19
0
        public async Task <IActionResult> CreateAcademicSubject(string returnUrl = null)
        {
            returnUrl = NormalizeReturnUrl(returnUrl);
            var model = new CreateAcademicSubjectViewModel
            {
                Input     = new CreateAcademicSubjectInput(),
                ReturnUrl = returnUrl
            };
            var resultGetStudyGroups = await _studyGroupService.GetStudyGroups(new GetStudyGroupsInput());

            if (resultGetStudyGroups.IsSuccessed)
            {
                var studyGroups = resultGetStudyGroups.Value;
                foreach (var studyGroup in studyGroups.Items)
                {
                    var comboboxItem = new ComboboxItemDto(studyGroup.Id.ToString(), studyGroup.Name);
                    model.Input.StudyGroupComboboxes.Add(comboboxItem);
                }
            }
            return(View(model));
        }
Ejemplo n.º 20
0
        public async Task <IActionResult> EditInfoTeacher(long id)
        {
            var returnUrl = NormalizeReturnUrl(null, () => Url.Action("Index", "Teachers", new { Area = "Admin" }));
            var result    = await _teacherService.GetTeacherById(new EntityDto <long>(id));

            if (result.IsSuccessed)
            {
                var teacher = result.Value;
                var model   = new EditInfoTeacherViewModel();
                model.Input.TeacherId         = teacher.Id;
                model.Input.AcademicSubjectId = teacher.AcademicSubject?.Id;
                model.FullName  = teacher.FullName;
                model.ReturnUrl = returnUrl;
                var resultGetAcadSubjs = await _academicSubjectService.GetAcademicSubjects(new GetAcademicSubjectsInput());

                if (resultGetAcadSubjs.IsSuccessed)
                {
                    ViewBag.AcademicSubjects =
                        new SelectList(resultGetAcadSubjs.Value.Items, "Id", "Name");
                }
                var resultGetStudyGroups = await _studyGroupService.GetStudyGroups(new GetStudyGroupsInput());

                if (resultGetStudyGroups.IsSuccessed)
                {
                    var studyGroups = resultGetStudyGroups.Value;
                    foreach (var studyGroup in studyGroups.Items)
                    {
                        var comboboxItem     = new ComboboxItemDto(studyGroup.Id.ToString(), studyGroup.Name);
                        var findedStudyGroup = teacher.StudyGroups.FirstOrDefault(studyGroup => studyGroup.Id == studyGroup.Id);
                        if (findedStudyGroup != null)
                        {
                            comboboxItem.IsSelected = true;
                        }
                        model.Input.StudyGroupComboboxes.Add(comboboxItem);
                    }
                }
                return(View(model));
            }
            return(Redirect(returnUrl));
        }
Ejemplo n.º 21
0
        private async Task <List <ComboboxItemDto> > GetEditionComboboxItems(int?selectedEditionId = null)
        {
            ListResultOutput <ComboboxItemDto> editionsForCombobox = await this._lookupAppService.GetEditionsForCombobox();

            List <ComboboxItemDto> list            = editionsForCombobox.Items.ToList <ComboboxItemDto>();
            ComboboxItemDto        comboboxItemDto = new ComboboxItemDto("null", this.L("NotAssigned"));

            list.Insert(0, comboboxItemDto);
            if (!selectedEditionId.HasValue)
            {
                comboboxItemDto.IsSelected = true;
            }
            else
            {
                ComboboxItemDto comboboxItemDto1 = list.FirstOrDefault <ComboboxItemDto>((ComboboxItemDto e) => e.Value == selectedEditionId.Value.ToString());
                if (comboboxItemDto1 != null)
                {
                    comboboxItemDto1.IsSelected = true;
                }
            }
            return(list);
        }
Ejemplo n.º 22
0
        private async Task <List <ComboboxItemDto> > GetEditionComboboxItems(int?selectedEditionId = null)
        {
            var editionItems = (await _lookupAppService.GetEditionsForCombobox()).Items.ToList();

            var defaultItem = new ComboboxItemDto("null", L("NotAssigned"));

            editionItems.Insert(0, defaultItem);

            if (selectedEditionId.HasValue)
            {
                var selectedEdition = editionItems.FirstOrDefault(e => e.Value == selectedEditionId.Value.ToString());
                if (selectedEdition != null)
                {
                    selectedEdition.IsSelected = true;
                }
            }
            else
            {
                defaultItem.IsSelected = true;
            }

            return(editionItems);
        }
Ejemplo n.º 23
0
        public async Task <IActionResult> EditInfoAcademicSubject(EditInfoAcademicSubjectViewModel model)
        {
            if (ModelState.IsValid)
            {
                var result = await _academicSubjectService.UpdateAcademicSubjectInfo(model.Input);

                if (result.IsSuccessed)
                {
                    return(Redirect(model.ReturnUrl));
                }
                var resultGetAcademicSubject = await _academicSubjectService.GetAcademicSubject(new EntityDto <long>(model.Input.AcademicSubjectId));

                if (resultGetAcademicSubject.IsSuccessed)
                {
                    var academicSubject      = resultGetAcademicSubject.Value;
                    var resultGetStudyGroups = await _studyGroupService.GetStudyGroups(new GetStudyGroupsInput());

                    if (resultGetStudyGroups.IsSuccessed)
                    {
                        var studyGroups = resultGetStudyGroups.Value;
                        foreach (var studyGroup in studyGroups.Items)
                        {
                            var comboboxItem     = new ComboboxItemDto(studyGroup.Id.ToString(), studyGroup.Name);
                            var findedStudyGroup = academicSubject.StudyGroups.FirstOrDefault(studyGroup => studyGroup.Id == studyGroup.Id);
                            if (findedStudyGroup != null)
                            {
                                comboboxItem.IsSelected = true;
                            }
                            model.Input.StudyGroupComboboxes.Add(comboboxItem);
                        }
                    }
                }
                AddResultErros(result);
                AddResultErros(resultGetAcademicSubject);
            }
            return(View(model));
        }
Ejemplo n.º 24
0
        public async Task <SalesOrderOutput> GetSalesOrderForEdit(NullableIdDto input)
        {
            SalesOrder salesOrder        = null;
            var        salesOrderLine    = new SalesOrderLine();
            var        salesOrderLineDto = new SalesOrderLineDto();
            var        salesOrderOutput  = new SalesOrderOutput();
            List <SalesOrderLineDto> salesOrderLineDtoList = new List <SalesOrderLineDto>();


            //Sales Order
            if (input.Id.HasValue)
            {
                salesOrder = await _salesOrderRepository
                             .GetAllIncluding(
                    s => s.SalesOrderLines
                    ).FirstOrDefaultAsync(s => s.Id.Equals(input.Id));

                foreach (var line in salesOrder.SalesOrderLines.ToList())
                {
                    salesOrderLineDto = new SalesOrderLineDto
                    {
                        Id          = line.Id,
                        Name        = line.Name,
                        Description = line.Description,
                        Quantity    = line.Quantity,
                        Price       = line.Price,
                        Amount      = line.Amount
                    };

                    salesOrderLineDtoList.Add(salesOrderLineDto);
                }
                salesOrderOutput.SalesOrder      = ObjectMapper.Map <SalesOrderDto>(salesOrder);
                salesOrderOutput.SalesOrderLines = salesOrderLineDtoList;
            }
            else
            {
                salesOrderLineDto = new SalesOrderLineDto
                {
                    Id          = 0,
                    Name        = "",
                    Description = "",
                    Quantity    = 0,
                    Price       = 0,
                    Amount      = 0
                };

                salesOrderLineDtoList.Add(salesOrderLineDto);
                salesOrderOutput.SalesOrderLines = salesOrderLineDtoList;
            }


            //Sales Order
            salesOrderOutput.SalesOrder = salesOrder != null
                        ? ObjectMapper.Map <SalesOrderDto>(salesOrder)
                        : new SalesOrderDto();



            //salesOrderOutput.Customers

            var customers = _lookup_customerRepository
                            .GetAll()
                            .Select(c => new ComboboxItemDto(c.Id.ToString(), c.Name + " (" + c.Company + ")")
            {
                IsSelected = salesOrderOutput.SalesOrder.CustomerId == c.Id
            })
                            .ToList();

            if (!input.Id.HasValue)
            {
                var def = new ComboboxItemDto("", "Please select ...")
                {
                    IsSelected = true
                };

                customers.Add(def);
            }

            salesOrderOutput.Customers = customers;

            //ProductionStatus
            salesOrderOutput.ProductionStatuses = _lookup_productionStatusRepository
                                                  .GetAll()
                                                  .Select(c => new ComboboxItemDto(c.Id.ToString(), c.Name)
            {
                IsSelected = salesOrderOutput.SalesOrder.ProductionStatusId == c.Id
            })
                                                  .ToList();



            return(salesOrderOutput);
        }
Ejemplo n.º 25
0
        public async Task <SalesOrderOutput> GetSalesOrderForCreate()
        {
            //VARIABLES
            var output = new SalesOrderOutput();

            var salesOrderDto   = new SalesOrderDto();
            var salesInvoiceDto = new SalesInvoiceDto();

            var salesOrderLineDto     = new SalesOrderLineDto();
            var salesOrderLineDtoList = new List <SalesOrderLineDto>();

            var salesInvoiceAdditionalCostDto     = new SalesInvoiceAdditionalCostDto();
            var salesInvoiceAdditionalCostDtoList = new List <SalesInvoiceAdditionalCostDto>();

            var salesInvoicePaymentDto     = new SalesInvoicePaymentDto();
            var salesInvoicePaymentDtoList = new List <SalesInvoicePaymentDto>();

            //DEFAULT SELECTED COMBOBOX
            var defaultSelectedCombobox = new ComboboxItemDto("0", "Please select ...")
            {
                IsSelected = true
            };


            //CUSTOMER LOOKUP
            var customers = _lookup_customerRepository
                            .GetAll()
                            .Select(c => new ComboboxItemDto(c.Id.ToString(), c.Name + " (" + c.Company + ")"))
                            .ToList();

            customers.Add(defaultSelectedCombobox);
            output.Customers = customers;

            //PRODUCTION STATUS LOOKUP
            var productionStatuses = _lookup_productionStatusRepository
                                     .GetAll()
                                     .Select(s => new ComboboxItemDto(s.Id.ToString(), s.Name))
                                     .ToList();

            output.ProductionStatuses = productionStatuses;

            //EMPTY SALES ORDER
            salesOrderDto.Id       = null;
            salesOrderDto.Number   = "";
            salesOrderDto.Date     = DateTime.Now;
            salesOrderDto.Deadline = DateTime.Now;

            output.SalesOrder = salesOrderDto;

            //EMPTY SALES ORDER LINE
            salesOrderLineDto.Id            = 0;
            salesOrderLineDto.Name          = "";
            salesOrderLineDto.Description   = "";
            salesOrderLineDto.MarkForDelete = false;

            salesOrderLineDtoList.Add(salesOrderLineDto);
            output.SalesOrderLines = salesOrderLineDtoList;

            //EMPTY SALES INVOICE ADDTIONAL COST
            salesInvoiceAdditionalCostDto.Id            = 0;
            salesInvoiceAdditionalCostDto.Name          = "";
            salesInvoiceAdditionalCostDto.Description   = "";
            salesInvoiceAdditionalCostDto.MarkForDelete = false;

            salesInvoiceAdditionalCostDtoList.Add(salesInvoiceAdditionalCostDto);
            output.SalesInvoiceAdditionalCosts = salesInvoiceAdditionalCostDtoList;


            //EMPTY SALES INVOICE PAYMENT
            salesInvoicePaymentDto.Id            = 0;
            salesInvoicePaymentDto.Date          = DateTime.Now;
            salesInvoicePaymentDto.MarkForDelete = false;

            salesInvoicePaymentDtoList.Add(salesInvoicePaymentDto);
            output.SalesInvoicePayments = salesInvoicePaymentDtoList;



            //PAYMENT METHOD LOOKUP
            //var paymentMethod = _lookup_paymentMethodRepository
            //    .GetAll()
            //    .Select(c => new ComboboxItemDto(c.Id.ToString(), c.Name ))
            //    .ToList();

            //paymentMethod.Add(defaultSelectedCombobox);

            // ViewData["PaymentMethod"] = paymentMethod;



            //var paymentMethod = _paymentMethodRepo.GetAll().OrderBy(p => p.Name);
            //ViewData["PaymentMethod"] = new SelectList(paymentMethod, "ID", "Name");


            //RETURN
            return(output);
        }