Exemplo n.º 1
0
 public static SettingSet GetExchangeDataChange(string exchangeCode, GroupChangeType type, List<Guid> memberIds, List<Guid> accounts, List<Guid> instruments)
 {
     SettingSet set = new SettingSet();
     string xmlMemberIds = ExchangeData.GetXmlIds(memberIds);
     string xmlAccountIds = ExchangeData.GetXmlIds(accounts);
     string xmlInstrumentIds = ExchangeData.GetXmlIds(instruments);
     using (SqlConnection con = DataAccess.GetInstance(exchangeCode).GetSqlConnection())
     {
         using (SqlCommand command = con.CreateCommand())
         {
             command.CommandText = "[dbo].[GetInitDataChangeForManager]";
             command.CommandType = CommandType.StoredProcedure;
             command.Parameters.Add(new SqlParameter("@type", type));
             command.Parameters.Add(new SqlParameter("@xmlMemberIds", xmlMemberIds));
             command.Parameters.Add(new SqlParameter("@xmlAccountIds", xmlAccountIds));
             command.Parameters.Add(new SqlParameter("@xmlInstrumentIds", xmlInstrumentIds));
             using (SqlDataReader reader = command.ExecuteReader())
             {
                 if (type == GroupChangeType.Account)
                 {
                     set = SettingsSetHelper.GetExchangeDataChangeByAccountChange(reader);
                 }
                 else
                 {
                     set = SettingsSetHelper.GetExchangeDataChangeByInstrumentChange(reader);
                 }
             }
         }
     }
     return set;
 }
Exemplo n.º 2
0
        public static bool CheckPermission(Guid userId, Guid groupId, GroupChangeType type, string exchangeCode)
        {
            bool hasPermission = false;
            using (SqlConnection con = DataAccess.GetInstance().GetSqlConnection())
            {
                using (SqlCommand command = con.CreateCommand())
                {
                    command.CommandText = "[dbo].[GetDataTargetPermission]";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@userId", userId));
                    command.Parameters.Add(new SqlParameter("@exchangeCode", exchangeCode));
                    command.Parameters.Add(new SqlParameter("@type", type));
                    command.Parameters.Add(new SqlParameter("@groupId", groupId));
                    using (SqlDataReader reader = command.ExecuteReader())
                    {
                        if (reader.Read())
                        {
                            hasPermission = (bool)reader["Status"];
                        }

                    }
                }
            }

            return hasPermission;
        }
Exemplo n.º 3
0
 internal GroupPropertyChangedEventArgs(object newStateObject, GroupChangeType type)
 {
     _NewStateObject = newStateObject;
     _Type           = type;
 }
Exemplo n.º 4
0
 internal GroupPropertyChangedEventArgs(object newStateObject, GroupChangeType type)
 {
     _NewStateObject = newStateObject;
     _Type = type;
 }