Ejemplo n.º 1
0
        private void InitializeFormControls(TenderYear year)
        {
            InitializeComponent();

            button1.Visible = UserSession.IsAuthorized;

            using (TenderContext tc = new TenderContext())
            {
                contractorCBList.DataSource    = tc.Contractors.OrderBy(p => p.ShortName).ToList();
                contractorCBList.DisplayMember = "ShortName";
                contractorCBList.ValueMember   = "Id";
            }

            isPossibleToChangeContractMainData = true;
            locker      = new object();
            label8.Text = string.Empty;
            contractUsedSumLabel.Text      = contractRemainLabel.Text = string.Empty;
            filesTable.AutoGenerateColumns = contractChangesTable.AutoGenerateColumns = contractInvoicesTable.AutoGenerateColumns = false;

            deletingFiles         = new List <UploadedFile>();
            relatedFiles          = new BindingList <UploadedFile>();
            filesTable.DataSource = relatedFiles;
            DataGridViewHelper.ConfigureFileTable(filesTable, relatedFiles, deletingFiles, linkLabel1, linkLabel2, linkLabel3);

            dateOfSigning.Value = dateOfStart.Value = dateOfEnd.Value =
                new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0).AddYears(Convert.ToInt32(year.Year) - DateTime.Now.Year);
            dateOfSigning.MinDate = dateOfStart.MinDate = dateOfEnd.MinDate = new DateTime(Convert.ToInt32(year.Year), 1, 1, 0, 0, 0);
            dateOfSigning.MaxDate = dateOfStart.MaxDate = dateOfEnd.MaxDate = new DateTime(Convert.ToInt32(year.Year), 12, 31, 0, 0, 0);
            dateOfEnd.Value       = new DateTime(Convert.ToInt32(year.Year), 12, 31, 0, 0, 0);

            hiddenPagesList = new List <TabPage>();

            contractChangesTable.RowsAdded  += (sender, e) => DataGridViewHelper.CalculateNewRowNumber(contractChangesTable, 0, e.RowIndex, e.RowCount);
            contractInvoicesTable.RowsAdded += (sender, e) => DataGridViewHelper.CalculateNewRowNumber(contractInvoicesTable, 0, e.RowIndex, e.RowCount);
        }
Ejemplo n.º 2
0
        private void InitializeFormControls()
        {
            InitializeComponent();
            button1.Visible   = UserSession.IsAuthorized;
            wasDbUpdated      = false;
            deletingFilesList = new List <UploadedFile>();
            relatedFiles      = new BindingList <UploadedFile>();
            contactsList      = new BindingList <ContactPerson>();
            deletingContacts  = new List <ContactPerson>();

            contactsTable.RowsAdded += (sender, e) => DataGridViewHelper.CalculateNewRowNumber(contactsTable, 0, e.RowIndex, e.RowCount);
            DataGridViewHelper.ConfigureFileTable(filesTable, relatedFiles, deletingFilesList, linkLabel5, linkLabel4, linkLabel3);

            contactsTable.AutoGenerateColumns = false;
            contactsTable.DataSource          = contactsList;
            filesTable.DataSource             = relatedFiles;
        }
Ejemplo n.º 3
0
        public ContractsOnDkCodeForm(TenderPlanRecord record, bool isNewSystemSelected)
        {
            InitializeComponent();
            contractsTable.AutoGenerateColumns = false;
            contractsTable.RowsAdded          += (sender, e) => DataGridViewHelper.CalculateNewRowNumber(contractsTable, 0, e.RowIndex, e.RowCount);

            using (TenderContext tc = new TenderContext())
            {
                tc.TenderPlanRecords.Attach(record);
                estimateNameLabel.Text = record.Estimate.Name;
                dkCodeLabel.Text       = record.Dk.FullName;

                List <ContractsTableEntry> tableEntries = new List <ContractsTableEntry>();

                if (isNewSystemSelected)
                {
                    kekvLabel.Text = record.PrimaryKekv.Code;
                }
                else
                {
                    kekvLabel.Text = record.SecondaryKekv.Code + "(по старой системе)";
                }

                tableEntries = (from rec in tc.Contracts.ToList()
                                where (rec.TenderPlanRecordId == record.Id)
                                orderby rec.SignDate descending
                                select new ContractsTableEntry
                {
                    ContractDate = rec.SignDate,
                    ContractNum = rec.Number,
                    Contractor = rec.Contractor,
                    Description = rec.Description,
                    FullSum = rec.Sum,
                    RelatedContract = rec,
                    UsedSum = rec.UsedMoney
                }).ToList();

                contractsTable.DataSource = tableEntries;
            }
        }
Ejemplo n.º 4
0
        public DkCodesListForm()
        {
            InitializeComponent();

            if (UserSession.IsAuthorized)
            {
                dkCodesTable.CellDoubleClick += dkCodesTable_CellDoubleClick;
            }
            else
            {
                linkLabel1.Visible = linkLabel2.Visible = false;
            }

            wasDbUpdated = false;

            dkCodesTable.RowsAdded += (sender, e) => DataGridViewHelper.CalculateNewRowNumber(dkCodesTable, 0, e.RowIndex, e.RowCount);

            using (TenderContext tc = new TenderContext())
            {
                dkCodesTable.AutoGenerateColumns = false;
                codesList = new BindingList <DkCode>(tc.DkCodes.OrderBy(p => p.Code).ToList());
                dkCodesTable.DataSource = codesList;
            }
        }
Ejemplo n.º 5
0
 private void estimateTable_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     DataGridViewHelper.CalculateNewRowNumber(sender as DataGridView, 0, e.RowIndex, e.RowCount);
 }