Exemplo n.º 1
0
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_xcsScript">The install script.</param>
		/// <param name="p_hifHeaderInfo">Information describing the form header.</param>
		/// <param name="p_csmStateManager">The install state manager.</param>
		/// <param name="p_lstInstallSteps">The install steps.</param>
		public OptionsForm(XmlScript p_xcsScript, HeaderInfo p_hifHeaderInfo, ConditionStateManager p_csmStateManager, IList<InstallStep> p_lstInstallSteps)
		{
			m_xcsScript = p_xcsScript;
			m_csmStateManager = p_csmStateManager;
			InitializeComponent();
			hplTitle.Text = p_hifHeaderInfo.Title;
			hplTitle.Image = p_hifHeaderInfo.ShowImage ? p_csmStateManager.GetImage(p_hifHeaderInfo.ImagePath) : null;
			hplTitle.ShowFade = p_hifHeaderInfo.ShowFade;
			hplTitle.ForeColor = p_hifHeaderInfo.TextColour;
			hplTitle.TextPosition = p_hifHeaderInfo.TextPosition;
			if (p_hifHeaderInfo.Height > hplTitle.Height)
				hplTitle.Height = p_hifHeaderInfo.Height;

			foreach (InstallStep stpStep in p_lstInstallSteps)
			{
				OptionFormStep ofsStep = new OptionFormStep(m_csmStateManager, stpStep.OptionGroups);
				ofsStep.Dock = DockStyle.Fill;
				ofsStep.Visible = false;
				ofsStep.ItemChecked += new EventHandler(ofsStep_ItemChecked);
				pnlWizardSteps.Controls.Add(ofsStep);
				m_lstInstallSteps.Add(new KeyValuePair<InstallStep, OptionFormStep>(stpStep, ofsStep));
			}
			m_intCurrentStep = -1;
			StepForward();
		}
Exemplo n.º 2
0
 void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<DoubleBitBinary>> values)
 {
     foreach (var pair in values)
     {
         Print(pair.Value, pair.Index);
     }
 }
Exemplo n.º 3
0
		public HeaderInfoVM(HeaderInfo p_hdrHeader)
		{
			if (p_hdrHeader.Height < 0)
				p_hdrHeader.Height = 0;
			else if (p_hdrHeader.Height > 1000)
				p_hdrHeader.Height = 1000;
			HeaderInfo = p_hdrHeader;
			Reset();
		}
Exemplo n.º 4
0
 public override void loadobjectheader(HeaderInfo hi, BinaryReader br)
 {
     loadedformat = hi.loadedformat;
     name = hi.name;
     forsavingformat = hi.forsavingformat;
     offset = hi.offset;
     size = hi.size;
     headersize = hi.headersize;
     size = br.ReadInt32();
 }
Exemplo n.º 5
0
        // GET api/HeaderInfo
        public HeaderInfo Get(string userId)
        {
            BeerDrinkinContext context = new BeerDrinkinContext();
                         
            var headerInfo = new HeaderInfo { Username = userId };
            var checkIns = context.CheckInItems.Where(f => f.CheckedInBy == userId);
            var photos = context.BinaryItems.Where(f => f.UserId == userId);

            headerInfo.CheckIns = checkIns.Count(f => f.Deleted == false);
            headerInfo.Photos = photos.Count(f => f.Deleted == false);
            headerInfo.Ratings = checkIns.Count(f => f.Rating > 0);
            return headerInfo;
        }
Exemplo n.º 6
0
 private void ReadHeaderV1()
 {
     header = new HeaderInfo();
     header.flags = reader.ReadUInt32S();
     header.compression = reader.ReadUInt32S();
     header.hunkSize = reader.ReadUInt32S();
     header.totalHunks = reader.ReadUInt32S();
     header.cylinders = reader.ReadUInt32S();
     header.heads = reader.ReadUInt32S();
     header.sectors = reader.ReadUInt32S();
     header.md5 = reader.ReadMD5S();
     header.parentmd5 = reader.ReadMD5S();
     header.seclen = 512;
     dataLength = header.totalHunks * (header.hunkSize * 512);
     hunkSize = header.hunkSize * 512;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Mounts a possible TrueCrypt volume by using the given header.
        /// </summary>
        /// <param name="headerInfo">The TrueCrypt header information which describes the TrueCrypt volume to be mounted.</param>
        /// <param name="useBackupHeader">True if the embedded backup header of the volume should be used, otherwise false.</param>
        private void Mount(HeaderInfo headerInfo, bool useBackupHeader)
        {
            /*long diskStartOffset = (useBackupHeader) ? headerInfo.BackupStart : headerInfo.NormalStart;
            long diskEndOffset = (useBackupHeader) ? headerInfo.BackupEnd : headerInfo.NormalEnd;
            long diskLength = diskEndOffset - diskStartOffset;
            TrueCrypt.Password pwd = context.Password;

            try
            {
                int dosDriveNo = TrueCrypt.Mount(pwd, useBackupHeader, context.Drive.DriveNumber, diskStartOffset, diskLength);
                MessageBox.Show(this, string.Format("Successfully mounted the volume as drive \"{0}:\\\"", Char.ToString((char)('A' + dosDriveNo))), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (TrueCrypt.TrueCryptException ex)
            {
                MessageBox.Show(this, string.Format("Unable to mount the volume: {0}", ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }*/
        }
Exemplo n.º 8
0
        void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<Analog>> values)
        {
            DateTime utcNow = DateTime.UtcNow;
            DateTime localNow = DateTime.Now;

            foreach (var pair in values)
            {
                Print(pair.Value, pair.Index);
                foreach (var pv in _scadaDev.Dnp.Analog_input_points)
                {
                    if (pv.Pindex+1 == pair.Index)
                    {
                        pv.Pvalue = pair.Value.Value;
                        pv.Last_updated_tstamp = utcNow.ToString() + ", " + utcNow.Kind;

                    }
                }
            }
        }
Exemplo n.º 9
0
 private static uint getBitRate(HeaderInfo Header)
 {
     return(Header.BitRate);
 }
Exemplo n.º 10
0
        void ISOEHandler.OnReceiveHeader(HeaderInfo info, IEnumerable <IndexedValue <FrozenCounter> > values)
        {
            var converted = values.Select(m => m.Value.ToMeasurement(m.Index, info.tsmode));

            frozenCounters.Update(converted);
        }
Exemplo n.º 11
0
        void ISOEHandler.OnReceiveHeader(HeaderInfo info, IEnumerable <IndexedValue <OctetString> > values)
        {
            var converted = values.Select(m => m.Value.ToMeasurement(m.Index, info.tsmode));

            octetStrings.Update(converted);
        }
Exemplo n.º 12
0
        public ActionResult GetDateEndInfoListss([DataSourceRequest] DataSourceRequest request, Hre_VisaInfoSearchModel Model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateEnd ?? DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo ?? DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };

            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_VisaInfoModel(),
                    FileName = "Hre_VisaInfoModel",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            var service = new ActionService(UserLogin);
            List<object> listObj = new List<object>();
            listObj.Add(Model.DateEnd);
            listObj.Add(Model.DateTo);
            listObj.Add(null);
            listObj.Add(null);
            string status = string.Empty;
            var result = service.GetData<Hre_VisaInfoEntity>(listObj, ConstantSql.hrm_hr_sp_get_VisaInfoDateEndList, ref status).ToList().Translate<Hre_VisaInfoModel>();
            var lstprofileids = result.Select(s => s.Visa_ID).ToList();

            foreach (var item in result)
            {
                Guid profileID = item.Visa_ID;
                // item.Visa_ID. = result.Count(s => s.Visa_ID == profileID);
            }


            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, result, listHeaderInfo, Model.ExportType);
                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 13
0
 public SecurityUserRole(HeaderInfo headerInfo)
 {
     _headerInfo = headerInfo;
 }
		/// <summary>
		/// Gets the editor to use to edit <see cref="HeaderInfo"/>.
		/// </summary>
		/// <param name="p_hdrHeader">The header to edit.</param>
		/// <param name="p_lstModFiles">The list of files in the mod to which the <see cref="XmlScript"/>
		/// being edited belongs.</param>
		/// <returns>The editor to use to edit <see cref="HeaderInfo"/>. <c>null</c> is returned if the
		/// current <see cref="XmlScript"/> does not support editing the <see cref="HeaderInfo"/>.</returns>
		public virtual NodeEditor GetHeaderEditor(HeaderInfo p_hdrHeader, IList<VirtualFileSystemItem> p_lstModFiles)
		{
			HeaderEditorVM vmlHeaderEditor = new HeaderEditorVM(p_hdrHeader, p_lstModFiles, HeaderProperties.Title | HeaderProperties.TextColour | HeaderProperties.TextPosition | HeaderProperties.Image | HeaderProperties.Height);
			return new HeaderEditor(vmlHeaderEditor);
		}
Exemplo n.º 15
0
            public void Process(HeaderInfo info, IEnumerable <IndexedValue <Binary> > values)
            {
                var base_group = 1;
                var group      = 1;
                var variation  = 0;

                switch (info.variation)
                {
                case GroupVariation.Group1Var0:
                    group     = 1;
                    variation = 0;
                    break;

                case GroupVariation.Group1Var1:
                    group     = 1;
                    variation = 1;
                    break;

                case GroupVariation.Group1Var2:
                    group     = 1;
                    variation = 2;
                    break;

                case GroupVariation.Group2Var0:
                    group     = 2;
                    variation = 0;
                    break;

                case GroupVariation.Group2Var1:
                    group     = 2;
                    variation = 1;
                    break;

                case GroupVariation.Group2Var2:
                    group     = 2;
                    variation = 2;
                    break;

                case GroupVariation.Group2Var3:
                    group     = 2;
                    variation = 3;
                    break;
                }
                foreach (var idxvalue in values)
                {
                    var DNP3_Value = new DNP3_Value
                    {
                        address            = idxvalue.Index,
                        base_group         = base_group,
                        group              = group,
                        variation          = variation,
                        value              = idxvalue.Value.Value ? 1 : 0,
                        valueBSON          = new BsonDocumentWrapper(idxvalue.Value),
                        valueString        = idxvalue.Value.ToString(),
                        cot                = info.isEvent ? 3 : 20,
                        serverTimestamp    = DateTime.Now,
                        hasSourceTimestamp = (idxvalue.Value.Timestamp.ToEpoch() != 0),
                        sourceTimestamp    = idxvalue.Value.Timestamp.Value.Date,
                        timeStampQuality   = idxvalue.Value.Timestamp.Quality,
                        qOnline            = idxvalue.Value.Quality.IsSet(BinaryQuality.ONLINE),
                        qRestart           = idxvalue.Value.Quality.IsSet(BinaryQuality.RESTART),
                        qCommLost          = idxvalue.Value.Quality.IsSet(BinaryQuality.COMM_LOST),
                        qRemoteForced      = idxvalue.Value.Quality.IsSet(BinaryQuality.REMOTE_FORCED),
                        qLocalForced       = idxvalue.Value.Quality.IsSet(BinaryQuality.LOCAL_FORCED),
                        qOverrange         = false,
                        qRollover          = false,
                        qDiscontinuity     = false,
                        qReferenceError    = false,
                        qTransient         = false,
                        conn_number        = ConnectionNumber
                    };
                    DNP3DataQueue.Enqueue(DNP3_Value);
                    if (LogLevel >= LogLevelDetailed)
                    {
                        Log(ConnectionName + ": Binary, Ind: " + idxvalue.Index + " " + idxvalue.Value.ToString(), LogLevelDetailed);
                    }
                }
            }
Exemplo n.º 16
0
        public ActionResult GetReportProfileComeBack([DataSourceRequest] DataSourceRequest request, Hre_ReportProfileComeBackModel Model)
        {
            string status = string.Empty;
            var actionServices = new ActionService(UserLogin);
            var contractServices = new Hre_ContractServices();
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateFrom };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };

            #region Validate
            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportProfileComeBackModel>(Model, "Hre_ReportProfileComeBack", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            #endregion
            List<object> lstpara = new List<object>();
            lstpara.Add(Model.DateFrom);
            lstpara.Add(Model.DateTo);
            lstpara.Add(Model.OrgStructureIDs);
            lstpara.Add(Model.ProfileName);
            lstpara.Add(Model.CodeEmp);
            lstpara.Add(Model.RankID);
            lstpara.Add(Model.WorkPlaceID);
            var result = actionServices.GetData<Hre_ReportProfileComeBackModel>(lstpara, ConstantSql.hrm_hr_sp_get_RptProfileComBack, ref status);

            var lstResultEntity = result.Translate<Hre_ReportProfileComeBackEntity>();

            var dataResult = contractServices.GetDataContractByProfileID(lstResultEntity, UserLogin);

            var isDataTable = false;
            DataTable obj = null;
            if (Model.IsCreateTemplateForDynamicGrid)
            {
                obj = dataResult;
                isDataTable = true;
            }


            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Hre_ReportProfileComeBackEntity",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = true
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, dataResult, listHeaderInfo, Model.ExportType);
                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 17
