コード例 #1
0
        //БП необходимость согласования
        public void NeedApproval(Guid cardId)
        {
            //DvConnection.ObjectContext.GetObject<Document>(cardId);
            Document          document        = DvConnection.ObjectContext.GetObject <Document>(cardId);
            var               cardKind        = document.SystemInfo.CardKind;
            var               result          = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0])["ВидДокумента"]);
            var               subKindDocument = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0]).GetGuid("ВидДокумента"));
            BaseUniversalItem itemCard        = DvConnection.ObjectContext.GetObject <BaseUniversalItem>(subKindDocument);
            //сотрудники
            IEnumerable <StaffEmployee> adminSave = GetEmployeesFromGroup("КЗ", "Администратор безопасности");
            //Директор по правовым вопросам
            IEnumerable <StaffEmployee> directorLegal = GetEmployeesFromGroup("КЗ", "Директор по правовым вопросам");
            //Начальник Отдела мотив. и орган. труда(КЗ)
            IEnumerable <StaffEmployee> headDepartMotivation = GetEmployeesFromGroup("КЗ", "Начальник Отдела мотив. и орган. труда(КЗ)");
            //Директор Корпоративного университета
            IEnumerable <StaffEmployee> directorUniver = GetEmployeesFromGroup("КЗ", "Директор Корпоративного университета");
            //Начальник управления по внутреннему аудиту
            IEnumerable <StaffEmployee> headDepartAudit = GetEmployeesFromGroup("КЗ", "Начальник управления по внутреннему аудиту");

            //
            //Начальник БК
            IEnumerable <StaffEmployee> headDepartBk = GetEmployeesFromGroup("КЗ", "Начальник БК");
            //Начальник ОК(КЗ)
            IEnumerable <StaffEmployee> headDepartOk = FindGroup("Договоры", "Начальник ОК(КЗ)");
            //Начальник расчет. отдела(КЗ)   Начальник расчет. отдела(КЗ)
            IEnumerable <StaffEmployee> headDepartCalculate = GetEmployeesFromGroup("КЗ", "Начальник расчет. отдела(КЗ)");

            //StaffEmployee adminSaveFirst = GetEmployeesFromGroup("КЗ", "Начальник расчет. отдела(КЗ)").FirstOrDefault();


            //if == Внутренние Кз and Информа справоч and ВидДокумента='%Заявка%'
            if (dictionaryRequest.ContainsKey(itemCard.GetObjectId()))
            {
            }
        }
コード例 #2
0
 public void Get(Guid cardId)
 {
     DvConnection.ObjectContext.GetObject <Document>(cardId);
     Document          document        = DvConnection.ObjectContext.GetObject <Document>(cardId);
     var               result          = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0])["ВидДокумента"]);
     var               subKindDocument = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0]).GetGuid("ВидДокумента"));
     BaseUniversalItem item            = DvConnection.ObjectContext.GetObject <BaseUniversalItem>(subKindDocument);
 }
コード例 #3
0
        /// <summary>
        /// Конструктор формы заполнения журнала условий калибровки.
        /// </summary>
        /// <param name="Session">Пользовательская сессия DV.</param>
        /// <param name="Context">Объектный контекст.</param>
        /// <param name="JournalItemType">Тип справочника.</param>
        /// <param name="CabinetNumber">Номер кабинета.</param>
        public JournalForm(UserSession Session, ObjectContext Context, BaseUniversalItemType JournalItemType, Int32 CabinetNumber)
        {
            InitializeComponent();
            this.Session = Session;
            this.Context = Context;
            IBaseUniversalService baseUniversalService = Context.GetService <IBaseUniversalService>();

            this.CabinetNumber = CabinetNumber;

            staffEmployee = Context.GetCurrentEmployee();
            BaseUniversalItem NewItem = baseUniversalService.AddNewItem(JournalItemType);

            NewItem.Name     = "Каб. №" + CabinetNumber + ". Условия на " + DateTime.Today.ToShortDateString();
            this.Text        = "Каб. №" + (CabinetNumber == 237 ? 226 : 228) + ". Условия на " + DateTime.Today.ToShortDateString();
            itemCard         = baseUniversalService.OpenOrCreateItemCard(NewItem);
            NewItem.ItemCard = itemCard;
            Context.AcceptChanges();
            this.Date.DateTime = DateTime.Today;
            this.Employee.Text = staffEmployee.DisplayString;
        }
