示例#1
0
        public UCSchedule()
        {
            InitializeComponent();
            _repo      = Di.Container.Instance.Resolve <IRecordRepo>();
            _checkRepo = Di.Container.Instance.Resolve <ICheckRepo>();

            DateTime startOfWeek = GetMonday(DateTime.Today);

            InitPeriods(startOfWeek);
        }
示例#2
0
        public UCCalendar()
        {
            InitializeComponent();
            _repo      = Di.Container.Instance.Resolve <IRecordRepo>();
            _checkRepo = Di.Container.Instance.Resolve <ICheckRepo>();

            var today = DateTime.Today;

            Periods = new List <Tuple <DateTime, DateTime> >()
            {
                new Tuple <DateTime, DateTime>(today.AddDays(-1), today),
                new Tuple <DateTime, DateTime>(today, today.AddDays(1)),
                new Tuple <DateTime, DateTime>(today.AddDays(1), today.AddDays(2)),
            };
            gridViewYesterday.ViewCaption   = today.AddDays(-1).ToLongDateString();
            gridViewCurrentDate.ViewCaption = today.ToLongDateString();
            gridViewTomorrow.ViewCaption    = today.AddDays(1).ToLongDateString();
        }
示例#3
0
        public EditCheckForm(ICheckRepo repo, CheckBl item = null)
        {
            InitializeComponent();
            _repo       = repo;
            _recordRepo = Di.Container.Instance.Resolve <IRecordRepo>();
            _baseRepo   = Di.Container.Instance.Resolve <IBaseRepo>();
            _colorRepo  = Di.Container.Instance.Resolve <IColorRepo>();
            _topRepo    = Di.Container.Instance.Resolve <ITopRepo>();
            _designRepo = Di.Container.Instance.Resolve <IDesignRepo>();
            _item       = item;

            if (item != null)
            {
                Text = "Редактирование расчета";
            }
            else
            {
                Text  = "Новый расчет";
                _item = new CheckBl();
            }

            if (DateTime.Today > _item.Record.RecordDate)
            {
                numericUpDownPrice.DataBindings.Add("Value", _item, nameof(_item.Price), true, DataSourceUpdateMode.OnPropertyChanged);
            }
            else
            {
                numericUpDownPrice.DataBindings.Add("Value", _item, nameof(_item.PriceDynamic), true, DataSourceUpdateMode.OnPropertyChanged);
            }
            textEditComment.DataBindings.Add("EditValue", _item, nameof(_item.Comment), true, DataSourceUpdateMode.OnPropertyChanged);

            var records = _recordRepo.GetWithoutCheck();

            if (_item.Record != null && !records.Any(x => x.Id == _item.RecordId))
            {
                records.Add(_item.Record);
            }
            searchLookUpEditRecord.Properties.DataSource    = records;
            searchLookUpEditRecord.Properties.ValueMember   = "Id";
            searchLookUpEditRecord.Properties.DisplayMember = "DisplayName";
            searchLookUpEditRecord.DataBindings.Add("EditValue", _item, nameof(_item.RecordId), true, DataSourceUpdateMode.OnPropertyChanged);

            gridControlDesign.DataSource = _item.Designs;
            repositoryItemSearchLookUpEditDesign.DataSource = _designRepo.Get();

            textEditPriceFormula.DataBindings.Add("EditValue", _item, nameof(_item.PriceFormula), true, DataSourceUpdateMode.OnPropertyChanged);

            SetData();

            textEditProcedure.Text = string.Join("; ", _item.Record.Record2Procedure.Select(x => x.Procedure.Name));
            numericUpDownPrice.Controls[0].Enabled = false;  // Disable the arrow buttons.

            if (_item.IsVip)
            {
                gridColumnPrice.Visible    = false;
                gridColumnPriceVip.Visible = true;
            }
            else
            {
                gridColumnPrice.Visible    = true;
                gridColumnPriceVip.Visible = false;
            }
        }
 public DashboardController(ICashRepo cashRepo, ICheckRepo checkRepo)
 {
     this.cashRepo = cashRepo;
     this.checkRepo = checkRepo;
 }
 public DashboardController()
 {
     this.cashRepo = new CashRepository(new KasaTakipDbContext());
     this.checkRepo = new CheckRepository(new KasaTakipDbContext());
 }
 public CheckController(ICheckRepo checkRepo)
 {
     this.checkRepo = checkRepo;
 }
 public CheckController()
 {
     this.checkRepo = new CheckRepository(new KasaTakipDbContext());
 }