0
        public ActionResult GetReportHCSales([DataSourceRequest] DataSourceRequest request, Hre_ReportHCSalesModel model)
        {
            var service = new Hre_ReportServices();
            var eva_Service = new Eva_ReportServices();
            var hrService = new Hre_ProfileServices();

            //List<object> listObj = new List<object>();
            //listObj.Add(model.OrgStructureID);
            //listObj.Add(string.Empty);
            //listObj.Add(string.Empty);

            //string status = string.Empty;

            //var listEntity = hrService.GetData<Hre_ProfileIdEntity>(listObj, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrgStructure, ref status).Select(s => s.ID).ToList();

            var result = eva_Service.GetReportHCSales(model.dateSearch, model.OrgStructureID, model.IsCreateTemplate, UserLogin);
            //var rs = result.Translate<Hre_ReportMonthlyHCModel>();

            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            object obj = new Hre_ReportHCSalesModel();
            var isDataTable = false;
            if (model.IsCreateTemplateForDynamicGrid)
            {
                var col = result.Columns.Count;
                result.Columns.RemoveAt(col - 1);
                obj = result;
                isDataTable = true;
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Hre_ReportHCSalesModel",
                    OutPutPath = path,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportID != Guid.Empty)
            {
                //var row = result.Rows.Count;
                // result.Rows[row - 1].Delete();
                var col = result.Columns.Count;
                result.Columns.RemoveAt(col - 1);

                var fullPath = ExportService.Export(model.ExportID, result, listHeaderInfo, model.ExportType);

                return Json(fullPath);
            }
            //0string dataReturn = result.ConvertDataTabletoString();
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 18
0
        public ActionResult GetDateEndAccidentTypeList([DataSourceRequest] DataSourceRequest request, Hre_AccidentModel model)
        {
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_AccidentModel>(model, "Hre_ReportAccident", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            //DateTime From = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            //DateTime To = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);

            #endregion
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = model.DateFrom != null ? model.DateFrom.Value : DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = model.DateTo != null ? model.DateTo.Value : DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            var service = new ActionService(UserLogin);

            List<object> listObj = new List<object>();
            DateTime? From = SqlDateTime.MinValue.Value;
            DateTime? To = SqlDateTime.MaxValue.Value;
            List<Guid?> OrgIds = new List<Guid?>();
            if (model.DateFrom != null)
            {
                From = model.DateFrom.Value;
            }
            if (model.DateTo != null)
            {
                To = model.DateTo.Value;
            }
            listObj.Add(From);
            listObj.Add(To);
            string strOrgIDs = null;
            if (!string.IsNullOrEmpty(model.OrgStructureID))
            {
                strOrgIDs = model.OrgStructureID;
            }
            listObj.Add(strOrgIDs);
            Guid? Acctype = Guid.Empty;
            if (model.AccidentTypeID != Guid.Empty)
            {
                Acctype = model.AccidentTypeID;
            }
            listObj.Add(Acctype);
            string status = string.Empty;
            var result = service.GetData<Hre_AccidentEntity>(listObj, ConstantSql.hrm_hr_sp_get_DateEndAccidentTypeList, ref status).ToList().Translate<Hre_AccidentModel>();
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_AccidentModel(),
                    FileName = "Hre_ReportAccident",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            if (model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportID, result, listHeaderInfo, model.ExportType);

                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
            //return GetListDataAndReturn<Hre_AccidentModel, Hre_AccidentEntity, Hre_ReportAccidentSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_DateEndAccidentTypeList);
        }
Exemplo n.º 19
0
        //public ActionResult CreateTemplate(CreateTemplateModel model)
        //{
        //    if (model != null)
        //    {
        //        var service = new BaseService();
        //        Cat_ExportEntity exportEntity = new Cat_ExportEntity()
        //        {
        //            ExportName = model.TemplateName,
        //            IsColumnDynamic = model.IsDynamic,
        //            ScreenName = model.ScreenName,
        //            TemplateFile = model.TemplateFile
        //        };

        //        service.Add(exportEntity);
        //    }
        //    return Json("");
        //}
        public ActionResult GetReportHCGender([DataSourceRequest] DataSourceRequest request, Hre_ReportHCGenderModel model)
        {
            var service = new Hre_ReportServices();
            var hrService = new Hre_ProfileServices();
            object obj = new Hre_ReportHCGenderModel();
            var isDataTable = false;
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            var result = service.GetReportHCGender(model.MonthSearch, model.JobtitleID, model.OrgStructureID, model.OrgStructureTypeID, model.Gender, model.isIncludeQuitEmp, model.IsCreateTemplate, UserLogin);

            if (model.IsCreateTemplateForDynamicGrid)
            {
                var col = result.Columns.Count;
                result.Columns.RemoveAt(col - 1);
                obj = result;
                isDataTable = true;
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Hre_ReportHCGenderModel",
                    OutPutPath = path,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (model.ExportID != Guid.Empty)
            {
                result.Rows[0].Delete();
                var col = result.Columns.Count;
                result.Columns.RemoveAt(col - 1);
                //  var row = result.Rows.Count;
                //    result.Rows[row - 1].Delete();

                string[] valueField = null;
                if (model.ValueFields != null)
                {
                    valueField = model.ValueFields.Split(',');
                }
                var fullPath = ExportService.Export(model.ExportID, result, listHeaderInfo, model.ExportType);

                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 20
0
        public ActionResult GetReportSeniority([DataSourceRequest] DataSourceRequest request, Hre_ReportSeniorityModel Model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateSeniority != null ? Model.DateSeniority.Value : DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1 };
            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportSeniorityModel(),
                    FileName = "Hre_ReportSeniority",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportSeniorityModel>(Model, "Hre_ReportSeniority", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }

            #endregion
            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);

            DateTime DateSeniority = DateTime.Now;
            List<Guid?> OrgIds = new List<Guid?>();
            if (Model.DateSeniority != null)
            {
                DateSeniority = Model.DateSeniority.Value;
            }

            string strOrgIDs = null;
            if (!string.IsNullOrEmpty(Model.OrgStructureID))
            {
                strOrgIDs = Model.OrgStructureID;
            }
            List<object> listObj = new List<object>();
            listObj.Add(strOrgIDs);
            listObj.Add(string.Empty);
            listObj.Add(string.Empty);

            string status = string.Empty;
            var listEntity = actionServices.GetData<Hre_ProfileEntity>(listObj, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrgStructure, ref status).ToList();
            if (listEntity.Count == 0)
            {
                return Json(null);
            }
            var result = service.GetReportSeniority(DateSeniority, listEntity).ToList().Translate<Hre_ReportSeniorityModel>();

            if (Model.ExportID != Guid.Empty)
            {
                string[] valueField = null;
                if (Model.ValueFields != null)
                {
                    valueField = Model.ValueFields.Split(',');
                }
                var fullPath = ExportService.Export(Model.ExportID, result, listHeaderInfo, Model.ExportType);

                return Json(fullPath);
            }


            return Json(result.ToDataSourceResult(request));

        }
Exemplo n.º 21
0
        public ActionResult GetReportReward([DataSourceRequest] DataSourceRequest request, Hre_ReportRewardModel Model)
        {
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportRewardModel>(Model, "Hre_ReportReward", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }

            #endregion
            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);
            var isDataTable = false;
            object obj = new Hre_ReportRewardModel();
            List<object> listObj = new List<object>();
            DateTime From = SqlDateTime.MinValue.Value;
            DateTime To = SqlDateTime.MaxValue.Value;
            List<Guid?> OrgIds = new List<Guid?>();
            if (Model.DateFrom != null)
            {
                From = Model.DateFrom.Value;
                listObj.Add(From);
            }
            else
            {
                listObj.Add(null);
            }
            if (Model.DateTo != null)
            {
                To = Model.DateTo.Value;
                listObj.Add(To);
            }
            else
            {
                listObj.Add(null);
            }

            string strOrgIDs = null;
            if (!string.IsNullOrEmpty(Model.OrgStructureID))
            {
                strOrgIDs = Model.OrgStructureID;
            }

            listObj.Add(strOrgIDs);


            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = From };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = To };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };

            string status = string.Empty;
            var result = actionServices.GetData<Hre_ReportRewardEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptReward, ref status).ToList().Translate<Hre_ReportRewardModel>();

            if (Model.IsCreateTemplateForDynamicGrid)
            {
                obj = result;
                isDataTable = true;
            }
            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Hre_ReportReward",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }

            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, result, listHeaderInfo, Model.ExportType);

                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 22
0
        public ActionResult GetReportProfileDiscipline([DataSourceRequest] DataSourceRequest request, Hre_ReportProfileDisciplineModel Model)
        {
            #region Code cũ
            //var service = new Hre_ReportServices();
            //var hrService = new Hre_ProfileServices();
            //var isDataTable = false;
            //object obj = new Hre_ReportProfileDisciplineModel();
            //List<object> listObj = new List<object>();
            //DateTime From = SqlDateTime.MinValue.Value;
            //DateTime To = SqlDateTime.MaxValue.Value;
            //List<Guid?> OrgIds = new List<Guid?>();
            //if (Model.DateFrom != null)
            //{
            //    From = Model.DateFrom.Value;
            //    listObj.Add(From);
            //}
            //else
            //{
            //    listObj.Add(null);
            //}
            //if (Model.DateTo != null)
            //{
            //    To = Model.DateTo.Value;
            //    listObj.Add(To);
            //}
            //else
            //{
            //    listObj.Add(null);
            //}

            //string strOrgIDs = null;
            //if (!string.IsNullOrEmpty(Model.OrgStructureID))
            //{
            //    strOrgIDs = Model.OrgStructureID;
            //}

            //listObj.Add(strOrgIDs);


            //string status = string.Empty;
            //var result = hrService.GetData<Hre_ReportProfileDisciplineEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptDiscripline, ref status).ToList().Translate<Hre_ReportProfileDisciplineModel>();

            //if (Model.IsCreateTemplateForDynamicGrid)
            //{
            //    obj = result;
            //    isDataTable = true;
            //}
            //if (Model != null && Model.IsCreateTemplate)
            //{
            //    var path = Common.GetPath("Templates");
            //    ExportService exportService = new ExportService();
            //    ConfigExport cfgExport = new ConfigExport()
            //    {
            //        Object = obj,
            //        FileName = "Hre_ReportProfileDisciplineModel",
            //        OutPutPath = path,
            //        DownloadPath = Hrm_Main_Web + "Templates",
            //        IsDataTable = isDataTable
            //    };
            //    var str = exportService.CreateTemplate(cfgExport);
            //    return Json(str);
            //}

            //if (Model.ExportID != Guid.Empty)
            //{
            //    if (result != null && result.Count > 0)
            //    {
            //        #region lấy Org và OrgType

            //        var orgServices = new Cat_OrgStructureServices();
            //        var lstObjOrg = new List<object>();
            //        lstObjOrg.Add(null);
            //        lstObjOrg.Add(null);
            //        lstObjOrg.Add(null);
            //        lstObjOrg.Add(1);
            //        lstObjOrg.Add(int.MaxValue - 1);
            //        var lstOrg = orgServices.GetData<Cat_OrgStructureEntity>(lstObjOrg, ConstantSql.hrm_cat_sp_get_OrgStructure, ref status).ToList();

            //        var orgTypeService = new Cat_OrgStructureTypeServices();
            //        var lstObjOrgType = new List<object>();
            //        lstObjOrgType.Add(null);
            //        lstObjOrgType.Add(null);
            //        lstObjOrgType.Add(1);
            //        lstObjOrgType.Add(int.MaxValue - 1);
            //        var lstOrgType = orgTypeService.GetData<Cat_OrgStructureTypeEntity>(lstObjOrgType, ConstantSql.hrm_cat_sp_get_OrgStructureType, ref status).ToList();
            //        #endregion

            //        foreach (var item in result)
            //        {
            //            Guid? orgId = item.OrgStructureID1;
            //            var org = lstOrg.FirstOrDefault(s => s.ID == item.OrgStructureID1);
            //            var orgBranch = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_BRANCH, lstOrg, lstOrgType);
            //            var orgGroup = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_GROUP, lstOrg, lstOrgType);
            //            var orgOrg = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_DEPARTMENT, lstOrg, lstOrgType);
            //            var orgTeam = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_TEAM, lstOrg, lstOrgType);
            //            var orgSection = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_SECTION, lstOrg, lstOrgType);
            //            var orgDivision = LibraryService.GetNearestParentEntity(orgId, OrgUnit.E_DIVISION, lstOrg, lstOrgType);

            //            item.BranchName = orgBranch != null ? orgBranch.OrgStructureName : string.Empty;
            //            item.GroupName = orgGroup != null ? orgGroup.OrgStructureName : string.Empty;
            //            item.DepartmentName = orgOrg != null ? orgOrg.OrgStructureName : string.Empty;
            //            item.TeamName = orgTeam != null ? orgTeam.OrgStructureName : string.Empty;
            //            item.SectionName = orgSection != null ? orgSection.OrgStructureName : string.Empty;
            //            item.DivisionName = orgDivision != null ? orgDivision.OrgStructureName : string.Empty;

            //            item.DisciplineCount = result.Where(s => s.ProfileID == item.ProfileID).Count();
            //        }

            //    }
            //    string[] valueField = null;
            //    if (Model.ValueFields != null)
            //    {
            //        valueField = Model.ValueFields.Split(',');
            //    }
            //    var fullPath = ExportService.Export(Model.ExportID, result, null, Model.ExportType);

            //    return Json(fullPath);
            //}
            //return Json(result.ToDataSourceResult(request)); 
            #endregion

            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateFrom ?? DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo ?? DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };

            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportProfileDisciplineModel(),
                    FileName = "Hre_ReportProfileDiscipline",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportProfileDisciplineModel>(Model, "Hre_ReportProfileDiscipline", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            #endregion

            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);
            List<object> listObj = new List<object>();
            listObj.Add(Model.DateFrom);
            listObj.Add(Model.DateTo);
            listObj.Add(Model.OrgStructureID);

            string status = string.Empty;

            var result = actionServices.GetData<Hre_ReportProfileDisciplineEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptDiscripline, ref status).ToList().Translate<Hre_ReportProfileDisciplineModel>();
            var lstprofileids = result.Select(s => s.ProfileID).ToList();

            foreach (var item in result)
            {
                Guid profileID = item.ProfileID;
                item.count = result.Count(s => s.ProfileID == profileID);
            }


            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, result, listHeaderInfo, Model.ExportType);
                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 23
0
        private unsafe void LoadHeaderFiles()
        {
            Library.CXInclusionVisitor callBack =
                delegate(IntPtr fileHandle, Library.SourceLocation* inclusionStack, uint includeStackSize, IntPtr clientData)
                {
                    if (includeStackSize > 0)
                    {
                        List<SourceLocation> locationStack = new List<SourceLocation>();

                        for (uint i = 0; i < includeStackSize; i++)
                        {
                            locationStack.Add(_itemStore.CreateSourceLocation(inclusionStack[i]));
                        }

                        Cursor includeStatement = GetCursorAt(locationStack[0]);

                        HeaderInfo header = new HeaderInfo(Library.clang_getFileName(fileHandle).ManagedString, locationStack);
                        _headerFiles.Add(header);
                    }
                };

            Library.clang_getInclusions(Handle, callBack, IntPtr.Zero);
        }
