Пример #1
0
        public frmCarsTasksEdit(int?_nCarTaskID, bool _isCopy)
        {
            isCopy = _isCopy;

            nUserID = ((RFMFormMain)Application.OpenForms[0]).UserInfo.UserID;

            if (_nCarTaskID.HasValue)
            {
                nCarTaskID = (int)_nCarTaskID;
            }

            oCarTask = new CarTask();
            if (oCarTask.ErrorNumber != 0)
            {
                IsValid = false;
            }

            if (IsValid)
            {
                oPartner     = new Partner();
                oZone        = new Zone();
                oCarTaskUnit = new CarTaskUnit();
                if (oPartner.ErrorNumber != 0 || oZone.ErrorNumber != 0 || oCarTaskUnit.ErrorNumber != 0)
                {
                    IsValid = false;
                }
            }

            if (IsValid)
            {
                InitializeComponent();
            }
        }
Пример #2
0
        private void frmTripsCostAmountEdit_Load(object sender, EventArgs e)
        {
            CarTaskUnit ctUnit = new CarTaskUnit();

            if (!ctUnit.FillData())
            {
                Dispose();
                return;
            }
            dtUnits = ctUnit.MainTable;

            dgvcCarTskUnitID.DataSource       = dtUnits;
            dgvcCarTskUnitID.DisplayMember    = "Name";
            dgvcCarTskUnitID.ValueMember      = "ID";
            dgvcCarTskUnitID.DataPropertyName = "CarTaskUnitID";

            // назначение суммировани¤ на колонки
            foreach (Control ctrl in Controls)
            {
                Utilities.ctrl_AgrTypeSet(ctrl);
            }
            dgvcTaskInnerCost.AgrType      =
                dgvcTaskOuterCost.AgrType  =
                    dgvcTaskAmount.AgrType =
                        dgvcBrutto.AgrType =
                            EnumAgregate.Sum;
            dgvJobs.IsStatusShow = true;

            if (dgvJobs.Rows.Count > 0)
            {
                dgvJobs.CurrentCell = dgvJobs.Rows[0].Cells[0];
            }

            if (!dgvTrips_Restore())
            {
                Dispose();
                return;
            }
        }