Exemple #1
0
 public DataTable GetUserList(IInfo info, int intOrganization)
 {
     using (Dao dao = this.GetDbAccess(info))
     {
         return dao.User.SelectOrganization(intOrganization);
     }
 }
Exemple #2
0
 public DataTable GetOrganizationList(IInfo info)
 {
     using (Dao dao = this.GetDbAccess(info))
     {
         return dao.Organization.SelectAll();
     }
 }
 /// <summary>
 /// Constructs a default HTTP requester with the information
 /// presented in the info object.
 /// </summary>
 /// <param name="info">The information to use.</param>
 public DefaultRequester(IInfo info)
 {
     _buffer = new Byte[BufferSize];
     _timeOut = new TimeSpan(0, 0, 0, 45);
     _headers = new Dictionary<String, String>();
     _headers.Add("User-Agent", info.Agent);
 }
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="plugIn">
 /// Information about the plug-in that the exception relates to.
 /// </param>
 /// <param name="message">
 /// A single-line message describing the exception.
 /// </param>
 /// <param name="innerMessage">
 /// Additional details about the exception.
 /// </param>
 public Exception(IInfo         plugIn,
     string        message,
     MultiLineText innerMessage)
     : base(message, innerMessage)
 {
     this.plugIn = plugIn;
 }
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="plugIn">
 /// Information about the plug-in that the exception relates to.
 /// </param>
 /// <param name="message">
 /// A single-line message describing the exception.  The message may
 /// refer to arguments, e.g., "{0}".
 /// </param>
 /// <param name="messageArgs">
 /// Arguments to be inserted into the message.
 /// </param>
 public Exception(IInfo           plugIn,
     string          message,
     params object[] messageArgs)
     : base(string.Format(message, messageArgs))
 {
     this.plugIn = plugIn;
 }
Exemple #6
0
 public DataTable GetUserInfo(IInfo info, string strUserID)
 {
     using (Dao dao = this.GetDbAccess(info))
     {
         return dao.User.SelectUser(strUserID);
     }
 }
Exemple #7
0
 public DataTable GetUserInfo(IInfo info, string strUserID, string strPassword)
 {
     using (Dao dao = this.GetDbAccess(info))
     {
         string strCryptionPassword = BizCommon.DataEncryption(strPassword);
         return dao.User.SelectUser(strUserID, strCryptionPassword);
     }
 }