Exemplo n.º 24
0
        public ActionResult GetReportEducationCharList([DataSourceRequest] DataSourceRequest request, Hre_ReportEducationChartListModel Model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateFrom != null ? Model.DateFrom : DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo != null ? Model.DateTo : DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportEducationChartListModel(),
                    FileName = "Hre_ReportEducationChartList",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportEducationChartListModel>(Model, "Hre_ReportProfileNew", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }
            DateTime From = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
            DateTime To = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);

            #endregion

            if (Model.DateFrom != null)
            {
                From = Model.DateFrom.Value;
            }
            if (Model.DateTo != null)
            {
                To = Model.DateTo.Value;
            }
            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);
            List<object> strOrgIDs = new List<object>();
            strOrgIDs.AddRange(new object[3]);
            strOrgIDs[0] = (object)Model.OrgStructureID;

            string status = string.Empty;
            List<Guid> lstProfileIDs = actionServices.GetData<Hre_ProfileIdEntity>(strOrgIDs, ConstantSql.hrm_hr_sp_get_ProfileIdsByOrg, ref status).Select(s => s.ID).ToList();
            var result = service.GetReportEducationCharList(From, To, lstProfileIDs, Model.AppliedForThisPeriod).ToList().Translate<Hre_ReportEducationChartListModel>();

            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, result, Model.ExportType);

                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));
        }
Exemplo n.º 25
0
        // -----------------------------------------------------
        //    Update Document
        // -----------------------------------------------------
        private int Update(HeaderInfo headerInfo)
        {
            string ret = "Item updated successfully";

            this.UserIdUpdatedBy = Utils.UserID;
            this.UpdateDateTime  = System.DateTime.Now;

            using (var connection = new SqlConnection(ConnString.ConnectionString))
            {
                var commandString =
                    (
                        "UPDATE [Document] " +
                        " SET " +
                        " [CUID] =  @CUID " +
                        ",[Name] =  @Name " +
                        ",[DisplayName] =  @DisplayName " +
                        ",[SequenceNumber] = @SequenceNumber  " +
                        ",[IssueNumber] = @IssueNumber" +
                        ",[Location] = @Location" +
                        ",[Comments] = @Comments " +
                        ",[FileName] = @FileName" +
                        ",[SimpleFileName] = @SimpleFileName" +
                        ",[SourceCode] = @SourceCode " +
                        ",[IsProjectPlan] = @IsProjectPlan " +
                        ",[FKClientUID] = @FKClientUID " +
                        ",[ParentUID] = @ParentUID " +
                        ",[DocumentType] = @DocumentType " +
                        ",[UserIdUpdatedBy] = @UserIdUpdatedBy " +
                        ",[UpdateDateTime] = @UpdateDateTime  " +
                        " WHERE [UID] = @UID "
                    );

                using (var command = new SqlCommand(
                           commandString, connection))
                {
                    command.Parameters.Add("@UID", SqlDbType.VarChar).Value             = UID;
                    command.Parameters.Add("@CUID", SqlDbType.VarChar).Value            = CUID;
                    command.Parameters.Add("@Name", SqlDbType.VarChar).Value            = Name;
                    command.Parameters.Add("@DisplayName", SqlDbType.VarChar).Value     = DisplayName;
                    command.Parameters.Add("@SequenceNumber", SqlDbType.VarChar).Value  = SequenceNumber;
                    command.Parameters.Add("@IssueNumber", SqlDbType.Decimal).Value     = IssueNumber;
                    command.Parameters.Add("@Location", SqlDbType.VarChar).Value        = Location;
                    command.Parameters.Add("@IsProjectPlan", SqlDbType.VarChar).Value   = IsProjectPlan;
                    command.Parameters.Add("@Comments", SqlDbType.VarChar).Value        = Comments;
                    command.Parameters.Add("@FileName", SqlDbType.VarChar).Value        = FileName;
                    command.Parameters.Add("@SimpleFileName", SqlDbType.VarChar).Value  = SimpleFileName;
                    command.Parameters.Add("@SourceCode", SqlDbType.VarChar).Value      = SourceCode;
                    command.Parameters.Add("@FKClientUID", SqlDbType.Int).Value         = FKClientUID;
                    command.Parameters.Add("@ParentUID", SqlDbType.Int).Value           = ParentUID;
                    command.Parameters.Add("@DocumentType", SqlDbType.VarChar).Value    = DocumentType;
                    command.Parameters.Add("@UserIdUpdatedBy", SqlDbType.VarChar).Value = UserIdUpdatedBy;
                    command.Parameters.Add("@UpdateDateTime", SqlDbType.DateTime).Value = UpdateDateTime;

                    connection.Open();

                    try
                    {
                        command.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        LogFile.WriteToTodaysLogFile(
                            "Error updating document." + ex.ToString(),
                            headerInfo.UserID,
                            "Document.cs"
                            );
                    }
                }
            }
            return(this.UID);
        }
Exemplo n.º 26
0
        // -----------------------------------------------------
        //    Add new Client
        // -----------------------------------------------------
        public static ResponseStatus Insert(
            HeaderInfo headerInfo,
            ClientExtraInformation clientExtraInfo,
            SqlConnection connection)
        {
            ResponseStatus response = new ResponseStatus();

            response.ReturnCode = 1;
            response.ReasonCode = 1;
            response.Message    = "Client Added Successfully";

            int _uid = 0;

            int nextUID = GetLastUID() + 1; // 2010100000

            clientExtraInfo.UID = nextUID;
            DateTime _now = DateTime.Today;

            clientExtraInfo.RecordVersion    = 1;
            clientExtraInfo.IsVoid           = "N";
            clientExtraInfo.CreationDateTime = headerInfo.CurrentDateTime;
            clientExtraInfo.UpdateDateTime   = headerInfo.CurrentDateTime;
            clientExtraInfo.UserIdCreatedBy  = headerInfo.UserID;
            clientExtraInfo.UserIdUpdatedBy  = headerInfo.UserID;

            var commandString =
                (
                    "INSERT INTO [ClientExtraInformation] " +
                    "(" +
                    ClientFieldString() +
                    ")" +
                    " VALUES " +
                    "( @UID     " +
                    ", @FKClientUID    " +
                    ", @DateToEnterOnPolicies    " +
                    ", @ScopeOfServices " +
                    ", @ActionPlanDate " +
                    ", @CertificationTargetDate " +
                    ", @TimeTrading " +
                    ", @RegionsOfOperation " +
                    ", @OperationalMeetingsFrequency " +
                    ", @ProjectMeetingsFrequency " +
                    ", @IsVoid " +
                    ", @RecordVersion " +
                    ", @UpdateDateTime " +
                    ", @UserIdUpdatedBy " +
                    ", @CreationDateTime  " +
                    ", @UserIdCreatedBy ) "
                );



            using (var command = new SqlCommand(commandString, connection))
            {
                clientExtraInfo.RecordVersion = 1;
                clientExtraInfo.IsVoid        = "N";
                AddSQLParameters(command, FCMConstant.SQLAction.CREATE, clientExtraInfo);

                if (connection.State != ConnectionState.Open)
                {
                    connection.Open();
                }

                command.ExecuteNonQuery();
            }

            response.Contents = _uid;

            return(response);
        }
Exemplo n.º 27
0
        // ---------------------------------------------------------------------------

        private double GetDuration(HeaderInfo Header)
        {
            // Get duration from header
            return(Math.Abs(((double)Header.FileSize - Swap32((int)(Header.Size >> 16)) - 20)) / 125 /
                   Swap32((int)(Header.BitRate >> 16)));
        }
Exemplo n.º 28
0
		public HeaderEditorVM(HeaderInfo p_hdrHeader, IList<VirtualFileSystemItem> p_lstModFiles, HeaderProperties p_hrpEditableProperties)
		{
			HeaderInfo = p_hdrHeader;
			ModFiles = p_lstModFiles;

			TitleVisible = (p_hrpEditableProperties & HeaderProperties.Title) > 0;
			TextColourVisible = (p_hrpEditableProperties & HeaderProperties.TextColour) > 0;
			TextPositionVisible = (p_hrpEditableProperties & HeaderProperties.TextPosition) > 0;
			ImageVisible = (p_hrpEditableProperties & HeaderProperties.Image) > 0;
			HeightVisible = (p_hrpEditableProperties & HeaderProperties.Height) > 0;

			TextPositions = Enum.GetValues(typeof(TextPosition));
			Errors = new ErrorContainer();
		}
Exemplo n.º 29
0
        public Expando()
            : base()
        {
            this.components = new System.ComponentModel.Container();

            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            this.expandedHeight = 100;

            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            this.collapsed = false;

            this.specialGroup = false;

            this.focusState = FocusStates.None;

            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            this.autoLayout = false;

            this.taskpane = null;

            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }
Exemplo n.º 30
0
        public HeaderInfo BuildHeader(List <FSEntry> entries)
        {
            short numEntries = (short)entries.Count;
            // header + offsets size is 0x10 + ((numFiles + 2) * sizeof(int))
            // TOC size is numFiles * sizeof(TOCEntry)
            MemoryStream tocStream  = new MemoryStream(entries.Count * 0x20);
            BinaryWriter bw         = new BinaryWriter(tocStream);
            short        numOffsets = 2; // 0 = start of file, 1 = toc

            foreach (FSEntry f in entries)
            {
                TocEntry te = f.tocEntry;
                if ((te.flags & TOCFlags_Directory) == 0)
                {
                    te.offsetIndex = numOffsets++; // 2+ = files
                    //++numFiles;
                }
                bw.Write(te.dateTime);
                bw.Write(te.offsetIndex);
                bw.Write(te.flags);
                byte[] name = Encoding.ASCII.GetBytes(f.name);
                Array.Resize(ref name, 25);
                bw.Write(name, 0, 25);
            }
            bw.Flush();
            ++numOffsets; // last one = file size

            HeaderInfo hi = new HeaderInfo();

            MemoryStream header = new MemoryStream(16);

            bw = new BinaryWriter(header);
            bw.Write(Encoding.ASCII.GetBytes("GTFS\0\0\0\0"));
            bw.Write(numOffsets);
            bw.Write(numEntries);
            bw.Write((int)0);
            bw.Flush();
            byte[] headerBuffer = header.GetBuffer();
            Array.Resize(ref headerBuffer, 16);
            hi.header = headerBuffer;

            int[] offsets = new int[numOffsets];
            // first the size of the file header + offset list
            int offsetSectionSize  = 0x10 + (offsets.Length * sizeof(int));
            int offsetToTocPadding = 0x800 - (offsetSectionSize % 0x800);

            // this always starts at file address 0, so the offset portion of the value is always 0
            // leaving just the padding value
            offsets[0] = offsetToTocPadding;
            Debug.Assert((offsets[0] & 0xFFFFF800) == 0);
            Debug.Assert((offsets[0] & 0x7FF) != 0);

            long tocSize    = tocStream.Position;
            long tocPadding = 0x800 - (tocSize % 0x800);

            int tocStartPos = offsetSectionSize + offsetToTocPadding;

            offsets[1] = (tocStartPos | (int)tocPadding);

            hi.offsets = offsets;
            hi.toc     = tocStream;
            hi.fileDataStartPosition = tocStartPos + (int)(tocSize + tocPadding);
            Debug.Assert((hi.fileDataStartPosition & 0x7FF) == 0);
            return(hi);
        }
Exemplo n.º 31
0
        /// <summary>
        /// Gets the editor to use to edit <see cref="HeaderInfo"/>.
        /// </summary>
        /// <param name="p_hdrHeader">The header to edit.</param>
        /// <param name="p_lstModFiles">The list of files in the mod to which the <see cref="XmlScript"/>
        /// being edited belongs.</param>
        /// <returns>The editor to use to edit <see cref="HeaderInfo"/>. <c>null</c> is returned if the
        /// current <see cref="XmlScript"/> does not support editing the <see cref="HeaderInfo"/>.</returns>
        public override NodeEditor GetHeaderEditor(HeaderInfo p_hdrHeader, IList <VirtualFileSystemItem> p_lstModFiles)
        {
            HeaderEditorVM vmlHeaderEditor = new HeaderEditorVM(p_hdrHeader, p_lstModFiles, HeaderProperties.Title | HeaderProperties.TextColour | HeaderProperties.TextPosition | HeaderProperties.Image | HeaderProperties.Height);

            return(new HeaderEditor(vmlHeaderEditor));
        }
Exemplo n.º 32
0
 // Get bit rate from header
 private static UInt32 getBitRate(HeaderInfo Header)
 {
     return(Header.BitRate);
 }
Exemplo n.º 33
0
        void ISOEHandler.OnReceiveHeader(HeaderInfo info, IEnumerable <IndexedValue <DoubleBitBinary> > values)
        {
            var converted = values.Select(m => m.Value.ToMeasurement(m.Index, info.tsmode));

            doubleBinaries.Update(converted);
        }
Exemplo n.º 34
0
 // Get duration from header
 private Double getDuration(HeaderInfo Header)
 {
     return(Math.Abs(sizeInfo.FileSize - Header.Size - 20) * 1000.0 / 125.0 / (Double)Header.BitRate);
 }
