예제 #1
0
        /// <summary>
        /// コンストラクタです。
        /// 環境変数を設定します。
        /// </summary>
        public CsvToUserList(Entity.Configure EntityConfig)
        {
            CSS.Library.Timecard.Entity.Config.Properties props = new CSS.Library.Timecard.Entity.Config.Properties();

            props.User       = EntityConfig.User;
            props.Password   = EntityConfig.Password;
            props.UriAdress  = EntityConfig.UriAdress;
            props.FolderName = EntityConfig.FolderName;
            props.Domain     = EntityConfig.Domain;

            CsvToList csvList = new CsvToList();

            SharedFile smbUserList = new SharedFile(props);

            if (smbUserList.SmbExists("UserList.txt"))
            {
                _Users = csvList.Users(smbUserList.SmbReader("UserList.txt"));
            }
        }
예제 #2
0
        private void InitCalendar()
        {
            if (!_SmbRecordFile.SmbExists(_FileName.ToString()))
            {
                List <CsvTimeRecord.Record> Records = new List <CsvTimeRecord.Record>();

                int days = new DateTime(_NowTime.Year, _NowTime.Month, 1).AddMonths(1).AddDays(-1).Day;

                for (int i = 1; i <= days; i++)
                {
                    Records.Add(new CsvTimeRecord.Record
                    {
                        Date = new DateTime(_NowTime.Year, _NowTime.Month, i).ToString("yyyy/MM/dd")
                    });
                }

                using (TextWriter txtWrite = _SmbRecordFile.SmbWriter(_FileName.ToString()))
                {
                    _CsvList.WriteCsv(txtWrite, Records);
                }
            }
        }