Exemple #8
0
        /// <summary>
        /// データベースアクセスクラスを取得します。
        /// </summary>
        /// <param name="iInfo">情報インターフェース</param>
        /// <returns>データベースアクセスクラスのインスタンス</returns>
        protected Dao GetDbAccess(IInfo iInfo)
        {
            ConnectionStringSettings setting = iInfo.GetConnectionString();

            Dao db = new Dao(new DBLog(iInfo), setting);
            db.Connect();

            return db;
        }
 public async Task<int> DeleteAsync(IInfo info)
 {
     try
     {
         return await Repository.DeleteAsync<InfoEntity>(AutoMapper.Mapper.Map<InfoEntity>(info));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #10
0
        public BizResult DeleteUser(IInfo info, string strUserID)
        {
            using (Dao dao = this.GetDbAccess(info))
            {
                dao.BeginTransaction();
                if(dao.User.DeleteUser(strUserID) == 1)
                {
                    dao.CommitTransaction();
                    return new BizResult(true, "ユーザーを削除しました。");
                }
                else
                {
                    return new BizResult(false, "ユーザーの削除に失敗しました。");
                }

            }
        }
Exemple #11
0
        public BizResult InsertUser(IInfo info, string strUserID, int intOrganizationCD, string strUserName, string strPassword,
            bool bolAuthAdmin, bool bolAuthRequestNewMember, bool bolAuthApprovalNewMember)
        {
            using (Dao dao = this.GetDbAccess(info))
            {
                dao.BeginTransaction();

                DataTable dtUser = dao.User.SelectUser(strUserID);
                if (0 < dtUser.Rows.Count)
                {
                    return new BizResult(false, "登録対象のユーザーが既に存在します。");
                }

                string strCryptionPassword = null;
                strCryptionPassword = BizCommon.DataEncryption(strPassword);

                DataTable dtInsert = dao.User.CreateUserDataTable();
                DataRow drInsert = dtInsert.NewRow();
                drInsert["USER_ID"] = strUserID;
                drInsert["ORGANIZATION_CD"] = intOrganizationCD;
                drInsert["USER_NAME"] = strUserName;
                drInsert["PASSWORD"] = strCryptionPassword;
                drInsert["AUTH_ADMIN"] = bolAuthAdmin;
                drInsert["AUTH_REQUEST_NEW_MEMBER"] = bolAuthRequestNewMember;
                drInsert["AUTH_APPROVAL_NEW_MEMBER"] = bolAuthApprovalNewMember;

                if (dao.User.InsertUser(drInsert) == 1)
                {
                    dao.CommitTransaction();
                    return new BizResult(true, "ユーザー情報を登録しました。");
                }
                else
                {
                    return new BizResult(false, "ユーザー情報の登録に失敗しました。");
                }
            }
        }
Exemple #12
0
 public bool IsEnabled(IInfo info)
 => info.FileState.Opened;
Exemple #13
0
 public static string PrintInfo(IInfo info)
 {
     return(info.GetName() + info.GetAge());
 }
 public void Add(IInfo info)
 {
     Items.Add(info);
 }
Exemple #15
0
 /// <summary>
 /// Application term (xy)
 /// </summary>
 /// <param name="left">The first term in the application</param>
 /// <param name="right">The second term in the application</param>
 public App(IInfo info, ITerm left, ITerm right)
 {
     Info  = info;
     Left  = left;
     Right = right;
 }
		internal virtual int ReadSmbQueryFileStandardInfoWireFormat(byte[] buffer, int bufferIndex
			)
		{
			int start = bufferIndex;
			SmbQueryFileStandardInfo info = new SmbQueryFileStandardInfo
				(this);
			info.AllocationSize = ReadInt8(buffer, bufferIndex);
			bufferIndex += 8;
			info.EndOfFile = ReadInt8(buffer, bufferIndex);
			bufferIndex += 8;
			info.NumberOfLinks = ReadInt4(buffer, bufferIndex);
			bufferIndex += 4;
			info.DeletePending = (buffer[bufferIndex++] & unchecked(0xFF)) > 0;
			info.Directory = (buffer[bufferIndex++] & unchecked(0xFF)) > 0;
			this.Info = info;
			return bufferIndex - start;
		}
		internal virtual int ReadSmbQueryFileBasicInfoWireFormat(byte[] buffer, int bufferIndex
			)
		{
			int start = bufferIndex;
			SmbQueryFileBasicInfo info = new SmbQueryFileBasicInfo
				(this);
			info.CreateTime = ReadTime(buffer, bufferIndex);
			bufferIndex += 8;
			info.LastAccessTime = ReadTime(buffer, bufferIndex);
			bufferIndex += 8;
			info.LastWriteTime = ReadTime(buffer, bufferIndex);
			bufferIndex += 8;
			info.ChangeTime = ReadTime(buffer, bufferIndex);
			bufferIndex += 8;
			info.Attributes = ReadInt2(buffer, bufferIndex);
			bufferIndex += 2;
			this.Info = info;
			return bufferIndex - start;
		}
Exemple #18
0
 public True(IInfo info)
 {
     Info = info;
 }
Exemple #19
0
 internal static IInfo Create(ToastNotificationsBase toastNotificationsBase) => _info ?? (_info = new Info(toastNotificationsBase));
 public ErrorMessage(IInfo p_info)
 {
     m_info = p_info;
 }
Exemple #21
0
 public Billing(IInfo <CallInfo> info)
 {
     _info = info;
 }
Exemple #22
0
 public Proj(IInfo info, ITerm term, string s)
 {
     Info  = info;
     Term  = term;
     Label = s;
 }
 public static void UpdateInfo(Type infoType, IInfo info)
 {
     Infoes[infoType] = info;
 }
Exemple #24
0
 public AfplTemplateChooser(IInfo info) : base("afpl", info)
 {
 }
Exemple #25
0
 protected Game(IInfo <string, T> info)
 {
     Info        = info;
     SpriteBatch = new SpriteBatch(GraphicsDevice);
 }
Exemple #26
0
 public False(IInfo info)
 {
     Info = info;
 }
 public void Add(IInfo file)
 {
     Items.Add(file);
 }
Exemple #28
0
 public StreamProgressInfo(IInfo file)
 {
     this.info = file;
 }
Exemple #29
0
 public KfplTemplateChooser(IInfo info) : base("kfpl", info)
 {
 }
Exemple #30
0
 public InfoController(IInfo info)
 {
     _info = info;
 }
Exemple #31
0
        protected InfoDecorator(IInfo info)
        {
            this.info = info;

            Conversation = new ObservableCollection <Comment>();
        }
Exemple #32
0
 public Fix(IInfo info, ITerm term)
 {
     Info = info;
     Term = term;
 }
Exemple #33
0
 /// <summary>
 /// ビジネスロジック開始ログ出力
 /// </summary>
 /// <param name="info">情報オブジェクト</param>
 /// <param name="mb">メソッド情報</param>
 protected void WriteBizStartLog(IInfo info, MethodBase mb)
 {
     //Log.I(info, "ビジネスロジック開始", mb.ToString());
 }
 //---------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance.
 /// </summary>
 /// <param name="plugIn">
 /// Information about the plug-in that the exception relates to.
 /// </param>
 /// <param name="message">
 /// A single-line message describing the exception.
 /// </param>
 public Exception(IInfo  plugIn,
     string message)
     : base(message)
 {
     this.plugIn = plugIn;
 }
Exemple #35
0
 public PointInfo(GENERIC_SYSTEM_PARAMETERS.POINTS.POINT point, string pos, string orient, PointLocation src, IInfo srcI)
 {
     this.ptSrc    = src;
     this.Point    = point;
     this.position = pos;
     this.orient   = orient;
     this.srcStr   = srcI;
     check();
 }
Exemple #36
0
        internal IEnumerator <object> UpdateDo()
        {
            yield return(new WaitForSeconds(0.05f));

            ActionStatus.text = ActionQueue.instance.current == null ? "" : $"{ActionQueue.instance.current.GetType()}";
            ToolStatus.text   = $"{MoveItTool.ToolState} ({MoveItTool.MT_Tool}.{MoveItTool.AlignToolPhase}), POProc:{MoveItTool.POProcessing}";

            SelectedLarge.text = $"Objects Selected: {Action.selection.Count}";
            ushort[] types = new ushort[8];
            foreach (Instance instance in Action.selection)
            {
                if (instance is MoveableBuilding)
                {
                    types[0]++;
                }
                else if (instance is MoveableProp)
                {
                    PropInfo info = PropManager.instance.m_props.m_buffer[instance.id.Prop].Info;
                    if (info.m_isDecal)
                    {
                        types[2]++;
                    }
                    else if (Filters.IsSurface(info))
                    {
                        types[3]++;
                    }
                    else
                    {
                        types[1]++;
                    }
                }
                else if (instance is MoveableTree)
                {
                    types[4]++;
                }
                else if (instance is MoveableProc)
                {
                    types[5]++;
                }
                else if (instance is MoveableNode)
                {
                    types[6]++;
                }
                else if (instance is MoveableSegment)
                {
                    types[7]++;
                }
                else
                {
                    throw new Exception($"Instance is invalid type (<{instance.GetType()}>)");
                }
            }
            SelectedSmall.text = $"B:{types[0]}, P:{types[1]}, D:{types[2]}, S:{types[3]}, T:{types[4]}, PO:{types[5]}, N:{types[6]}, S:{types[7]}\n ";

            // End with updating the hovered item
            if (id == null)
            {
                yield break;
            }
            if (id == InstanceID.Empty)
            {
                lastId = id;
                HoverLarge.textColor = new Color32(255, 255, 255, 255);
                yield break;
            }
            if (lastId == id)
            {
                yield break;
            }

            HoverLarge.textColor = new Color32(127, 217, 255, 255);
            HoverLarge.text      = "";
            HoverSmall.text      = "";

            if (id.Building > 0)
            {
                BuildingInfo info = BuildingManager.instance.m_buildings.m_buffer[id.Building].Info;
                HoverLarge.text    = $"B:{id.Building}  {info.name}";
                HoverLarge.tooltip = info.name;
                HoverSmall.text    = $"{info.GetType()} ({info.GetAI().GetType()})\n{info.m_class.name}\n({info.m_class.m_service}.{info.m_class.m_subService})";
            }
            else if (id.Prop > 0)
            {
                string   type = "P";
                PropInfo info = PropManager.instance.m_props.m_buffer[id.Prop].Info;
                if (info.m_isDecal)
                {
                    type = "D";
                }
                HoverLarge.text    = $"{type}:{id.Prop}  {info.name}";
                HoverLarge.tooltip = info.name;
                HoverSmall.text    = $"{info.GetType()}\n{info.m_class.name}";
            }
            else if (id.NetLane > 0)
            {
                IInfo info = MoveItTool.PO.GetProcObj(id.NetLane).Info;
                HoverLarge.text    = $"PO:{id.NetLane}  {info.Name}";
                HoverLarge.tooltip = info.Name;
                HoverSmall.text    = $"\n";
            }
            else if (id.Tree > 0)
            {
                TreeInfo info = TreeManager.instance.m_trees.m_buffer[id.Tree].Info;
                HoverLarge.text    = $"T:{id.Tree}  {info.name}";
                HoverLarge.tooltip = info.name;
                HoverSmall.text    = $"{info.GetType()}\n{info.m_class.name}";
            }
            else if (id.NetNode > 0)
            {
                NetInfo info = NetManager.instance.m_nodes.m_buffer[id.NetNode].Info;
                HoverLarge.text    = $"N:{id.NetNode}  {info.name}";
                HoverLarge.tooltip = info.name;
                HoverSmall.text    = $"{info.GetType()} ({info.GetAI().GetType()})\n{info.m_class.name}";
            }
            else if (id.NetSegment > 0)
            {
                NetInfo info = NetManager.instance.m_segments.m_buffer[id.NetSegment].Info;
                HoverLarge.text    = $"S:{id.NetSegment}  {info.name}";
                HoverLarge.tooltip = info.name;
                HoverSmall.text    = $"{info.GetType()} ({info.GetAI().GetType()})\n{info.m_class.name}";
            }

            lastId = id;
        }
 /// <summary>
 /// Include the default http/https requester for external resources. Returns the same instance.
 /// </summary>
 /// <typeparam name="TConfiguration">Configuration or derived.</typeparam>
 /// <param name="configuration">The configuration to modify.</param>
 /// <param name="agent">User-Agent information if any.</param>
 /// <returns>The same object, for chaining.</returns>
 public static TConfiguration WithDefaultRequester <TConfiguration>(this TConfiguration configuration, IInfo agent = null)
     where TConfiguration : Configuration
 {
     configuration.Register(new DefaultRequester(agent ?? DefaultInfo.Instance));
     return(configuration);
 }
		static void PrintInfo(IInfo item)
		{
			Console.WriteLine("Name: {0}, Age: {1}", item.GetName(), item.GetAge());
		}
Exemple #39
0
 public Bind(IInfo info, string name, IBinding binding)
 {
     Name    = name;
     Info    = info;
     Binding = binding;
 }
Exemple #40
0
        public void Test_GetNearObjects()
        {
            //initialize
            IInfo       info = A.Fake <IInfo>();
            IRandomTest rnd  = A.Fake <IRandomTest>();
            IProducerConsumerMessages <string> producerConsumer = A.Fake <IProducerConsumerMessages <string> >();

            int[] values = new int[50];
            ITile[,] tiles = new ITile[4, 4];

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    ITile tile = A.Fake <ITile>();
                    tiles[i, j]        = tile;
                    tile.DynamicObject = null;
                    ReaderWriterLockSlim readerWriterLock = new ReaderWriterLockSlim();
                    A.CallTo(() => tile.Lock).ReturnsLazily(() => readerWriterLock);
                }
            }

            var positions = new List <(int, int)> {
                (0, 0), (1, 0), (2, 1), (3, 3)
            };

            foreach (var t in positions)
            {
                int            x       = t.Item1;
                int            y       = t.Item2;
                IDynamicObject fakeObj = A.Fake <IDynamicObject>();
                A.CallTo(() => fakeObj.X).ReturnsLazily(() => x);
                A.CallTo(() => fakeObj.Y).ReturnsLazily(() => y);
                A.CallTo(() => fakeObj.Strength).Returns(2);
                A.CallTo(() => tiles[x, y].DynamicObject).ReturnsLazily(() => fakeObj);
            }

            var obj = A.Fake <IDynamicObject>();

            A.CallTo(() => obj.X).Returns(1);
            A.CallTo(() => obj.Y).Returns(1);
            A.CallTo(() => tiles[1, 1].DynamicObject).ReturnsLazily(() => obj);

            A.CallTo(() => info.Length).Returns(4);
            A.CallTo(() => info.Hight).Returns(4);

            AutoResetEvent autoResetEvent = new AutoResetEvent(false);


            IBoard board = new Board();

            board.TestBoard(tiles, info, rnd, producerConsumer);

            //act
            Thread thr1 = new Thread(() => { tiles[2, 1].Lock.EnterWriteLock(); autoResetEvent.Set();  Thread.Sleep(100); tiles[2, 1].Lock.ExitWriteLock(); });

            thr1.Start();

            autoResetEvent.WaitOne();


            List <IDynamicObject> l = board.GetNearObjects(obj.X, obj.Y, 1);

            //assert
            Assert.AreEqual(3, l.Count);
        }