Exemplo n.º 35
0
        void ISOEHandler.OnReceiveHeader(HeaderInfo info, IEnumerable <IndexedValue <AnalogOutputStatus> > values)
        {
            var converted = values.Select(m => m.Value.ToMeasurement(m.Index, info.tsmode));

            analogOutputStatii.Update(converted);
        }
        public static object FromStream(Stream stream)
        {
            RandomAccessIO in_stream = new ISRandomAccessIO(stream);

            // Initialize default parameters
            ParameterList defpl = GetDefaultParameterList(decoder_pinfo);

            // Create parameter list using defaults
            ParameterList pl = new ParameterList(defpl);

            // **** File Format ****
            // If the codestream is wrapped in the jp2 fileformat, Read the
            // file format wrapper
            FileFormatReader ff = new FileFormatReader(in_stream);

            ff.readFileFormat();
            if (ff.JP2FFUsed)
            {
                in_stream.seek(ff.FirstCodeStreamPos);
            }

            // +----------------------------+
            // | Instantiate decoding chain |
            // +----------------------------+

            // **** Header decoder ****
            // Instantiate header decoder and read main header
            HeaderInfo    hi = new HeaderInfo();
            HeaderDecoder hd;

            try
            {
                hd = new HeaderDecoder(in_stream, pl, hi);
            }
            catch (EndOfStreamException e)
            {
                throw new InvalidOperationException("Codestream too short or bad header, unable to decode.", e);
            }

            int          nCompCod = hd.NumComps;
            int          nTiles   = hi.sizValue.NumTiles;
            DecoderSpecs decSpec  = hd.DecoderSpecs;

            // Get demixed bitdepths
            int[] depth = new int[nCompCod];
            for (int i = 0; i < nCompCod; i++)
            {
                depth[i] = hd.getOriginalBitDepth(i);
            }

            // **** Bit stream reader ****
            BitstreamReaderAgent breader;

            try
            {
                breader = BitstreamReaderAgent.
                          createInstance(in_stream, hd, pl, decSpec,
                                         false, hi);
            }
            catch (IOException e)
            {
                throw new InvalidOperationException("Error while reading bit stream header or parsing packets.", e);
            }
            catch (ArgumentException e)
            {
                throw new InvalidOperationException("Cannot instantiate bit stream reader.", e);
            }

            // **** Entropy decoder ****
            EntropyDecoder entdec;

            try
            {
                entdec = hd.createEntropyDecoder(breader, pl);
            }
            catch (ArgumentException e)
            {
                throw new InvalidOperationException("Cannot instantiate entropy decoder.", e);
            }

            // **** ROI de-scaler ****
            ROIDeScaler roids;

            try
            {
                roids = hd.createROIDeScaler(entdec, pl, decSpec);
            }
            catch (ArgumentException e)
            {
                throw new InvalidOperationException("Cannot instantiate roi de-scaler.", e);
            }

            // **** Dequantizer ****
            Dequantizer deq;

            try
            {
                deq = hd.createDequantizer(roids, depth, decSpec);
            }
            catch (ArgumentException e)
            {
                throw new InvalidOperationException("Cannot instantiate dequantizer.", e);
            }

            // **** Inverse wavelet transform ***
            InverseWT invWT;

            try
            {
                // full page inverse wavelet transform
                invWT = InverseWT.createInstance(deq, decSpec);
            }
            catch (ArgumentException e)
            {
                throw new InvalidOperationException("Cannot instantiate inverse wavelet transform.", e);
            }

            int res = breader.ImgRes;

            invWT.ImgResLevel = res;

            // **** Data converter **** (after inverse transform module)
            ImgDataConverter converter = new ImgDataConverter(invWT, 0);

            // **** Inverse component transformation ****
            InvCompTransf ictransf = new InvCompTransf(converter, decSpec, depth, pl);

            // **** Color space mapping ****
            BlkImgDataSrc color;

            if (ff.JP2FFUsed && pl.getParameter("nocolorspace").Equals("off"))
            {
                try
                {
                    ColorSpace    csMap      = new ColorSpace(in_stream, hd, pl);
                    BlkImgDataSrc channels   = hd.createChannelDefinitionMapper(ictransf, csMap);
                    BlkImgDataSrc resampled  = hd.createResampler(channels, csMap);
                    BlkImgDataSrc palettized = hd.createPalettizedColorSpaceMapper(resampled, csMap);
                    color = hd.createColorSpaceMapper(palettized, csMap);
                }
                catch (ArgumentException e)
                {
                    throw new InvalidOperationException("Could not instantiate ICC profiler.", e);
                }
                catch (ColorSpaceException e)
                {
                    throw new InvalidOperationException("Error processing ColorSpace information.", e);
                }
            }
            else
            { // Skip colorspace mapping
                color = ictransf;
            }

            // This is the last image in the decoding chain and should be
            // assigned by the last transformation:
            BlkImgDataSrc decodedImage = color;

            if (color == null)
            {
                decodedImage = ictransf;
            }
            int numComps = decodedImage.NumComps;

            int bytesPerPixel = (numComps == 4 ? 4 : 3);

            // **** Copy to Bitmap ****
            var dst = BitmapWrapperFactory.New(decodedImage.ImgWidth, decodedImage.ImgHeight, numComps);

            Coord numTiles = decodedImage.getNumTiles(null);

            int tIdx = 0;

            for (int y = 0; y < numTiles.y; y++)
            {
                // Loop on horizontal tiles
                for (int x = 0; x < numTiles.x; x++, tIdx++)
                {
                    decodedImage.setTile(x, y);

                    int height = decodedImage.getTileCompHeight(tIdx, 0);
                    int width  = decodedImage.getTileCompWidth(tIdx, 0);

                    int tOffx = decodedImage.getCompULX(0) -
                                (int)Math.Ceiling(decodedImage.ImgULX /
                                                  (double)decodedImage.getCompSubsX(0));

                    int tOffy = decodedImage.getCompULY(0) -
                                (int)Math.Ceiling(decodedImage.ImgULY /
                                                  (double)decodedImage.getCompSubsY(0));

                    DataBlkInt[] db = new DataBlkInt[numComps];
                    int[]        ls = new int[numComps];
                    int[]        mv = new int[numComps];
                    int[]        fb = new int[numComps];
                    for (int i = 0; i < numComps; i++)
                    {
                        db[i] = new DataBlkInt();
                        ls[i] = 1 << (decodedImage.getNomRangeBits(0) - 1);
                        mv[i] = (1 << decodedImage.getNomRangeBits(0)) - 1;
                        fb[i] = decodedImage.getFixedPoint(0);
                    }
                    for (int l = 0; l < height; l++)
                    {
                        for (int i = numComps - 1; i >= 0; i--)
                        {
                            db[i].ulx = 0;
                            db[i].uly = l;
                            db[i].w   = width;
                            db[i].h   = 1;
                            decodedImage.getInternCompData(db[i], i);
                        }
                        int[] k = new int[numComps];
                        for (int i = numComps - 1; i >= 0; i--)
                        {
                            k[i] = db[i].offset + width - 1;
                        }

                        byte[] rowvalues = new byte[width * bytesPerPixel];

                        for (int i = width - 1; i >= 0; i--)
                        {
                            int[] tmp = new int[numComps];
                            for (int j = numComps - 1; j >= 0; j--)
                            {
                                tmp[j] = (db[j].data_array[k[j]--] >> fb[j]) + ls[j];
                                tmp[j] = (tmp[j] < 0) ? 0 : ((tmp[j] > mv[j]) ? mv[j] : tmp[j]);

                                if (decodedImage.getNomRangeBits(j) != 8)
                                {
                                    tmp[j] = (int)Math.Round(((double)tmp[j] / Math.Pow(2D, (double)decodedImage.getNomRangeBits(j))) * 255D);
                                }
                            }
                            int offset = i * bytesPerPixel;
                            switch (numComps)
                            {
                            case 1:
                                rowvalues[offset + 0] = (byte)tmp[0];
                                rowvalues[offset + 1] = (byte)tmp[0];
                                rowvalues[offset + 2] = (byte)tmp[0];
                                break;

                            case 3:
                                rowvalues[offset + 0] = (byte)tmp[2];
                                rowvalues[offset + 1] = (byte)tmp[1];
                                rowvalues[offset + 2] = (byte)tmp[0];
                                break;

                            case 4:
                                rowvalues[offset + 0] = (byte)tmp[3];
                                rowvalues[offset + 1] = (byte)tmp[2];
                                rowvalues[offset + 2] = (byte)tmp[1];
                                rowvalues[offset + 3] = (byte)tmp[0];
                                break;
                            }
                        }

                        dst.FillRow(tOffx, tOffy + l, width, rowvalues);
                    }
                }
            }
            return(dst.Bitmap);
        }
Exemplo n.º 37
0
        /// <summary>
        /// Given a path get the CLR runtime version of the file
        /// </summary>
        /// <param name="path">path to the file</param>
        /// <returns>The CLR runtime version or empty if the path does not exist or the file is not an assembly.</returns>
        public static string GetRuntimeVersion(string path)
        {
            using (var sr = new BinaryReader(File.OpenRead(path)))
            {
                if (!File.Exists(path))
                {
                    return(string.Empty);
                }

                // This algorithm for getting the runtime version is based on
                // the ECMA Standard 335: The Common Language Infrastructure (CLI)
                // http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-335.pdf

                try
                {
                    const uint PEHeaderPointerOffset    = 0x3c;
                    const uint PEHeaderSize             = 20;
                    const uint OptionalPEHeaderSize     = 224;
                    const uint OptionalPEPlusHeaderSize = 240;
                    const uint SectionHeaderSize        = 40;

                    // The PE file format is specified in section II.25

                    // A PE image starts with an MS-DOS header followed by a PE signature, followed by the PE file header,
                    // and then the PE optional header followed by PE section headers.
                    // There must be room for all of that.

                    if (sr.BaseStream.Length < PEHeaderPointerOffset + 4 + PEHeaderSize + OptionalPEHeaderSize + SectionHeaderSize)
                    {
                        return(string.Empty);
                    }

                    // The PE format starts with an MS-DOS stub of 128 bytes.
                    // At offset 0x3c in the DOS header is a 4-byte unsigned integer offset to the PE
                    // signature (shall be “PE\0\0”), immediately followed by the PE file header

                    sr.BaseStream.Position = PEHeaderPointerOffset;
                    var peHeaderOffset = sr.ReadUInt32();

                    if (peHeaderOffset + 4 + PEHeaderSize + OptionalPEHeaderSize + SectionHeaderSize >= sr.BaseStream.Length)
                    {
                        return(string.Empty);
                    }

                    // The PE header is specified in section II.25.2
                    // Read the PE header signature

                    sr.BaseStream.Position = peHeaderOffset;
                    if (!ReadBytes(sr, (byte)'P', (byte)'E', 0, 0))
                    {
                        return(string.Empty);
                    }

                    // The PE header immediately follows the signature
                    var peHeaderBase = peHeaderOffset + 4;

                    // At offset 2 of the PE header there is the number of sections
                    sr.BaseStream.Position = peHeaderBase + 2;
                    var numberOfSections = sr.ReadUInt16();
                    if (numberOfSections > 96)
                    {
                        return(string.Empty); // There can't be more than 96 sections, something is wrong
                    }
                    // Immediately after the PE Header is the PE Optional Header.
                    // This header is optional in the general PE spec, but always
                    // present in assembly files.
                    // From this header we'll get the CLI header RVA, which is
                    // at offset 208 for PE32, and at offset 224 for PE32+

                    var optionalHeaderOffset = peHeaderBase + PEHeaderSize;

                    uint cliHeaderRvaOffset;
                    uint optionalPEHeaderSize;

                    sr.BaseStream.Position = optionalHeaderOffset;
                    var magicNumber = sr.ReadUInt16();

                    if (magicNumber == 0x10b) // PE32
                    {
                        optionalPEHeaderSize = OptionalPEHeaderSize;
                        cliHeaderRvaOffset   = optionalHeaderOffset + 208;
                    }
                    else if (magicNumber == 0x20b) // PE32+
                    {
                        optionalPEHeaderSize = OptionalPEPlusHeaderSize;
                        cliHeaderRvaOffset   = optionalHeaderOffset + 224;
                    }
                    else
                    {
                        return(string.Empty);
                    }

                    // Read the CLI header RVA

                    sr.BaseStream.Position = cliHeaderRvaOffset;
                    var cliHeaderRva = sr.ReadUInt32();
                    if (cliHeaderRva == 0)
                    {
                        return(string.Empty); // No CLI section
                    }
                    // Immediately following the optional header is the Section
                    // Table, which contains a number of section headers.
                    // Section headers are specified in section II.25.3

                    // Each section header has the base RVA, size, and file
                    // offset of the section. To find the file offset of the
                    // CLI header we need to find a section that contains
                    // its RVA, and the calculate the file offset using
                    // the base file offset of the section.

                    var sectionOffset = optionalHeaderOffset + optionalPEHeaderSize;

                    // Read all section headers, we need them to make RVA to
                    // offset conversions.

                    var sections = new HeaderInfo[numberOfSections];
                    for (int n = 0; n < numberOfSections; n++)
                    {
                        // At offset 8 of the section is the section size
                        // and base RVA. At offset 20 there is the file offset
                        sr.BaseStream.Position = sectionOffset + 8;
                        var sectionSize = sr.ReadUInt32();
                        var sectionRva  = sr.ReadUInt32();
                        sr.BaseStream.Position = sectionOffset + 20;
                        var sectionDataOffset = sr.ReadUInt32();
                        sections[n] = new HeaderInfo
                        {
                            VirtualAddress = sectionRva,
                            Size           = sectionSize,
                            FileOffset     = sectionDataOffset
                        };
                        sectionOffset += SectionHeaderSize;
                    }

                    uint cliHeaderOffset = RvaToOffset(sections, cliHeaderRva);

                    // CLI section not found
                    if (cliHeaderOffset == 0)
                    {
                        return(string.Empty);
                    }

                    // The CLI header is specified in section II.25.3.3.
                    // It contains all of the runtime-specific data entries and other information.
                    // From the CLI header we need to get the RVA of the metadata root,
                    // which is located at offset 8.

                    sr.BaseStream.Position = cliHeaderOffset + 8;
                    var metadataRva = sr.ReadUInt32();

                    var metadataOffset = RvaToOffset(sections, metadataRva);
                    if (metadataOffset == 0)
                    {
                        return(string.Empty);
                    }

                    // The metadata root is specified in section II.24.2.1
                    // The first 4 bytes contain a signature.
                    // The version string is at offset 12.

                    sr.BaseStream.Position = metadataOffset;
                    if (!ReadBytes(sr, 0x42, 0x53, 0x4a, 0x42)) // Metadata root signature
                    {
                        return(string.Empty);
                    }

                    // Read the version string length
                    sr.BaseStream.Position = metadataOffset + 12;
                    var length = sr.ReadInt32();
                    if (length > 255 || length <= 0 || sr.BaseStream.Position + length >= sr.BaseStream.Length)
                    {
                        return(string.Empty);
                    }

                    // Read the version string
                    var v = Encoding.UTF8.GetString(sr.ReadBytes(length));
                    if (v.Length < 2 || v[0] != 'v')
                    {
                        return(string.Empty);
                    }

                    // Make sure it is a version number
                    Version version;
                    if (!Version.TryParse(v.Substring(1), out version))
                    {
                        return(string.Empty);
                    }
                    return(v);
                }
                catch
                {
                    // Something went wrong in spite of all checks. Corrupt file?
                    return(string.Empty);
                }
            }
        }
