Ejemplo n.º 1
0
        public YearlyForm(LoginForm frmParent)
        {
            InitializeComponent();
            frmLogin = frmParent;
            foreach (ComboBox cb in tabPage2.Controls.OfType <ComboBox>())
            {
                cbList.Add(cb);
            }
            ServiceItems clsServiceItems = new ServiceItems(GlobalVariables.connectionString);

            clsServiceItems.openWhere("ItemRule = 4");
            lvwSpclFood.Items.Clear();
            ListViewItem lvwItm;

            for (int i = 0; i < clsServiceItems.DSet.Tables[0].Rows.Count; i++)
            {
                lvwItm      = new ListViewItem();
                lvwItm.Text = clsServiceItems.DSet.Tables[0].Rows[i]["ItemDesc"].ToString();
                lvwItm.SubItems.Add(clsServiceItems.DSet.Tables[0].Rows[i]["ItemKey"].ToString());
                lvwSpclFood.Items.Add(lvwItm);
            }
            Defaults.Init();
            CurrentFiscalStart = Defaults.CurrentFiscalStartDate();
            CurrentFiscalEnd   = Defaults.CurrentFiscalEndDate();
            SetCalendarRange(CurrentFiscalStart, CurrentFiscalEnd);
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Title_Ru,Title_Az,Content,Content_Ru,Content_Az")] ServiceItems serviceItems)
        {
            if (id != serviceItems.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(serviceItems);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceItemsExists(serviceItems.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceItems));
        }
Ejemplo n.º 3
0
 public TodaysItems(Client clsClientIn)
 {
     clsDaysOpen     = new DaysOpen(CCFBGlobal.connectionString);
     clsServiceItems = new ServiceItems(CCFBGlobal.connectionString);
     clsClient       = clsClientIn;
     setForToday();
 }
 private void SetupServiceItemsDataSource(long serviceItemGroupId)
 {
     CurrentServiceItems = CurrentServiceItemGroups != null && CurrentServiceItemGroups.Count > 0
         ? ServiceItems.Where(si => si.ServiceItemGroupId == serviceItemGroupId).ToList()
         : new List <ServiceItemWithServiceItemGroupDTO>();
     ServiceItemsBindingList             = new BindingList <ServiceItemWithServiceItemGroupDTO>(CurrentServiceItems);
     serviceItemsDataGridView.DataSource = ServiceItemsBindingList;
 }
        public async Task <IActionResult> Create([Bind("ID,Title,Title_Ru,Title_Az,Content,Content_Ru,Content_Az")] ServiceItems serviceItems)
        {
            if (ModelState.IsValid)
            {
                _context.Add(serviceItems);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceItems));
        }
Ejemplo n.º 6
0
        public ServiceDaysForm()
        {
            InitializeComponent();

            clsSvcItems = new ServiceItems(GlobalVariables.connectionString);
            clsSvcDays  = new ServiceDays(GlobalVariables.connectionString);

            panel1.BackColor = Color.LightGreen;
            setTodayLable(DateTime.Today);
            getDateFormat(DateTime.Today);

            clsSvcItems.openAll();
            loadList();

            //calSvcDates.DayRender += new DayRenderEventHandler(calSvcDates_DayRender);
        }
        private void UpdateServiceItemsList()
        {
            if (CurrentServiceItems == null)
            {
                return;
            }

            foreach (var serviceItem in CurrentServiceItems)
            {
                var existingServiceItem = ServiceItems
                                          .Where(si => si.Id == serviceItem.Id)
                                          .FirstOrDefault();

                if (existingServiceItem != null)
                {
                    var index = ServiceItems.IndexOf(existingServiceItem);
                    ServiceItems[index] = existingServiceItem;
                }
                else
                {
                    serviceItem.ServiceItemGroupId = CurrentServiceItemGroupId;
                    ServiceItems.Add(serviceItem);
                }
            }

            foreach (var serviceItemId in DeletedServiceItems)
            {
                var existingServiceItem = ServiceItems
                                          .Where(si => si.Id == serviceItemId)
                                          .FirstOrDefault();

                if (existingServiceItem != null)
                {
                    var index = ServiceItems.IndexOf(existingServiceItem);
                    ServiceItems.RemoveAt(index);
                }
            }
        }
Ejemplo n.º 8
0
        public List <IMaterialValidator> CreateValidators()
        {
            var materialValidatorList = new List <IMaterialValidator>();

            materialValidatorList.AddRange(_materialValidatorFactory.CreateMaterialValidators(ServiceItems.ToList()));

            return(materialValidatorList);
        }