Exemple #41
0
 public BfplTemplateChooser(IInfo info) : base("bfpl", info)
 {
 }
Exemple #42
0
        public BizResult UpdateUser(IInfo info, string strUserID, int intOrganizationCD, string strUserName, string strPassword, 
            bool bolAuthAdmin, bool bolAuthRequestNewMember, bool bolAuthApprovalNewMember)
        {
            using (Dao dao = this.GetDbAccess(info))
            {
                dao.BeginTransaction();

                DataTable dtUser = dao.User.SelectUser(strUserID);
                if(dtUser.Rows.Count == 0)
                {
                    return new BizResult(false, "更新対象のユーザーの取得に失敗しました。");
                }

                string strCryptionPassword = null;
                if(string.IsNullOrEmpty(strPassword) == false)
                {
                    strCryptionPassword = BizCommon.DataEncryption(strPassword);
                }
                else
                {
                    strCryptionPassword = dtUser.Rows[0]["PASSWORD"] as string;
                }

                DataTable dtUpdate = dao.User.CreateUserDataTable();
                DataRow drUpdate = dtUpdate.NewRow();
                drUpdate["USER_ID"] = strUserID;
                drUpdate["ORGANIZATION_CD"] = intOrganizationCD;
                drUpdate["USER_NAME"] = strUserName;
                drUpdate["PASSWORD"] = strCryptionPassword;
                drUpdate["AUTH_ADMIN"] = bolAuthAdmin;
                drUpdate["AUTH_REQUEST_NEW_MEMBER"] = bolAuthRequestNewMember;
                drUpdate["AUTH_APPROVAL_NEW_MEMBER"] = bolAuthApprovalNewMember;

                if(dao.User.UpdateUser(drUpdate) == 1)
                {
                    dao.CommitTransaction();
                    return new BizResult(true, "ユーザー情報を更新しました。");
                }
                else
                {
                    return new BizResult(false, "ユーザー情報の更新に失敗しました。");
                }
            }
        }