Exemplo n.º 38
0
        private void ReceiveCallback(IAsyncResult ar)
        {
            try {
                UdpClient  udpClient = (UdpClient)((UdpState)ar.AsyncState).Client;
                IPEndPoint remoteEP  = (IPEndPoint)((UdpState)ar.AsyncState).EndPoint;

                if (udpClient == null || udpClient.Client == null)
                {
                    return;
                }

                byte[] cipherMessage = udpClient.EndReceive(ar, ref remoteEP);
                string receiveString = Security.DecryptString(cipherMessage);

                int      headerStart    = receiveString.IndexOf(Environment.NewLine);
                int      headerLength   = int.Parse(receiveString.Substring(0, headerStart));
                string   headerString   = receiveString.Substring(headerStart, headerLength);
                int      dataStart      = headerStart + headerLength;
                string   dataString     = receiveString.Substring(dataStart);
                string[] dataAttributes = dataString.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

                HeaderInfo headerInfo = ParseHeader(headerString);
                //  Unique key for this user - MacAddress:UserName eg: 001CBFC90A03:Dilip
                string userKey = headerInfo.Key;

                switch (headerInfo.Type)
                {
                case DatagramTypes.Announce:
                    //  Add a user to the user list.
                    string messageText = dataAttributes[0];
                    string userStatus  = messageText;
                    bool   bNewUser    = AddUser(userKey, headerInfo.Version, headerInfo.Address, headerInfo.UserName, userStatus);
                    if (bNewUser)
                    {
                        SendBroadcast(DatagramTypes.Announce, localStatus);
                    }
                    UpdateUser(userKey, UserInfoFlags.Status, userStatus);
                    break;

                case DatagramTypes.Depart:
                    //  Remove user from the user list.
                    RemoveUser(userKey);
                    RemoveQueryFromQueue(userKey, DatagramTypes.Query);
                    break;

                case DatagramTypes.Broadcast:
                    //  Remote user has sent a broadcast message to everyone.
                    messageText = dataString;
                    AddMessageToQueue(userKey, MessageTypes.Broadcast, headerInfo.TimeStamp, headerInfo.UserName, headerInfo.Address, messageText);
                    break;

                case DatagramTypes.Message:
                    //  Remote user has sent a message.
                    messageText = dataString;
                    AddMessageToQueue(userKey, MessageTypes.Message, headerInfo.TimeStamp, headerInfo.UserName, headerInfo.Address, messageText);
                    SendMessage(DatagramTypes.Status, userKey, headerInfo.TimeStamp);
                    break;

                case DatagramTypes.File:
                    //  Remote user is requesting permission to send a file.
                    messageText = dataString;
                    AddMessageToQueue(userKey, MessageTypes.File, headerInfo.TimeStamp, headerInfo.UserName, headerInfo.Address, messageText);
                    break;

                case DatagramTypes.Query:
                    //  Add this user if user is not present in the user list.
                    bNewUser = AddUser(userKey, headerInfo.Version, headerInfo.Address, headerInfo.UserName, "Available");
                    //  Remote user has sent a query which needs an acknowledgement.
                    SendMessage(DatagramTypes.Status, userKey, headerInfo.TimeStamp);
                    if (bNewUser)
                    {
                        SendBroadcast(DatagramTypes.Announce, localStatus);
                    }
                    break;

                case DatagramTypes.Status:
                    //  Remote user has sent an acknowledgement.
                    messageText = dataAttributes[0];
                    RemoveQueryFromQueue(userKey, messageText);
                    break;

                case DatagramTypes.Notify:
                    //  Remote user has sent a ntofication to all users.
                    messageText = dataAttributes[0];
                    userStatus  = messageText;
                    UpdateUser(userKey, UserInfoFlags.Status, userStatus);
                    break;

                case DatagramTypes.UserQuery:
                    //  Remote user has sent a user info query which needs a response.
                    SendMessage(DatagramTypes.UserInfo, userKey, string.Empty);
                    break;

                case DatagramTypes.UserInfo:
                    //  Remote user has sent a response to user info query.
                    messageText = dataString;
                    AddMessageToQueue(userKey, MessageTypes.UserInfo, headerInfo.TimeStamp, headerInfo.UserName, headerInfo.Address, messageText);
                    break;

                case DatagramTypes.UserAction:
                    messageText = dataAttributes[0];
                    AddMessageToQueue(userKey, MessageTypes.UserAction, headerInfo.TimeStamp, headerInfo.UserName, headerInfo.Address, messageText);
                    break;
                }

                //  Keep listening for incoming messages.
                ReceiveMessages();
            }
            catch (Exception ex) {
                ErrorHandler.ShowError(ex);
            }
        }
 internal WebHeaderCollection(HeaderInfo headerRestriction)
 {
     this.headerRestriction = headerRestriction;
 }