コード例 #4
0
        public void Execute(ProcessInfo process, PassState passInfo, DocsVision.Platform.ObjectModel.ObjectContext objectContext)
        {
            try
            {
                #region Переменный БП
                ProcessVariable doc    = process.GetVariableByName("Документ");
                DVCard          _doc   = (DVCard)doc.Value;
                Guid            idCard = new Guid(_doc.ID);

                ProcessVariable listEmploeesApproval = process.GetVariableByName("Согласующие лица");
                var             c = listEmploeesApproval.Values.Values;
                #endregion
                Document          document        = objectContext.GetObject <Document>(idCard);
                var               cardKind        = document.SystemInfo.CardKind;
                var               result          = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0])["ВидДокумента"]);
                var               subKindDocument = (((BaseCardSectionRow)document.GetSection(new Guid("{B13955FD-3202-44D1-92BD-6B0F6878385F}"))[0]).GetGuid("ВидДокумента"));
                BaseUniversalItem itemCard        = objectContext.GetObject <BaseUniversalItem>(subKindDocument);
            }
            catch (Exception ex)
            {
                process.LogMessage("Ошибка выполнения скрипта:" + ex.Message);
            }
            return;
        }
コード例 #5
0
        /// <summary>
        /// Конструктор формы заполнения журнала условий калибровки.
        /// </summary>
        /// <param name="Session">Пользовательская сессия DV.</param>
        /// <param name="Context">Объектный контекст.</param>
        /// <param name="JournalItemType">Тип справочника.</param>
        /// <param name="CurrentItem">Текущая строка справочника.</param>
        /// <param name="CabinetNumber">Номер кабинета.</param>
        public JournalForm(UserSession Session, ObjectContext Context, BaseUniversalItemType JournalItemType, BaseUniversalItem CurrentItem, Int32 CabinetNumber)
        {
            InitializeComponent();
            this.Session = Session;
            this.Context = Context;
            IBaseUniversalService baseUniversalService = Context.GetService <IBaseUniversalService>();

            staffEmployee = Context.GetCurrentEmployee();
            itemCard      = baseUniversalService.OpenOrCreateItemCard(CurrentItem);
            CardData    itemCardData = Session.CardManager.GetCardData(Context.GetObjectRef <BaseUniversalItemCard>(itemCard).Id);
            SectionData CalibrationConditionsSection = itemCardData.Sections[itemCardData.Type.Sections["CalibrationConditions"].Id];
            RowData     CalibrationConditionsRow     = CalibrationConditionsSection.FirstRow;

            this.Text          = "Каб. №" + (CabinetNumber == 237 ? 226 : 228) + ". Условия на " + DateTime.Today.ToShortDateString();
            this.Date.DateTime = (DateTime?)CalibrationConditionsRow.GetDateTime("Date") ?? DateTime.Today;
            this.Employee.Text = CalibrationConditionsRow.GetString("Employee") != null?Context.GetEmployeeDisplay(new Guid(CalibrationConditionsRow.GetString("Employee"))) : staffEmployee.DisplayString;

            this.Temperature.Value = (decimal?)CalibrationConditionsRow.GetDecimal("Temperature") ?? 0;
            this.Humidity.Value    = (decimal?)CalibrationConditionsRow.GetDecimal("Humidity") ?? 0;
            this.Pressure.Value    = (decimal?)CalibrationConditionsRow.GetDecimal("Pressure") ?? 0;
        }