Exemple #43
0
        public void Test_TryCreate()
        {
            //initialize
            IInfo       info = A.Fake <IInfo>();
            IRandomTest rnd  = A.Fake <IRandomTest>();
            IProducerConsumerMessages <string> producerConsumer = A.Fake <IProducerConsumerMessages <string> >();

            int length = 4;
            int hight  = 4;

            int[] values = new int[50];
            ITile[,] tiles = new ITile[length, hight];

            for (int i = 0; i < length; i++)
            {
                for (int j = 0; j < hight; j++)
                {
                    ITile tile = A.Fake <ITile>();
                    tiles[i, j]        = tile;
                    tile.DynamicObject = null;
                    ReaderWriterLockSlim readerWriterLock = new ReaderWriterLockSlim();
                    A.CallTo(() => tile.Lock).ReturnsLazily(() => readerWriterLock);
                }
            }

            var positions = new List <(int, int)> {
                (0, 0)
            };

            foreach (var t in positions)
            {
                int            x       = t.Item1;
                int            y       = t.Item2;
                IDynamicObject fakeObj = A.Fake <IDynamicObject>();
                A.CallTo(() => fakeObj.X).ReturnsLazily(() => x);
                A.CallTo(() => fakeObj.Y).ReturnsLazily(() => y);
                A.CallTo(() => fakeObj.Strength).Returns(2);
                A.CallTo(() => tiles[x, y].DynamicObject).ReturnsLazily(() => fakeObj);
            }


            A.CallTo(() => info.Length).Returns(length);
            A.CallTo(() => info.Hight).Returns(hight);



            IBoard board = new Board();

            board.TestBoard(tiles, info, rnd, producerConsumer);

            //act
            bool   ans1 = false, ans2 = false;
            Thread t1 = new Thread(() => ans1 = board.TryCreate(1, 2) == null);
            Thread t2 = new Thread(() => ans2 = board.TryCreate(2, 2) == null);

            t1.Start(); t2.Start();
            t1.Join(); t2.Join();

            //Assert, only one object should be created
            Assert.AreEqual(true, ans1 ^ ans2);
        }
 //---------------------------------------------------------------------
 private void AssertPlugInIsExpected(IInfo       plugIn,
     List<IInfo> expectedPlugIns)
 {
     bool found = false;
     foreach (IInfo expectedPlugIn in expectedPlugIns) {
         if (expectedPlugIn.Name == plugIn.Name) {
             Assert.AreEqual(expectedPlugIn.InterfaceType,
                             plugIn.InterfaceType);
             Assert.AreEqual(expectedPlugIn.ImplementationName,
                             plugIn.ImplementationName);
             found = true;
             break;
         }
     }
     Assert.IsTrue(found);
 }