Exemplo n.º 40
0
        /// <summary>
        /// Gets the obligation headers.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public GetObligationHeadersResponse GetObligationHeaders(GetObligationHeadersRequest request)
        {
            ClientContext ctx = GetClientContext(request.User, request.Password);
            string errors = null;
            var getObligationHeaderDocIn = new InquiryServicesContext.GetCurrentFutureObligationsInDocument
            {
                LUW_BANK = request.BankId,
                LUW_BATCH_ID = request.BatchID,
                LUW_ERROR_MESSAGES = request.Errors,
                LUW_HEADER_FILLER = string.Empty,
                LUW_CALLING_APPL = Constants.LUW_HEADER_CALLING_APPL,
                LUW_ID = request.Luw,
                LUW_ITEM_NBR = request.ItemNumber,
                LUW_LENGTH = request.DataLength,
                LUW_OBLIGATION = request.ObligationNumber,
                LUW_OBLIGOR = request.ObligorNumber,
                LUW_REQUEST_CODE = request.RestartRequestCode,
                SEG_COUNTER = request.Segment
            };

            string X121A_TITLE_CURR_DATE;
            short X121A_ENTRIES_IN_USE;


            X121A_TAB outputField = new X121A_TAB
            {
                X121A_AS_BAL_TYPE = string.Empty,
                X121A_AS_BAL_TYPE_LIT = string.Empty,
                X121A_AS_BASIS = string.Empty,
                X121A_AS_BASIS_LIT = string.Empty,
                X121A_AS_EARN_TYPE = string.Empty,
                X121A_AS_EARN_TYPE_LIT = string.Empty,
                X121A_AS_FM_TIER = 0m,
                X121A_AS_FROM_DT = string.Empty,
                X121A_AS_MEMO = string.Empty,
                X121A_AS_MEMO_LIT = string.Empty,
                X121A_AS_RATE = 0m,
                X121A_AS_TAX_CODE = string.Empty,
                X121A_AS_TAX_CODE_LIT = string.Empty,
                X121A_AS_TO_DT = string.Empty,
                X121A_AS_TO_TIER = 0m,
                X121A_BS_ACCR_TO = string.Empty,
                X121A_BS_BILL_DT = string.Empty,
                X121A_BS_BILL_PERIOD = string.Empty,
                X121A_BS_BILL_PERIOD_LIT = string.Empty,
                X121A_BS_COLL_METH = string.Empty,
                X121A_BS_COLL_METH_LIT = string.Empty,
                X121A_BS_CUST_BILL = string.Empty,
                X121A_BS_CUST_BILL_LIT = string.Empty,
                X121A_BS_DDA = string.Empty,
                X121A_BS_DUE_DT = string.Empty,
                X121A_BS_EXT_TYPE = string.Empty,
                X121A_BS_EXTEND_IND = string.Empty,
                X121A_BS_FROM_DT = string.Empty,
                X121A_BS_GRACE_PERIOD = string.Empty,
                X121A_BS_LEAD_DAYS = string.Empty,
                X121A_BS_MAT_COLL_METH = string.Empty,
                X121A_BS_MAT_COLL_METH_LIT = string.Empty,
                X121A_BS_PRIORITY_CD = string.Empty,
                X121A_BS_REPAY_TP = string.Empty,
                X121A_BS_REPAY_TP_LIT = string.Empty,
                X121A_BS_SPEC_MAIL = string.Empty,
                X121A_BS_TO_DT = string.Empty,
                X121A_BS_TRANS_ID = string.Empty,
                X121A_FILLER_2 = string.Empty,
                X121A_FILLER_2_A = string.Empty,
                X121A_FILLER_2_B = string.Empty,
                X121A_FILLER_2_C = string.Empty,
                X121A_FILLER_3 = string.Empty,
                X121A_FILLER_3_A = string.Empty,
                X121A_FILLER_3_B = string.Empty,
                X121A_FILLER_3_B2 = string.Empty,
                X121A_FILLER_3_B3 = string.Empty,
                X121A_FILLER_3_D = string.Empty,
                X121A_HDG_CHG_CODE = string.Empty,
                X121A_HDR_TYPE_LITERAL = string.Empty,
                X121A_PS_ALT_CAL_IND = string.Empty,
                X121A_PS_ALT_CAL_LIT = string.Empty,
                X121A_PS_ANNV_DT = string.Empty,
                X121A_PS_BREAKAGE = string.Empty,
                X121A_PS_CEILING = 0m,
                X121A_PS_CHG_DAY = string.Empty,
                X121A_PS_CHG_DAY_LIT_1 = string.Empty,
                X121A_PS_CHG_DAY_LIT_2 = string.Empty,
                X121A_PS_FACTOR1 = string.Empty,
                X121A_PS_FACTOR1_LIT = string.Empty,
                X121A_PS_FACTOR2 = string.Empty,
                X121A_PS_FACTOR2_LIT = string.Empty,
                X121A_PS_FLOOR = 0m,
                X121A_PS_FROM_DT = string.Empty,
                X121A_PS_MOD_BUS = string.Empty,
                X121A_PS_NBR_MNTHS = string.Empty,
                X121A_PS_PRIME = string.Empty,
                X121A_PS_RELAT1 = string.Empty,
                X121A_PS_RELAT2 = string.Empty,
                X121A_PS_REPOSITION = string.Empty,
                X121A_PS_TO_DT = string.Empty,
                X121A_TAX_IMA_LIT = string.Empty,
                X121B_DEFERRED_LITERAL = string.Empty,
                X121B_FILLER_01 = string.Empty,
                X121B_FILLER_23 = string.Empty,
                X121B_INT_ADJ_MTD_NOT_THIS_MO = 0m,
                X121B_INT_ADJ_YTD_NOT_THIS_YR = 0m,
                X121B_INT_CHRG_OFF = 0m,
                X121B_INT_ERND_IN_SUSPENSE_MTD = 0m,
                X121B_INT_ERND_IN_SUSPENSE_YTD = 0m,
                X121B_INT_HDR_PREV_ACCR_TO_DTE = string.Empty,
                X121B_INTEREST_ACC_ROUND = 0m,
                X121B_INTEREST_ACCRUAL_DATE = string.Empty,
                X121B_INTEREST_ADJ_EARN_BTD = 0m,
                X121B_INTEREST_ADJ_TO_ITD_DECR = 0m,
                X121B_INTEREST_ADJ_TO_ITD_INCR = 0m,
                X121B_INTEREST_BIL_ROUND = 0m,
                X121B_INTEREST_BILL_NOT_REC = 0m,
                X121B_INTEREST_DAILY_EARNS = 0m,
                X121B_INTEREST_DATE_PAID_TO = string.Empty,
                X121B_INTEREST_DEF_EARN_DT = string.Empty,
                X121B_INTEREST_DEFER_INCOME = 0m,
                X121B_INTEREST_EARNED_BTD = 0m,
                X121B_INTEREST_EARNED_ITD = 0m,
                X121B_INTEREST_EARNED_MTD = 0m,
                X121B_INTEREST_EARNED_YTD = 0m,
                X121B_INTEREST_ERD_SUSPENSE = 0m,
                X121B_INTEREST_LAST_BILL_DT = string.Empty,
                X121B_INTEREST_PAID_ITD = 0m,
                X121B_INTEREST_PAID_MTD = 0m,
                X121B_INTEREST_PAID_SUSPENS = 0m,
                X121B_INTEREST_PAID_TO_PRIN = 0m,
                X121B_INTEREST_PAID_YTD = 0m,
                X121B_INTEREST_PAST_DUE = 0m,
                X121B_INTEREST_PAST_DUE_STS = 0,
                X121B_INTEREST_PD_PRIOR_YR = 0m,
                X121B_INTEREST_PREV_DUE_DAT = string.Empty,
                X121B_INTEREST_START_BAL = 0m,
                X121B_NEGATIVE_AMORT_AMOUNT = 0m,
                X121B_NON_ACCRL_PD_INCOME = 0m,
                X121B_ORIG_SUSPEN_AMOUNT = 0m,
                X121B_PAST_DUE_LIT = string.Empty,
                X121B_RECEIVABLE = 0m,
                X121D_ADD_ON_EARN_DATE = string.Empty,
                X121D_ANTICIP_ERNGS = 0m,
                X121D_APR_EXCL_IND = string.Empty,
                X121D_APR_EXCL_IND_LIT = string.Empty,
                X121D_CLOSE_ADJ_TYPE = string.Empty,
                X121D_CLOSE_ADJ_TYPE_LIT = string.Empty,
                X121D_DELAY_DAYS = 0,
                X121D_EARNINGS_LIT = string.Empty,
                X121D_FIELD_NAME = string.Empty,
                X121D_FIELD_NAME_2 = string.Empty,
                X121D_FINAL_CLOSE_ADJ = 0m,
                X121D_HDR_POINTER_TYPE = string.Empty,
                X121D_HDR_POINTER_TYPE_LIT = string.Empty,
                X121D_INT_CAPITALI_ZED = 0m,
                X121D_INT_METHOD_DEFERRED = 0m,
                X121D_INT_PITD_NOT_RECOG = 0m,
                X121D_INTEREST_ORIG_DISC = 0m,
                X121D_INTEREST_ORIG_TERM = 0,
                X121D_INTEREST_PD_NOT_REPORTED = 0m,
                X121D_INTEREST_PD_REPORTED = 0m,
                X121D_INTEREST_REBATE_DSBUR = 0m,
                X121D_INTEREST_REMAIN_TERM = 0,
                X121D_INTEREST_W_AIVED_MTD = 0m,
                X121D_INTEREST_W_AIVED_YTD = 0m,
                X121D_INTEREST_WAIVED = 0m,
                X121D_MIN_EARN_AMOUNT = 0m,
                X121D_MIN_EARN_CLOSE_AMT = 0m,
                X121D_MIN_EARN_DAY = string.Empty,
                X121D_MIN_EARN_DAY_LIT = string.Empty,
                X121D_MIN_EARN_OVERRIDE = string.Empty,
                X121D_MIN_EARN_OVERRIDE_LIT = string.Empty,
                X121D_MIN_RBTE_AMOUNT = 0m,
                X121D_MIN_RBTE_CHG_CD_IND = string.Empty,
                X121D_MIN_RBTE_CHG_CD_IND_LIT = string.Empty,
                X121D_MIN_RBTE_CODE = string.Empty,
                X121D_MIN_RBTE_OVERRIDE = string.Empty,
                X121D_MIN_RBTE_OVERRIDE_LIT = string.Empty,
                X121D_NET_ACTIVITY_TODAY = 0m,
                X121D_NEXT_REPRICE_DATE = string.Empty,
                X121D_REBATE_BASE_RATE = 0,
                X121D_REBATE_IND = string.Empty,
                X121D_REBATE_IND_LIT = string.Empty,
                X121D_REBATE_METHOD = string.Empty,
                X121D_REBATE_METHOD_LIT = string.Empty,
                X121D_UNACCR_MIN_EARN = 0m,
                X121F_ASSESSED_ITD = 0m,
                X121F_ASSESSED_MTD = 0m,
                X121F_ASSESSED_YTD = 0m,
                X121F_DATA_PRESENT_SW = string.Empty,
                X121F_DATE_LST_ASSESS = string.Empty,
                X121F_EDF_CHARGE = 0m,
                X121F_EDF_LMT_CODE = string.Empty,
                X121F_EDF_LMT_CODE_LITERAL = string.Empty,
                X121F_EDF_METHOD = string.Empty,
                X121F_EDF_METHOD_LITERAL = string.Empty,
                X121F_EVENT_TYPE = string.Empty,
                X121F_EVENT_TYPE_LITERAL = string.Empty,
                X121F_MAX_ASSESS = string.Empty,
                X121F_MIN_ASSESS = string.Empty,
                X121F_NXT_ASSESS_DATE = string.Empty,
                X121F_OCCURS_CHARGE = 0,
                X121F_PERIOD = 0,
                X121F_PERIOD_LITERAL = string.Empty

            };
            X121A_TAB[] outputs = new X121A_TAB[14];
            for (int i = 0; i < 14; i++)
            {
                outputs[i] = outputField;
            }

            try
            {
                inq.GetCurrentFutureObligations(ref getObligationHeaderDocIn.LUW_ID,
                           ref getObligationHeaderDocIn.LUW_REQUEST_CODE,
                           ref getObligationHeaderDocIn.LUW_BATCH_ID,
                           ref getObligationHeaderDocIn.LUW_BANK,
                           ref getObligationHeaderDocIn.LUW_OBLIGOR,
                           ref getObligationHeaderDocIn.LUW_OBLIGATION,
                           ref getObligationHeaderDocIn.LUW_ITEM_NBR,
                           ref getObligationHeaderDocIn.SEG_COUNTER,
                           ref getObligationHeaderDocIn.LUW_HEADER_FILLER,
                           ref getObligationHeaderDocIn.LUW_CALLING_APPL,
                           ref getObligationHeaderDocIn.LUW_LENGTH,
                           ref errors,
                           out X121A_TITLE_CURR_DATE,
                           out X121A_ENTRIES_IN_USE,
                           out outputs,
                           ref ctx
                       );

                var obligationHeaderArray = Array.ConvertAll<X121A_TAB, HeaderInfo>(outputs, delegate(X121A_TAB output)
                {
                    var obligationHeader = new HeaderInfo()
                    {
                        X121A_AS_BAL_TYPE = string.Empty,
                        X121A_AS_BAL_TYPE_LIT = output.X121A_AS_BAL_TYPE_LIT,
                        X121A_AS_BASIS = output.X121A_AS_BASIS,
                        X121A_AS_BASIS_LIT = output.X121A_AS_BASIS_LIT,
                        X121A_AS_EARN_TYPE = output.X121A_AS_EARN_TYPE,
                        X121A_AS_EARN_TYPE_LIT = output.X121A_AS_EARN_TYPE_LIT,
                        X121A_AS_FM_TIER = output.X121A_AS_FM_TIER,
                        X121A_AS_FROM_DT = output.X121A_AS_FROM_DT,
                        X121A_AS_MEMO = output.X121A_AS_MEMO,
                        X121A_AS_MEMO_LIT = output.X121A_AS_MEMO_LIT,
                        X121A_AS_RATE = output.X121A_AS_RATE,
                        X121A_AS_TAX_CODE = output.X121A_AS_TAX_CODE,
                        X121A_AS_TAX_CODE_LIT = output.X121A_AS_TAX_CODE_LIT,
                        X121A_AS_TO_DT = output.X121A_AS_TO_DT,
                        X121A_AS_TO_TIER = output.X121A_AS_TO_TIER,
                        X121A_BS_ACCR_TO = output.X121A_BS_ACCR_TO,
                        X121A_BS_BILL_DT = output.X121A_BS_BILL_DT,
                        X121A_BS_BILL_PERIOD = output.X121A_BS_BILL_PERIOD,
                        X121A_BS_BILL_PERIOD_LIT = output.X121A_BS_BILL_PERIOD_LIT,
                        X121A_BS_COLL_METH = output.X121A_BS_COLL_METH,
                        X121A_BS_COLL_METH_LIT = output.X121A_BS_COLL_METH_LIT,
                        X121A_BS_CUST_BILL = output.X121A_BS_CUST_BILL,
                        X121A_BS_CUST_BILL_LIT = output.X121A_BS_CUST_BILL_LIT,
                        X121A_BS_DDA = output.X121A_BS_DDA,
                        X121A_BS_DUE_DT = output.X121A_BS_DUE_DT,
                        X121A_BS_EXT_TYPE = output.X121A_BS_EXT_TYPE,
                        X121A_BS_EXTEND_IND = output.X121A_BS_EXTEND_IND,
                        X121A_BS_FROM_DT = output.X121A_BS_FROM_DT,
                        X121A_BS_GRACE_PERIOD = output.X121A_BS_GRACE_PERIOD,
                        X121A_BS_LEAD_DAYS = output.X121A_BS_LEAD_DAYS,
                        X121A_BS_MAT_COLL_METH = output.X121A_BS_MAT_COLL_METH,
                        X121A_BS_MAT_COLL_METH_LIT = output.X121A_BS_MAT_COLL_METH_LIT,
                        X121A_BS_PRIORITY_CD = output.X121A_BS_PRIORITY_CD,
                        X121A_BS_REPAY_TP = output.X121A_BS_REPAY_TP,
                        X121A_BS_REPAY_TP_LIT = output.X121A_BS_REPAY_TP_LIT,
                        X121A_BS_SPEC_MAIL = output.X121A_BS_SPEC_MAIL,
                        X121A_BS_TO_DT = output.X121A_BS_TO_DT,
                        X121A_BS_TRANS_ID = output.X121A_BS_TRANS_ID,
                        X121A_FILLER_2 = output.X121A_FILLER_2,
                        X121A_FILLER_2_A = output.X121A_FILLER_2_A,
                        X121A_FILLER_2_B = output.X121A_FILLER_2_B,
                        X121A_FILLER_2_C = output.X121A_FILLER_2_C,
                        X121A_FILLER_3 = output.X121A_FILLER_3,
                        X121A_FILLER_3_A = output.X121A_FILLER_3_A,
                        X121A_FILLER_3_B = output.X121A_FILLER_3_B,
                        X121A_FILLER_3_B2 = output.X121A_FILLER_3_B2,
                        X121A_FILLER_3_B3 = output.X121A_FILLER_3_B3,
                        X121A_FILLER_3_D = output.X121A_FILLER_3_D,
                        X121A_HDG_CHG_CODE = output.X121A_HDG_CHG_CODE,
                        X121A_HDR_TYPE_LITERAL = output.X121A_HDR_TYPE_LITERAL,
                        X121A_PS_ALT_CAL_IND = output.X121A_PS_ALT_CAL_IND,
                        X121A_PS_ALT_CAL_LIT = output.X121A_PS_ALT_CAL_LIT,
                        X121A_PS_ANNV_DT = output.X121A_PS_ANNV_DT,
                        X121A_PS_BREAKAGE = output.X121A_PS_BREAKAGE,
                        X121A_PS_CEILING = output.X121A_PS_CEILING,
                        X121A_PS_CHG_DAY = output.X121A_PS_CHG_DAY,
                        X121A_PS_CHG_DAY_LIT_1 = output.X121A_PS_CHG_DAY_LIT_1,
                        X121A_PS_CHG_DAY_LIT_2 = output.X121A_PS_CHG_DAY_LIT_2,
                        X121A_PS_FACTOR1 = output.X121A_PS_FACTOR1,
                        X121A_PS_FACTOR1_LIT = output.X121A_PS_FACTOR1_LIT,
                        X121A_PS_FACTOR2 = output.X121A_PS_FACTOR2,
                        X121A_PS_FACTOR2_LIT = output.X121A_PS_FACTOR2_LIT,
                        X121A_PS_FLOOR = output.X121A_PS_FLOOR,
                        X121A_PS_FROM_DT = output.X121A_PS_FROM_DT,
                        X121A_PS_MOD_BUS = output.X121A_PS_MOD_BUS,
                        X121A_PS_NBR_MNTHS = output.X121A_PS_NBR_MNTHS,
                        X121A_PS_PRIME = output.X121A_PS_PRIME,
                        X121A_PS_RELAT1 = output.X121A_PS_RELAT1,
                        X121A_PS_RELAT2 = output.X121A_PS_RELAT2,
                        X121A_PS_REPOSITION = output.X121A_PS_REPOSITION,
                        X121A_PS_TO_DT = output.X121A_PS_TO_DT,
                        X121A_TAX_IMA_LIT = output.X121A_TAX_IMA_LIT,
                        X121B_DEFERRED_LITERAL = output.X121B_DEFERRED_LITERAL,
                        X121B_FILLER_01 = output.X121B_FILLER_01,
                        X121B_FILLER_23 = output.X121B_FILLER_23,
                        X121B_INT_ADJ_MTD_NOT_THIS_MO = output.X121B_INT_ADJ_MTD_NOT_THIS_MO,
                        X121B_INT_ADJ_YTD_NOT_THIS_YR = output.X121B_INT_ADJ_YTD_NOT_THIS_YR,
                        X121B_INT_CHRG_OFF = output.X121B_INT_CHRG_OFF,
                        X121B_INT_ERND_IN_SUSPENSE_MTD = output.X121B_INT_ERND_IN_SUSPENSE_MTD,
                        X121B_INT_ERND_IN_SUSPENSE_YTD = output.X121B_INT_ERND_IN_SUSPENSE_YTD,
                        X121B_INT_HDR_PREV_ACCR_TO_DTE = output.X121B_INT_HDR_PREV_ACCR_TO_DTE,
                        X121B_INTEREST_ACC_ROUND = output.X121B_INTEREST_ACC_ROUND,
                        X121B_INTEREST_ACCRUAL_DATE = output.X121B_INTEREST_ACCRUAL_DATE,
                        X121B_INTEREST_ADJ_EARN_BTD = output.X121B_INTEREST_ADJ_EARN_BTD,
                        X121B_INTEREST_ADJ_TO_ITD_DECR = output.X121B_INTEREST_ADJ_TO_ITD_DECR,
                        X121B_INTEREST_ADJ_TO_ITD_INCR = output.X121B_INTEREST_ADJ_TO_ITD_INCR,
                        X121B_INTEREST_BIL_ROUND = output.X121B_INTEREST_BIL_ROUND,
                        X121B_INTEREST_BILL_NOT_REC = output.X121B_INTEREST_BILL_NOT_REC,
                        X121B_INTEREST_DAILY_EARNS = output.X121B_INTEREST_DAILY_EARNS,
                        X121B_INTEREST_DATE_PAID_TO = output.X121B_INTEREST_DATE_PAID_TO,
                        X121B_INTEREST_DEF_EARN_DT = output.X121B_INTEREST_DEF_EARN_DT,
                        X121B_INTEREST_DEFER_INCOME = output.X121B_INTEREST_DEFER_INCOME,
                        X121B_INTEREST_EARNED_BTD = output.X121B_INTEREST_EARNED_BTD,
                        X121B_INTEREST_EARNED_ITD = output.X121B_INTEREST_EARNED_ITD,
                        X121B_INTEREST_EARNED_MTD = output.X121B_INTEREST_EARNED_MTD,
                        X121B_INTEREST_EARNED_YTD = output.X121B_INTEREST_EARNED_YTD,
                        X121B_INTEREST_ERD_SUSPENSE = output.X121B_INTEREST_ERD_SUSPENSE,
                        X121B_INTEREST_LAST_BILL_DT = output.X121B_INTEREST_LAST_BILL_DT,
                        X121B_INTEREST_PAID_ITD = output.X121B_INTEREST_PAID_ITD,
                        X121B_INTEREST_PAID_MTD = output.X121B_INTEREST_PAID_MTD,
                        X121B_INTEREST_PAID_SUSPENS = output.X121B_INTEREST_PAID_SUSPENS,
                        X121B_INTEREST_PAID_TO_PRIN = output.X121B_INTEREST_PAID_TO_PRIN,
                        X121B_INTEREST_PAID_YTD = output.X121B_INTEREST_PAID_YTD,
                        X121B_INTEREST_PAST_DUE = output.X121B_INTEREST_PAST_DUE,
                        X121B_INTEREST_PAST_DUE_STS = output.X121B_INTEREST_PAST_DUE_STS,
                        X121B_INTEREST_PD_PRIOR_YR = output.X121B_INTEREST_PD_PRIOR_YR,
                        X121B_INTEREST_PREV_DUE_DAT = output.X121B_INTEREST_PREV_DUE_DAT,
                        X121B_INTEREST_START_BAL = output.X121B_INTEREST_START_BAL,
                        X121B_NEGATIVE_AMORT_AMOUNT = output.X121B_NEGATIVE_AMORT_AMOUNT,
                        X121B_NON_ACCRL_PD_INCOME = output.X121B_NON_ACCRL_PD_INCOME,
                        X121B_ORIG_SUSPEN_AMOUNT = output.X121B_ORIG_SUSPEN_AMOUNT,
                        X121B_PAST_DUE_LIT = output.X121B_PAST_DUE_LIT,
                        X121B_RECEIVABLE = output.X121B_RECEIVABLE,
                        X121D_ADD_ON_EARN_DATE = output.X121D_ADD_ON_EARN_DATE,
                        X121D_ANTICIP_ERNGS = output.X121D_ANTICIP_ERNGS,
                        X121D_APR_EXCL_IND = output.X121D_APR_EXCL_IND,
                        X121D_APR_EXCL_IND_LIT = output.X121D_APR_EXCL_IND_LIT,
                        X121D_CLOSE_ADJ_TYPE = output.X121D_CLOSE_ADJ_TYPE,
                        X121D_CLOSE_ADJ_TYPE_LIT = output.X121D_CLOSE_ADJ_TYPE_LIT,
                        X121D_DELAY_DAYS = output.X121D_DELAY_DAYS,
                        X121D_EARNINGS_LIT = output.X121D_EARNINGS_LIT,
                        X121D_FIELD_NAME = output.X121D_FIELD_NAME,
                        X121D_FIELD_NAME_2 = output.X121D_FIELD_NAME_2,
                        X121D_FINAL_CLOSE_ADJ = output.X121D_FINAL_CLOSE_ADJ,
                        X121D_HDR_POINTER_TYPE = output.X121D_HDR_POINTER_TYPE,
                        X121D_HDR_POINTER_TYPE_LIT = output.X121D_HDR_POINTER_TYPE_LIT,
                        X121D_INT_CAPITALI_ZED = output.X121D_INT_CAPITALI_ZED,
                        X121D_INT_METHOD_DEFERRED = output.X121D_INT_METHOD_DEFERRED,
                        X121D_INT_PITD_NOT_RECOG = output.X121D_INT_PITD_NOT_RECOG,
                        X121D_INTEREST_ORIG_DISC = output.X121D_INTEREST_ORIG_DISC,
                        X121D_INTEREST_ORIG_TERM = output.X121D_INTEREST_ORIG_TERM,
                        X121D_INTEREST_PD_NOT_REPORTED = output.X121D_INTEREST_PD_NOT_REPORTED,
                        X121D_INTEREST_PD_REPORTED = output.X121D_INTEREST_PD_REPORTED,
                        X121D_INTEREST_REBATE_DSBUR = output.X121D_INTEREST_REBATE_DSBUR,
                        X121D_INTEREST_REMAIN_TERM = output.X121D_INTEREST_REMAIN_TERM,
                        X121D_INTEREST_W_AIVED_MTD = output.X121D_INTEREST_W_AIVED_MTD,
                        X121D_INTEREST_W_AIVED_YTD = output.X121D_INTEREST_W_AIVED_YTD,
                        X121D_INTEREST_WAIVED = output.X121D_INTEREST_WAIVED,
                        X121D_MIN_EARN_AMOUNT = output.X121D_MIN_EARN_AMOUNT,
                        X121D_MIN_EARN_CLOSE_AMT = output.X121D_MIN_EARN_CLOSE_AMT,
                        X121D_MIN_EARN_DAY = output.X121D_MIN_EARN_DAY,
                        X121D_MIN_EARN_DAY_LIT = output.X121D_MIN_EARN_DAY_LIT,
                        X121D_MIN_EARN_OVERRIDE = output.X121D_MIN_EARN_OVERRIDE,
                        X121D_MIN_EARN_OVERRIDE_LIT = output.X121D_MIN_EARN_OVERRIDE_LIT,
                        X121D_MIN_RBTE_AMOUNT = output.X121D_MIN_RBTE_AMOUNT,
                        X121D_MIN_RBTE_CHG_CD_IND = output.X121D_MIN_RBTE_CHG_CD_IND,
                        X121D_MIN_RBTE_CHG_CD_IND_LIT = output.X121D_MIN_RBTE_CHG_CD_IND_LIT,
                        X121D_MIN_RBTE_CODE = output.X121D_MIN_RBTE_CODE,
                        X121D_MIN_RBTE_OVERRIDE = output.X121D_MIN_RBTE_OVERRIDE,
                        X121D_MIN_RBTE_OVERRIDE_LIT = output.X121D_MIN_RBTE_OVERRIDE_LIT,
                        X121D_NET_ACTIVITY_TODAY = output.X121D_NET_ACTIVITY_TODAY,
                        X121D_NEXT_REPRICE_DATE = output.X121D_NEXT_REPRICE_DATE,
                        X121D_REBATE_BASE_RATE = output.X121D_REBATE_BASE_RATE,
                        X121D_REBATE_IND = output.X121D_REBATE_IND,
                        X121D_REBATE_IND_LIT = output.X121D_REBATE_IND_LIT,
                        X121D_REBATE_METHOD = output.X121D_REBATE_METHOD,
                        X121D_REBATE_METHOD_LIT = output.X121D_REBATE_METHOD_LIT,
                        X121D_UNACCR_MIN_EARN = output.X121D_UNACCR_MIN_EARN,
                        X121F_ASSESSED_ITD = output.X121F_ASSESSED_ITD,
                        X121F_ASSESSED_MTD = output.X121F_ASSESSED_MTD,
                        X121F_ASSESSED_YTD = output.X121F_ASSESSED_YTD,
                        X121F_DATA_PRESENT_SW = output.X121F_DATA_PRESENT_SW,
                        X121F_DATE_LST_ASSESS = output.X121F_DATE_LST_ASSESS,
                        X121F_EDF_CHARGE = output.X121F_EDF_CHARGE,
                        X121F_EDF_LMT_CODE = output.X121F_EDF_LMT_CODE,
                        X121F_EDF_LMT_CODE_LITERAL = output.X121F_EDF_LMT_CODE_LITERAL,
                        X121F_EDF_METHOD = output.X121F_EDF_METHOD,
                        X121F_EDF_METHOD_LITERAL = output.X121F_EDF_METHOD_LITERAL,
                        X121F_EVENT_TYPE = output.X121F_EVENT_TYPE,
                        X121F_EVENT_TYPE_LITERAL = output.X121F_EVENT_TYPE_LITERAL,
                        X121F_MAX_ASSESS = output.X121F_MAX_ASSESS,
                        X121F_MIN_ASSESS = output.X121F_MIN_ASSESS,
                        X121F_NXT_ASSESS_DATE = output.X121F_NXT_ASSESS_DATE,
                        X121F_OCCURS_CHARGE = output.X121F_OCCURS_CHARGE,
                        X121F_PERIOD = output.X121F_PERIOD,
                        X121F_PERIOD_LITERAL = output.X121F_PERIOD_LITERAL
                    };
                    return obligationHeader;

                });

                return new GetObligationHeadersResponse() { HeaderInfoList = obligationHeaderArray.ToList(), Errors = errors };
            }
            catch (Microsoft.HostIntegration.TI.CustomTIException Ex)
            {
                return HandleHISException<GetObligationHeadersResponse>(Ex, request, "GetObligationHeaders");
            }
            catch (Exception ee)
            {
                string msg = ee.Message;
                throw;
            }

        }
Exemplo n.º 41
0
        /// <summary>
        /// Add new Document
        /// </summary>
        /// <returns></returns>
        private int Add(HeaderInfo headerInfo)
        {
            string ret  = "Item updated successfully";
            int    _uid = 0;

            _uid = GetLastUID() + 1;

            this.UID = _uid;
            if (string.IsNullOrEmpty(this.Status))
            {
                this.Status = "ACTIVE";
            }
            this.UserIdCreatedBy  = Utils.UserID;
            this.UserIdUpdatedBy  = Utils.UserID;
            this.CreationDateTime = System.DateTime.Now;
            this.UpdateDateTime   = System.DateTime.Now;
            this.IsVoid           = "N";
            this.RecordVersion    = 1;
            if (string.IsNullOrEmpty(this.DisplayName))
            {
                this.DisplayName = "TBA";
            }


            using (var connection = new SqlConnection(ConnString.ConnectionString))
            {
                var commandString =
                    (
                        "INSERT INTO [Document] " +
                        "( " +
                        DocumentFieldString() +
                        ")" +
                        " VALUES " +
                        "( " +
                        "  @" + FieldName.UID +
                        ", @" + FieldName.CUID +
                        ", @" + FieldName.Name +
                        ", @" + FieldName.DisplayName +
                        ", @" + FieldName.SequenceNumber +
                        ", @" + FieldName.IssueNumber +
                        ", @" + FieldName.Location +
                        ", @" + FieldName.Comments +
                        ", @" + FieldName.FileName +
                        ", @" + FieldName.Status +
                        ", @" + FieldName.SimpleFileName +
                        ", @" + FieldName.SourceCode +
                        ", @" + FieldName.FKClientUID +
                        ", @" + FieldName.IsVoid +
                        ", @" + FieldName.ParentUID +
                        ", @" + FieldName.RecordType +
                        ", @" + FieldName.FileExtension +
                        ", @" + FieldName.IsProjectPlan +
                        ", @" + FieldName.DocumentType +
                        ", @" + FieldName.RecordVersion +
                        ", @" + FieldName.UpdateDateTime +
                        ", @" + FieldName.CreationDateTime +
                        ", @" + FieldName.UserIdCreatedBy +
                        ", @" + FieldName.UserIdUpdatedBy +
                        " ) "

                    );

                using (var command = new SqlCommand(
                           commandString, connection))

                {
                    command.Parameters.Add("@UID", SqlDbType.BigInt).Value                = UID;
                    command.Parameters.Add("@CUID", SqlDbType.VarChar).Value              = CUID;
                    command.Parameters.Add("@Name", SqlDbType.VarChar).Value              = Name;
                    command.Parameters.Add("@DisplayName", SqlDbType.VarChar).Value       = DisplayName;
                    command.Parameters.Add("@SequenceNumber", SqlDbType.VarChar).Value    = SequenceNumber;
                    command.Parameters.Add("@IssueNumber", SqlDbType.Decimal).Value       = IssueNumber;
                    command.Parameters.Add("@Location", SqlDbType.VarChar).Value          = Location;
                    command.Parameters.Add("@Comments", SqlDbType.VarChar).Value          = Comments;
                    command.Parameters.Add("@FileName", SqlDbType.VarChar).Value          = FileName;
                    command.Parameters.Add("@SimpleFileName", SqlDbType.VarChar).Value    = SimpleFileName;
                    command.Parameters.Add("@SourceCode", SqlDbType.VarChar).Value        = SourceCode;
                    command.Parameters.Add("@FKClientUID", SqlDbType.BigInt).Value        = FKClientUID;
                    command.Parameters.Add("@IsVoid", SqlDbType.VarChar).Value            = IsVoid;
                    command.Parameters.Add("@ParentUID", SqlDbType.VarChar).Value         = ParentUID;
                    command.Parameters.Add("@RecordType", SqlDbType.VarChar).Value        = RecordType;
                    command.Parameters.Add("@IsProjectPlan", SqlDbType.VarChar).Value     = IsProjectPlan;
                    command.Parameters.Add("@DocumentType", SqlDbType.VarChar).Value      = DocumentType;
                    command.Parameters.Add("@FileExtension", SqlDbType.VarChar).Value     = FileExtension;
                    command.Parameters.Add("@Status", SqlDbType.VarChar).Value            = Status;
                    command.Parameters.Add("@RecordVersion", SqlDbType.VarChar).Value     = RecordVersion;
                    command.Parameters.Add("@UserIdCreatedBy", SqlDbType.VarChar).Value   = UserIdCreatedBy;
                    command.Parameters.Add("@UserIdUpdatedBy", SqlDbType.VarChar).Value   = UserIdUpdatedBy;
                    command.Parameters.Add("@CreationDateTime", SqlDbType.DateTime).Value = CreationDateTime;
                    command.Parameters.Add("@UpdateDateTime", SqlDbType.DateTime).Value   = UpdateDateTime;

                    connection.Open();

                    try
                    {
                        command.ExecuteNonQuery();
                    }
                    catch (Exception ex)
                    {
                        LogFile.WriteToTodaysLogFile(
                            "Error adding new document." + ex.ToString(),
                            headerInfo.UserID,
                            "Document.cs"
                            );
                    }
                }
            }
            return(_uid);
        }
Exemplo n.º 42
0
 void ISOEHandler.OnReceiveHeader(HeaderInfo info, IEnumerable <IndexedValue <AnalogCommandEvent> > values)
 {
     // TODO
 }
Exemplo n.º 43
0
        // -----------------------------------------------------
        //    Create new document version
        // -----------------------------------------------------
        public ResponseStatus NewVersion(HeaderInfo headerInfo)
        {
            ResponseStatus response = new ResponseStatus();

            response.Message = "New version created successfully.";

            // Copy existing version to old folder version
            // Old folder comes from %VERSIONFOLDER%
            //
            var versionFolder =
                CodeValue.GetCodeValueExtended(FCMConstant.CodeTypeString.SYSTSET, FCMConstant.SYSFOLDER.VERSIONFOLDER);

            // Create a record to point to the old version
            var documentVersion = new DocumentVersion();

            documentVersion.FKDocumentCUID = this.CUID;
            documentVersion.FKDocumentUID  = this.UID;

            // Generate the new version id
            documentVersion.IssueNumber = this.IssueNumber;
            documentVersion.Location    = Utils.GetVersionPath(this.Location);
            documentVersion.FileName    = this.FileName;
            documentVersion.Add();

            // Increments issue number
            this.IssueNumber++;

            // Create a new file name with version on it
            // POL-05-01 FILE NAME.doc
            //
            int    version  = Convert.ToInt32(this.IssueNumber);
            string tversion = version.ToString().PadLeft(2, '0');
            // string simpleFileName = this.Name.Substring(10).Trim();
            string simpleFileName = this.Name.Substring(07).Trim();

            string newFileName = this.CUID + '-' +
                                 tversion + '-' +
                                 simpleFileName;

            // string newFileNameWithExtension = newFileName + ".doc";

            // Well, the simple file name has extension already... so I have commented out the line above
            // 30/04/2011 - Testing to see if it works.
            //
            string newFileNameWithExtension = newFileName;

            // Copy the file with new name
            // Let's copy the document
            string realLocation        = Utils.getFilePathName(this.Location, this.FileName);
            string realDestination     = Utils.getFilePathName(documentVersion.Location, documentVersion.FileName);
            string realPathDestination = Utils.GetPathName(documentVersion.Location);

            if (!System.IO.Directory.Exists(realPathDestination))
            {
                System.IO.Directory.CreateDirectory(realPathDestination);
            }

            if (!System.IO.File.Exists(realLocation))
            {
                response.Message    = "File to be copied was not found. " + realLocation;
                response.ReturnCode = -0010;
                response.ReasonCode = 0001;
                response.UniqueCode = ResponseStatus.MessageCode.Error.FCMERR00000006;
                return(response);
            }
            File.Copy(realLocation, realDestination, true);

            // Copy file to new name
            //
            string newFilePathName = Utils.getFilePathName(
                this.Location,
                newFileNameWithExtension);

            File.Copy(realLocation, newFilePathName, true);

            // Delete old version from main folder
            //
            File.Delete(realLocation);

            // Update document details - version, name, etc
            this.IssueNumber = version;
            // this.ComboIssueNumber = "C" + version.ToString("000");
            this.FileName = newFileNameWithExtension;
            this.Name     = newFileName;
            this.UpdateVersion(headerInfo);

            // Build a screen to browse all versions of a file
            // Allow compare/ View
            // Check how to open a document read-only for users future

            response.Contents = version;
            return(response);
        }