Exemple #45
0
 static void PrintInfo(IInfo i)
 {
     Console.WriteLine("Name: {0}, Age: {1}", i.GetName(), i.GetAge());
 }
Exemple #46
0
 /// <summary>
 /// ビジネスロジック終了ログ出力
 /// </summary>
 /// <param name="info">情報オブジェクト</param>
 /// <param name="mb">メソッド情報</param>
 protected void WriteBizEndLog(IInfo info, MethodBase mb)
 {
     //Log.I(info, "ビジネスロジック終了", mb.ToString());
 }
Exemple #47
0
 public Control GetControl(IInfo info)
 => new SettingsControl(info.Timetable, info);
Exemple #48
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="info">情報オブジェクト</param>
 public DBLog(IInfo info)
 {
     this.iInfo = info;
 }
        /// <summary>
        /// Creates a spatial reference object given its Well-known text representation.
        /// The output object may be either a <see cref="IGeographicCoordinateSystem"/> or
        /// a <see cref="IProjectedCoordinateSystem"/>.
        /// </summary>
        /// <param name="WKT">The Well-known text representation for the spatial reference</param>
        /// <returns>The resulting spatial reference object</returns>
        public ICoordinateSystem CreateFromWkt(string WKT)
        {
            IInfo info = CoordinateSystemWktReader.Parse(WKT);

            return(info as ICoordinateSystem);
        }
 /// <summary>
 /// 帖子是否(可以操作??)发布
 /// </summary>
 /// <param name="info">帖子</param>
 /// <returns>帖子是否可以操作</returns>
 public bool IsValid(IInfo info)
 {
     return info.IsPublish;
 }
Exemple #51
0
 public abstract void Update(GameTime gameTime, IInfo <string, T> info);