Exemplo n.º 44
0
 protected override bool IsMatchingHeader(HeaderInfo header)
 {
     return(header.Key.StartsWith("NServiceBus.ExceptionInfo", StringComparison.OrdinalIgnoreCase) ||
            header.Key.EndsWith("FailedQ", StringComparison.OrdinalIgnoreCase) ||
            header.Key.EndsWith("TimeOfFailure", StringComparison.OrdinalIgnoreCase));
 }
Exemplo n.º 45
0
        // ---------------------------------------------------------------------------

        private byte GetBitRate(HeaderInfo Header)
        {
            // Get bit rate from header
            return((byte)Swap32((int)(Header.BitRate >> 16)));
        }
Exemplo n.º 46
0
 void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<FrozenCounter>> values)
 {
     foreach (var pair in values)
     {
         Print(pair.Value, pair.Index);
     }
 }
Exemplo n.º 47
0
 public void Process(HeaderInfo info, IEnumerable <IndexedValue <SecurityStat> > values)
 {
 }
Exemplo n.º 48
0
 void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<AnalogCommandEvent>> values)
 {
     foreach (var pair in values)
     {
         Print(pair.Value, pair.Index);
     }
 }
 protected void FormatHeader(XmlScriptTreeNode p_stnNode, HeaderInfo p_hdrHeader)
 {
     p_stnNode.Text = String.Format("Mod Name: {0}", p_hdrHeader.Title);
 }
Exemplo n.º 50
0
 private static void PrintHeaderInfo(HeaderInfo info)
 {
     Console.WriteLine(String.Format("Header: {0} : {1} : timestamps {2}", info.variation, info.qualifier, info.tsmode));
 }
Exemplo n.º 51
0
 private void ReadHeader(Stream s)
 {
     try
     {
         s.Seek(0, 0);
         DebugLog.PrintLn("Reading Package Summary...");
         HeaderInfo h = new HeaderInfo();
         h.magic = ReadUInt(s);
         if (h.magic != 0x9E2A83C1)
         {
             throw new Exception("Not a valid PCC Package, wrong magic!");
         }
         h.ver1                 = ReadUInt16(s);
         h.ver2                 = ReadUInt16(s);
         h.HeaderLength         = ReadUInt(s);
         h.Group                = ReadUString(s);
         h._offsetFlag          = (uint)s.Position;
         h.Flags                = ReadUInt(s);
         GeneralInfo.compressed = (h.Flags & 0x02000000) != 0;
         DebugLog.PrintLn("Is Compressed : " + GeneralInfo.compressed);
         h.unk1 = ReadUInt(s);
         if (h.unk1 > 1)
         {
             throw new Exception("Not a valid PCC Package, Unknown 1 (offset 30) > 0");
         }
         h.NameCount     = ReadUInt(s);
         h.NameOffset    = ReadUInt(s);
         h.ExportCount   = ReadUInt(s);
         h.ExportOffset  = ReadUInt(s);
         h.ImportCount   = ReadUInt(s);
         h.ImportOffset  = ReadUInt(s);
         h.FreeZoneStart = ReadUInt(s);
         h.FreeZoneEnd   = ReadUInt(s);
         h.unk2          = ReadUInt(s);
         h.unk3          = ReadUInt(s);
         h.unk4          = ReadUInt(s);
         h.GUID          = new byte[16];
         s.Read(h.GUID, 0, 16);
         int count = ReadInt(s);
         DebugLog.PrintLn("Reading Generations...");
         h.Generations = new List <Generation>();
         for (int i = 0; i < count; i++)
         {
             Generation g = new Generation();
             g.ExportCount = ReadUInt(s);
             g.ImportCount = ReadUInt(s);
             g.NetObjCount = ReadUInt(s);
             h.Generations.Add(g);
         }
         DebugLog.PrintLn("Done.");
         h.EngineVersion      = ReadUInt(s);
         h.CookerVersion      = ReadUInt(s);
         h.unk5               = ReadUInt(s);
         h.unk6               = ReadUInt(s);
         h.CompressionFlag    = ReadUInt(s);
         h._offsetCompFlagEnd = (uint)s.Position;
         count    = ReadInt(s);
         h.Chunks = new List <CompressedChunk>();
         if (GeneralInfo.compressed)
         {
             DebugLog.PrintLn("Reading Chunktable...");
             for (int i = 0; i < count; i++)
             {
                 CompressedChunk c = new CompressedChunk();
                 c.UnCompOffset = ReadUInt(s);
                 c.UnCompSize   = ReadUInt(s);
                 c.CompOffset   = ReadUInt(s);
                 c.CompSize     = ReadUInt(s);
                 h.Chunks.Add(c);
             }
             h.DeCompBuffer = new MemoryStream();
             DebugLog.PrintLn("Done.");
         }
         h.unk7 = ReadUInt(s);
         h.unk8 = ReadUInt(s);
         Header = h;
         if (GeneralInfo.compressed)
         {
             ReadChunks(s);
         }
         DebugLog.PrintLn("Done.");
     }
     catch (Exception ex)
     {
         DebugLog.PrintLn("PCCPACKAGE::READHEADER ERROR:\n" + ex.Message);
     }
 }
Exemplo n.º 52
0
        public ActionResult GetReportBirthday([DataSourceRequest] DataSourceRequest request, Hre_ReportBirthdayModel Model)
        {
            HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateFrom", Value = Model.DateFrom != null ? Model.DateFrom.Value : DateTime.Now };
            HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateTo", Value = Model.DateTo != null ? Model.DateTo.Value : DateTime.Now };
            List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 };
            #region Tạo  Template
            if (Model != null && Model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = new Hre_ReportBirthdayModel(),
                    FileName = "Hre_ReportBirthday",
                    OutPutPath = path,
                    HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            #endregion  
            #region Validate

            string message = string.Empty;
            var checkValidate = ValidatorService.OnValidateData<Hre_ReportBirthdayModel>(Model, "Hre_ReportBirthday", ref message);
            if (!checkValidate)
            {
                return Json(message);
            }

            #endregion

            var service = new Hre_ReportServices();
            var actionServices = new ActionService(UserLogin);
            List<object> listObj = new List<object>();
            List<Guid?> OrgIds = new List<Guid?>();
            listObj.Add(Model.DateFrom);
            listObj.Add(Model.DateTo);
            listObj.Add(Model.OrgStructureID);
            listObj.Add(Model.DateQuitFrom);
            listObj.Add(Model.DateQuitTo);
            listObj.Add(Model.WorkPlaceID);
            string status = string.Empty;
            var result = actionServices.GetData<Hre_ReportBirthdayEntity>(listObj, ConstantSql.hrm_hr_sp_get_RptBirthday, ref status).ToList().Translate<Hre_ReportBirthdayModel>();

            if (Model.ExportID != Guid.Empty)
            {
                var fullPath = ExportService.Export(Model.ExportID, result, listHeaderInfo, Model.ExportType);

                return Json(fullPath);
            }


            return Json(result.ToDataSourceResult(request));

        }
Exemplo n.º 53
0
 void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<TimeAndInterval>> values)
 {
     foreach (var pair in values)
     {
         Print(pair.Value, pair.Index);
     }
 }
Exemplo n.º 54
0
 public NodeInfo()
 {
     Sections  = new ObservableCollection <SectionInfo>();
     Header    = new HeaderInfo();
     FillColor = System.Windows.Media.Colors.White;
 }
Exemplo n.º 55
0
 void ISOEHandler.Process(HeaderInfo info, IEnumerable<IndexedValue<SecurityStat>> values)
 {
     foreach (var pair in values)
     {
         Print(pair.Value, pair.Index);
     }
 }
Exemplo n.º 56
0
        /// <summary>
        /// Update or Create document
        /// </summary>
        /// <returns></returns>
        public static Document DocumentCreate(HeaderInfo headerInfo, string filename, string filelocation, int parentUID, string recordtype = "DOCUMENT")
        {
            string documenttype = "WORD"; // Just setting as initial value

            Document document = new Document();

            document.ParentUID = parentUID;

            document.CUID     = filename.Substring(0, 6);
            document.Location = filelocation;
            document.Location = Utils.getReferenceFilePathName(filelocation);

            document.DisplayName    = filename.Substring(10); // Starts after HRM-01-01 HERExxxxxxxx
            document.SimpleFileName = filename.Substring(10); // Starts after HRM-01-01 HERExxxxxxxx
            document.Name           = filename;
            var filesplit = filename.Split('.');

            document.FileExtension = String.Concat("." + filesplit[1]);
            document.FileName      = filename;
            document.RecordType    = recordtype;

            string wordExtensions  = ".doc .docx .dotx";
            string excelExtensions = ".xls .xlsx";
            string pdfExtensions   = ".pdf";

            // Not every extension will be loaded
            //
            if (wordExtensions.Contains(document.FileExtension))
            {
                documenttype = "WORD";
            }

            if (excelExtensions.Contains(document.FileExtension))
            {
                documenttype = "EXCEL";
            }

            if (pdfExtensions.Contains(document.FileExtension))
            {
                documenttype = "PDF";
            }

            document.DocumentType   = documenttype;
            document.SequenceNumber = 1;
            document.IssueNumber    = 1;
            document.SourceCode     = "FCM";
            document.Status         = "ACTIVE";

            document.Skip          = "N";
            document.IsVoid        = "N";
            document.IsProjectPlan = "N";
            document.FKClientUID   = 0;
            document.Comments      = "Web Upload";

            var documentSaveRequest = new DocumentSaveRequest();

            documentSaveRequest.inDocument = document;
            documentSaveRequest.headerInfo = headerInfo;

            var docresp = BUSDocument.DocumentSave(documentSaveRequest);

            if (docresp.response.ReturnCode <= 0)
            {
                LogFile.WriteToTodaysLogFile(docresp.response.Message);
            }

            document = docresp.document;

            return(document);
        }
Exemplo n.º 57
0
 public IAsyncResult BeginClientList(HeaderInfo headerInfo, AsyncCallback callback, object asyncState)
 {
     return(Channel.BeginClientList(headerInfo, callback, asyncState));
 }
Exemplo n.º 58
0
 public void WriteNewVol(string newVol, HeaderInfo hi, List <FSEntry> entries, VolFile.ExplodeProgressCallback callback)
 {
     // the Vol file is massive, about 500 MB
     // I don't want to have to write out the file data section to an actual file and have to read it back in
     // to copy it to the final file. So ~500MB of memory it is
     using (MemoryStream fileData = new MemoryStream(500000000))
     {
         int[]        offsets    = hi.offsets;
         int          nextOffset = hi.fileDataStartPosition;
         byte[]       padBytes   = new byte[0x7ff];
         BinaryWriter bw         = new BinaryWriter(fileData);
         int          fileCount  = 0;
         foreach (FSEntry entry in entries)
         {
             int size = 0;
             if ((entry.tocEntry.flags & TOCFlags_Directory) == 0)
             {
                 // if we recompressed the file, just write its bytes out
                 if (entry.compressedFile != null)
                 {
                     size = entry.compressedFile.Length;
                     bw.Write(entry.compressedFile);
                 }
                 else
                 {
                     // otherwise read it in and write it to the memory
                     byte[] thisFileData = File.ReadAllBytes(entry.diskFile);
                     size = thisFileData.Length;
                     bw.Write(thisFileData);
                 }
                 // write the pad bytes
                 int remainder = 0x800 - (size % 0x800);
                 if (remainder == 0x800)
                 {
                     remainder = 0;
                 }
                 bw.Write(padBytes, 0, remainder);
                 callback(String.Format("Wrote {0} at 0x{1:x}, padded with 0x{2:x} bytes", entry.name, nextOffset, remainder));
                 offsets[2 + fileCount] = nextOffset | remainder;
                 nextOffset            += size + remainder;
                 Debug.Assert((nextOffset & 0x7FF) == 0);
                 ++fileCount;
             }
         }
         bw.Flush();
         fileData.Position = 0;
         Debug.Assert((2 + fileCount) == (offsets.Length - 1));
         offsets[2 + fileCount] = nextOffset; // last one is the file size
         using (FileStream newVolFile = new FileStream(newVol, FileMode.Create, FileAccess.Write))
         {
             byte[] offBytes = new byte[offsets.Length * sizeof(int)];
             Buffer.BlockCopy(offsets, 0, offBytes, 0, offBytes.Length);
             // header
             newVolFile.Write(hi.header, 0, hi.header.Length);
             // offsets
             newVolFile.Write(offBytes, 0, offBytes.Length);
             // padding for offsets
             newVolFile.Write(padBytes, 0, offsets[0] & 0x7ff);
             // toc
             hi.toc.Position = 0;
             StreamUtils.Copy(hi.toc, newVolFile, offBytes);
             // toc padding
             newVolFile.Write(padBytes, 0, offsets[1] & 0x7ff);
             // file data
             StreamUtils.Copy(fileData, newVolFile, offBytes);
         }
     }
 }
Exemplo n.º 59
0
		private bool parse () {
			bool error = false;
			if ( this.headers.Count>0 ) {
				return !error;
			}
			System.String line = System.String.Empty;
			this.message.SeekPoint ( this.startpoint );
			this.message.Encoding = anmar.SharpMimeTools.SharpMimeHeader.default_encoding;
			for ( line=this.message.ReadUnfoldedLine(); line!=null ; line=this.message.ReadUnfoldedLine() ) {
				if ( line.Length == 0 ) {
					this.endpoint = this.message.Position_preRead;
					this.startbody = this.message.Position;
					this.message.ReadLine_Undo(line);
					break;
				} else {
					String [] headerline = line.Split ( new Char[] {':'}, 2);
					if ( headerline.Length == 2 ) {
						headerline[1] = headerline[1].TrimStart(new Char[] {' '});
						if ( this.headers.Contains ( headerline[0]) ) {
							this.headers[headerline[0]] = System.String.Concat(this.headers[headerline[0]], "\r\n", headerline[1]);
						} else {
							this.headers.Add (headerline[0].ToLower(), headerline[1]);
						}
					}
				}
			}
			this.mt = new HeaderInfo ( this.headers );
			return !error;
		}
Exemplo n.º 60
0
		protected void FormatHeader(XmlScriptTreeNode p_stnNode, HeaderInfo p_hdrHeader)
		{
			p_stnNode.Text = String.Format("Mod Name: {0}", p_hdrHeader.Title);
		}