Пример #1
0
 public Operation(OperationArea area, OperationMethod method, string value, object value2 = null)
 {
     Area = area;
     Method = method;
     Value = value;
     Value2 = value2;
 }
		public static int Operate(int a, int b, OperationMethod om){
			if (om == OperationMethod.Set)
				return b;
			if (om == OperationMethod.Add)
				return a + b;
			if (om == OperationMethod.Subtract)
				return a - b;
			if (om == OperationMethod.Multiply)
				return a * b;
			if (om == OperationMethod.Divide)
				return a / b;
			return a;
		}
		public static Vector3 Operate(Vector3 a, Vector3 b, OperationMethod om){
			if (om == OperationMethod.Set)
				return b;
			if (om == OperationMethod.Add)
				return a + b;
			if (om == OperationMethod.Subtract)
				return a - b;
			if (om == OperationMethod.Multiply)
				return Vector3.Scale(a, b);
			if (om == OperationMethod.Divide)
				return new Vector3( (a).x/(b).x, (a).y/(b).y, (a).z/(b).z );
			return a;
		}
        public static string GetOperationString(OperationMethod om)
        {
            if (om == OperationMethod.Set)
                return " = ";

            if (om == OperationMethod.Add)
                return " += ";

            if (om == OperationMethod.Subtract)
                return " -= ";

            if (om == OperationMethod.Multiply)
                return " *= ";

            if (om == OperationMethod.Divide)
                return " /= ";

            return string.Empty;
        }
Пример #5
0
 public static float Operate(float a, float b, OperationMethod om, float delta = 1f)
 {
     if (om == OperationMethod.Set)
     {
         return(b);
     }
     if (om == OperationMethod.Add)
     {
         return(a + (b * delta));
     }
     if (om == OperationMethod.Subtract)
     {
         return(a - (b * delta));
     }
     if (om == OperationMethod.Multiply)
     {
         return(a * (b * delta));
     }
     if (om == OperationMethod.Divide)
     {
         return(a / (b * delta));
     }
     return(a);
 }
Пример #6
0
 public static Vector3 Operate(Vector3 a, Vector3 b, OperationMethod om)
 {
     if (om == OperationMethod.Set)
     {
         return(b);
     }
     if (om == OperationMethod.Add)
     {
         return(a + b);
     }
     if (om == OperationMethod.Subtract)
     {
         return(a - b);
     }
     if (om == OperationMethod.Multiply)
     {
         return(Vector3.Scale(a, b));
     }
     if (om == OperationMethod.Divide)
     {
         return(new Vector3((a).x / (b).x, (a).y / (b).y, (a).z / (b).z));
     }
     return(a);
 }
Пример #7
0
 public static int Operate(int a, int b, OperationMethod om)
 {
     if (om == OperationMethod.Set)
     {
         return(b);
     }
     if (om == OperationMethod.Add)
     {
         return(a + b);
     }
     if (om == OperationMethod.Subtract)
     {
         return(a - b);
     }
     if (om == OperationMethod.Multiply)
     {
         return(a * b);
     }
     if (om == OperationMethod.Divide)
     {
         return(a / b);
     }
     return(a);
 }
Пример #8
0
Файл: Log.cs Проект: dnzn/Senko
 void Initialize(string name, OperationMethod operation)
 {
     Name      = name;
     StartTime = DateTime.Now;
     Operation = (operation != OperationMethod.PreviousOperation) ? operation.ToString() : "";
 }
Пример #9
0
Файл: Log.cs Проект: dnzn/Senko
 public Record(string name, OperationMethod operation)
 {
     Initialize(name, operation);
 }
Пример #10
0
 public void Update(OperationMethod operationMethod)
 {
     _operationMethodRepository.Update(operationMethod);
 }
Пример #11
0
        public object Update(string providerName, string connectionString, string dataTableName, string commandText, string commandType, OperationMethod queryMode, string olderSnapshotXml, string newerSnapshotXml, string snapshotEncodingName, Dictionary <string, string[]> primaryKeys, IDictionary <string, IDictionary <string, string> > foreignKeys)
        {
            Result result = new Result();

            DbConnection connection = this.getDbConnection(providerName);

            connection.ConnectionString = connectionString;

            DbDataAdapter adapter = this.getDbDataAdapter(providerName);

            DbCommand selectCommand = connection.CreateCommand();

            selectCommand.CommandText = commandText;
            selectCommand.CommandType = this.getDbCommandType(commandType);

            adapter.SelectCommand = selectCommand;

            DbCommandBuilder commandBuilder = this.getDbCommandBuilder(providerName);

            commandBuilder.DataAdapter = adapter;

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

            Encoding snapshotEncoding = String.IsNullOrEmpty(snapshotEncodingName) ? Encoding.Default : Encoding.GetEncoding(snapshotEncodingName);

            DataSet dataSetOlderSnapshot = new DataSet();

            if (!String.IsNullOrEmpty(olderSnapshotXml))
            {
                dataSetOlderSnapshot.ReadXml(new System.IO.MemoryStream(snapshotEncoding.GetBytes(olderSnapshotXml)), XmlReadMode.ReadSchema);
            }

            dataSetOlderSnapshot.AcceptChanges();

            DataSet dataSetNewerSnapshot = new DataSet();

            if (!String.IsNullOrEmpty(newerSnapshotXml))
            {
                dataSetNewerSnapshot.ReadXml(new System.IO.MemoryStream(snapshotEncoding.GetBytes(newerSnapshotXml)), XmlReadMode.ReadSchema);
            }

            dataSetNewerSnapshot.AcceptChanges();

            DataSet dataSetCurrent = new DataSet(); //dataSetNewerSnapshot.Clone();

            adapter.Fill(dataSetCurrent);

            dataSetCurrent.Tables[0].TableName = dataTableName;

            dataSetCurrent.AcceptChanges();

            //Comparison machinism to be implemented below:
            //

            IList <IDictionary <string, object> > snapshotNewer, snapshotOlder;
            IList <IDictionary <string, object> > added, deleted, updated;

            //string dataTableName;

            List <string> primaryKeyNames;

            SnapshotHelper snapshotHelper;

            //DataRow row;

            for (int i = 0; i < dataSetNewerSnapshot.Tables.Count; i++)
            {
                //dataTableName = dataSetNewerSnapshot.Tables[i].TableName;

                if (dataSetNewerSnapshot.Tables[i].TableName.ToLower() == dataTableName.ToLower())
                {
                    primaryKeyNames = new List <string>();

                    for (int j = 0; j < dataSetNewerSnapshot.Tables[i].PrimaryKey.Length; j++)
                    {
                        primaryKeyNames.Add(dataSetNewerSnapshot.Tables[i].PrimaryKey[j].ColumnName);
                    }

                    if ((primaryKeys != null) && (primaryKeys.ContainsKey(dataTableName)))
                    {
                        primaryKeyNames = new List <string>(primaryKeys[dataTableName]);
                    }

                    snapshotNewer = Utility.ConvertDataTableToList(dataSetNewerSnapshot.Tables[dataTableName]);

                    snapshotOlder = Utility.ConvertDataTableToList(dataSetOlderSnapshot.Tables[dataTableName]);

                    snapshotHelper = new Snapshot.SnapshotHelper();

                    snapshotHelper.UniqueIdentifierNames = primaryKeyNames.ToArray();

                    snapshotHelper.SetCurrent(snapshotNewer);

                    snapshotHelper.SetLast(snapshotOlder);

                    if (snapshotHelper.Compare())
                    {
                        added   = snapshotHelper.GetNew();
                        deleted = snapshotHelper.GetDeleted();
                        updated = snapshotHelper.GetUpdated();

                        if ((added != null) && (added.Count > 0))
                        {
                            foreach (IDictionary <string, object> item in added)
                            {
                                DataRow row = dataSetCurrent.Tables[dataTableName].NewRow();

                                foreach (string key in item.Keys)
                                {
                                    row[key] = item[key];
                                }

                                dataSetCurrent.Tables[dataTableName].Rows.Add(row);

                                //row.SetAdded();
                            }

                            //commandBuilder.GetInsertCommand();

                            result.CreationCount = adapter.Update(dataSetCurrent.Tables[dataTableName]);
                        }

                        if ((updated != null) && (updated.Count > 0))
                        {
                            //List<DataRow> rows = new List<DataRow>();

                            foreach (IDictionary <string, object> item in updated)
                            {
                                //DataRow row = dataSetCurrent.Tables[dataTableName].NewRow();

                                //dataSetCurrent.Tables[dataTableName].Rows.Add(row);

                                //DataRow row = this.getFilteredDataRow(item, primaryKeyNames.ToArray(), dataSetOlderSnapshot.Tables[dataTableName]);

                                DataRow row = this.getFilteredDataRow(item, primaryKeyNames.ToArray(), dataSetCurrent.Tables[dataTableName]);

                                //dataSetCurrent.Tables[dataTableName].ImportRow(row);

                                row.AcceptChanges();

                                //row.BeginEdit();

                                foreach (string key in item.Keys)
                                {
                                    if (!primaryKeyNames.Contains(key))
                                    {
                                        row[key] = item[key];
                                    }
                                }

                                //row.EndEdit();

                                //row.SetModified();

                                //rows.Add(row);
                            }

                            //commandBuilder.GetUpdateCommand();

                            result.ModificationCount = adapter.Update(dataSetCurrent.Tables[dataTableName]);

                            //result.ModificationCount = adapter.Update(rows.ToArray());
                        }

                        if ((deleted != null) && (deleted.Count > 0))
                        {
                            //List<DataRow> rows = new List<DataRow>();

                            //Detecting foreign key references:
                            dataSetCurrent.Tables[dataTableName].RowDeleting += (s, e) =>
                            {
                                if (e.Row != null)
                                {
                                    IDictionary <string, string> referencedForeignKeys = foreignKeys[dataTableName];

                                    foreach (string key in referencedForeignKeys.Keys)
                                    {
                                        //this.beginCascadedDeletion(connection, dataTableName, referencedForeignKeys[key], e.Row[referencedForeignKeys[key]], referencedForeignKeys);
                                        this.beginCascadedDeletion(connection, key.Substring(0, key.IndexOf(".")), key.Substring(key.IndexOf(".") + 1), e.Row[referencedForeignKeys[key]], foreignKeys);
                                    }
                                }
                            };

                            foreach (IDictionary <string, object> item in deleted)
                            {
                                //DataRow row = dataSetCurrent.Tables[dataTableName].NewRow();

                                //dataSetCurrent.Tables[dataTableName].Rows.Add(row);

                                //DataRow row = this.getFilteredDataRow(item, primaryKeyNames.ToArray(), dataSetOlderSnapshot.Tables[dataTableName]);

                                DataRow row = this.getFilteredDataRow(item, primaryKeyNames.ToArray(), dataSetCurrent.Tables[dataTableName]);

                                //dataSetCurrent.Tables[dataTableName].ImportRow(row);

                                row.AcceptChanges();

                                //foreach (string key in item.Keys)
                                //{
                                //    row[key] = item[key];
                                //}

                                //row.AcceptChanges();

                                row.Delete();

                                //rows.Add(row);
                            }

                            //commandBuilder.GetDeleteCommand();

                            result.DeletionCount = adapter.Update(dataSetCurrent.Tables[dataTableName]);

                            //result.DeletionCount = adapter.Update(rows.ToArray());
                        }
                    }
                }
            }

            //int result =  adapter.Update(dataSetCurrent);

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

            if (this.EnableTracing)
            {
                TracingHelper.Trace(new object[] { connection, adapter, commandText, commandType, queryMode, result }, this.TraceSourceName);
            }

            return(result);
        }
Пример #12
0
 public void Delete(OperationMethod operationMethod)
 {
     _operationMethodRepository.Delete(operationMethod);
 }
Пример #13
0
        public static object Operate(object a, object b, OperationMethod om)
        {
            var type = a.GetType();

            if (type != b.GetType())
            {
                return(a);
            }

            if (om == OperationMethod.Set)
            {
                return(a = b);
            }

            if (type == typeof(float))
            {
                if (om == OperationMethod.Add)
                {
                    return((float)a + (float)b);
                }
                if (om == OperationMethod.Subtract)
                {
                    return((float)a - (float)b);
                }
                if (om == OperationMethod.Multiply)
                {
                    return((float)a * (float)b);
                }
                if (om == OperationMethod.Divide)
                {
                    return((float)a / (float)b);
                }
            }

            if (type == typeof(int))
            {
                if (om == OperationMethod.Add)
                {
                    return((int)a + (int)b);
                }
                if (om == OperationMethod.Subtract)
                {
                    return((int)a - (int)b);
                }
                if (om == OperationMethod.Multiply)
                {
                    return((int)a * (int)b);
                }
                if (om == OperationMethod.Divide)
                {
                    return((int)a / (int)b);
                }
            }

            if (type == typeof(Vector3))
            {
                if (om == OperationMethod.Add)
                {
                    return((Vector3)a + (Vector3)b);
                }
                if (om == OperationMethod.Subtract)
                {
                    return((Vector3)a - (Vector3)b);
                }
                if (om == OperationMethod.Multiply)
                {
                    return(Vector3.Scale((Vector3)a, (Vector3)b));
                }
                if (om == OperationMethod.Divide)
                {
                    return(new Vector3(((Vector3)a).x / ((Vector3)b).x, ((Vector3)a).y / ((Vector3)b).y, ((Vector3)a).z / ((Vector3)b).z));
                }
            }

            Debug.LogError("Requested Operation with non compatible types");
            return(a);
        }
        public override List <AccountStatementImportFile> ImportFile(StreamReader reader, AccountStatementImport accountStatementImport, User user)
        {
            reader.DiscardBufferedData();
            reader.BaseStream.Seek(0, SeekOrigin.Begin);

            List <AccountStatementImportFile> accountStatementImportFiles = new List <AccountStatementImportFile>();
            int currentLineNumber = 0;

            while (!reader.EndOfStream)
            {
                var line = reader.ReadLine();

                var values = line.Split(';');
                AccountStatementImportFile asif = _asifService.InitForImport(user.IdUserGroup);
                asif.Id             = currentLineNumber;
                asif.IdImport       = accountStatementImport.Id;
                asif.DateImport     = DateTime.Now;
                asif.Reference      = null;
                asif.LabelOperation = values[2].ToString();

                asif.LabelOperationWork = _asifService.GetOperationLabelWork(asif.LabelOperation);
                //asif.LabelOperationWork = asif.LabelOperationWork.ToString().Replace(" ", "");
                if (values[3].ToString() != string.Empty)
                {
                    asif.AmountOperation = -double.Parse(values[3].Replace(",", ".").ToString(), CultureInfo.InvariantCulture);
                    asif.IdMovement      = (int)EnumMovement.Debit;
                }
                else if (values[4].ToString() != string.Empty)
                {
                    asif.AmountOperation = double.Parse(values[4].Replace(",", ".").ToString(), CultureInfo.InvariantCulture);
                    asif.IdMovement      = (int)EnumMovement.Credit;
                }

                asif.DateIntegration = Convert.ToDateTime(values[1].ToString());
                asif.Account         = _referentialService.AccountService.GetByNumber(values[0].ToString());
                asif.IdAccount       = asif.Account.Id;

                OperationMethod operationMethod = _referentialService.OperationMethodService.GetOperationMethodByFileLabel(asif.LabelOperationWork, EnumBankFamily.CreditAgricole);
                asif.IdOperationMethod = operationMethod.Id;

                //Date Operation
                switch (asif.IdOperationMethod)
                {
                case (int)EnumOperationMethod.PaiementCarte:
                    asif.DateOperation = GetDateOperationByFileLabel(asif.LabelOperationWork, asif.DateIntegration.Value, EnumOperationMethod.PaiementCarte);
                    break;

                case (int)EnumOperationMethod.RetraitCarte:
                    asif.DateOperation = GetDateOperationByFileLabel(asif.LabelOperationWork, asif.DateIntegration.Value, EnumOperationMethod.RetraitCarte);
                    break;
                }

                //Determination de operationDetail (operation+addresse) à partir des keywords
                OperationDetail operationDetail = _asifService.GetOperationDetail(user.Id, asif);
                if (operationDetail != null)
                {
                    asif.IdOperation           = operationDetail.Operation.Id;
                    asif.IdOperationType       = operationDetail.Operation.IdOperationType;
                    asif.IdOperationTypeFamily = operationDetail.Operation.OperationType.IdOperationTypeFamily;
                    asif.IdOperationDetail     = operationDetail.Id;
                    asif.OperationLabelTemp    = operationDetail.Operation.Label;
                    asif.OperationKeywordTemp  = operationDetail.KeywordOperation;
                    asif.PlaceLabelTemp        = operationDetail.KeywordPlace;
                    asif.PlaceKeywordTemp      = operationDetail.KeywordPlace;
                }
                else
                {
                    //Determination de operationDetail (operation+addresse) à partir du label brut
                    OperationType operationType = _referentialService.OperationTypeService.GetUnknown(user.IdUserGroup);
                    asif.IdOperationType       = operationType.Id;
                    asif.IdOperationTypeFamily = operationType.IdOperationTypeFamily;

                    //rechercher les labels et keyword sur libellé brut
                    OperationInformation operationInformation = GetOperationInformationByParsingLabel(user.Id, asif.LabelOperation, asif.LabelOperationWork, operationMethod);
                    if (operationInformation != null)
                    {
                        //asif.IdOperation = operationInformation.IdOperation;
                        asif.OperationLabelTemp   = operationInformation.OperationLabel;
                        asif.OperationKeywordTemp = operationInformation.OperationKeyword;
                        asif.PlaceKeywordTemp     = operationInformation.PlaceKeyword;
                        asif.PlaceLabelTemp       = operationInformation.PlaceLabel;
                    }
                }

                accountStatementImportFiles.Add(asif);
            }


            return(accountStatementImportFiles);
        }
        protected override OperationInformation GetOperationInformationByParsingLabel(int idUserGroup, string label, string labelWork, OperationMethod operationMethod)
        {
            switch (operationMethod.Id)
            {
            case (int)EnumOperationMethod.PaiementCarte:
                return(GetOperationInformationForCardPayment(idUserGroup, label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.RetraitCarte:
                return(GetOperationInformationForCashWithdrawal(idUserGroup, label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.Cotisation:
                return(GetOperationInformationForCotisation(label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.Virement:
                return(GetOperationInformationForVirement(label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.RemiseCheque:
                return(GetOperationInformationForRemiseCheque(label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.EmissionCheque:
                return(GetOperationInformationForEmissionCheque(label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.Prelevement:
                return(GetOperationInformationForPrelevement(label, labelWork, operationMethod.KeywordWork));

            case (int)EnumOperationMethod.Frais:
                return(GetOperationInformationForFrais(label, labelWork, operationMethod.KeywordWork));
            }
            return(null);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GeometryToGraphConversion" /> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="target">The target.</param>
 /// <param name="method">The method.</param>
 /// <param name="parameters">The parameters.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The source is null.
 /// or
 /// The method is null.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The type of a parameter does not match the type specified by the method.
 /// or
 /// The parameter value does not satisfy the conditions of the parameter.
 /// or
 /// The specified source and result are the same objects, but the method does not support in-place operations.
 /// </exception>
 protected GeometryToGraphConversion(IGeometry source, IGeometryGraph target, OperationMethod method, IDictionary <OperationParameter, Object> parameters)
     : base(source, target, method, parameters)
 {
     _bidirectionalConversion = Convert.ToBoolean(ResolveParameter(GraphOperationParameters.BidirectionalConversion));
     _metadataPreservation    = Convert.ToBoolean(ResolveParameter(CommonOperationParameters.MetadataPreservation));
 }
Пример #17
0
 /// <summary>
 /// 列表
 /// </summary>
 public List <T> getPage(int pageIndex, int pageSize, out long pageCount,
                         Expression <Func <T, object> > whereLambda, OperationMethod operation, object value)
 {
     return(CurrentDAL.getPage(pageIndex, pageSize, out pageCount, whereLambda, operation, value));
 }
Пример #18
0
 /// <inheritdoc/>
 public AudioOrganizer(string basePath, string mountingPath, uint searchDepth, OperationMethod operationMethod) : base(basePath, mountingPath, searchDepth, operationMethod)
 {
 }
Пример #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MaximumFlowComputation"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="target">The target.</param>
 /// <param name="method">The method.</param>
 /// <param name="parameters">The parameters.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The source is null.
 /// or
 /// The method is null.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The type of a parameter does not match the type specified by the method.
 /// or
 /// The parameter value does not satisfy the conditions of the parameter.
 /// or
 /// The specified source and result are the same objects, but the method does not support in-place operations.
 /// </exception>
 protected MaximumFlowComputation(IGeometryGraph source, IGeometryGraph target, OperationMethod method, IDictionary <OperationParameter, Object> parameters)
     : base(source, target, method, parameters)
 {
     _sourceVertex   = ResolveParameter <IGraphVertex>(GraphOperationParameters.SourceVertex);
     _targetVertex   = ResolveParameter <IGraphVertex>(GraphOperationParameters.TargetVertex);
     _capacityMetric = ResolveParameter <Func <IGraphEdge, Int32> >(GraphOperationParameters.CapacityMetric);
 }
Пример #20
0
        /// <summary>
        /// 比较符
        /// </summary>
        /// <param name="method"></param>
        /// <returns></returns>
        private static string GetOpStr(OperationMethod method)
        {
            var opstr = "";

            switch (method)
            {
            case OperationMethod.LikeCentre:
            case OperationMethod.LikeLeft:
            case OperationMethod.LikeRight:
                opstr = "LIKE";
                break;

            case OperationMethod.Equal:
                opstr = "=";
                break;

            case OperationMethod.Greater:
                opstr = ">";
                break;

            case OperationMethod.GreaterOrEqual:
                opstr = ">=";
                break;

            case OperationMethod.In:
                opstr = "IN";
                break;

            case OperationMethod.Less:
                opstr = "<";
                break;

            case OperationMethod.LessOrEqual:
                opstr = "<=";
                break;

            case OperationMethod.Unequal:
                opstr = "<>";
                break;

            case OperationMethod.Between:
                opstr = "Between";
                break;

            case OperationMethod.Exists:
                opstr = "Exists";
                break;

            case OperationMethod.NotExists:
                opstr = "Not Exists";
                break;

            case OperationMethod.IsNull:
                opstr = "Is Null";
                break;

            case OperationMethod.IsNotNull:
                opstr = "Is Not Null";
                break;
            }
            return(opstr);
        }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MinimumSpanningTreeAlgorithm" /> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="target">The target.</param>
 /// <param name="method">The method.</param>
 /// <param name="parameters">The parameters.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The source is null.
 /// or
 /// The method is null.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The type of a parameter does not match the type specified by the method.
 /// or
 /// The value of a parameter is not within the expected range.
 /// or
 /// The specified source and result are the same objects, but the method does not support in-place operations.
 /// </exception>
 protected MinimumSpanningTreeAlgorithm(IGeometryGraph source, IGeometryGraph target, OperationMethod method, IDictionary <OperationParameter, Object> parameters)
     : base(source, target, method, parameters)
 {
     _weightMetric = ResolveParameter <Func <IGraphEdge, Double> >(GraphOperationParameters.WeightMetric);
 }
Пример #22
0
        public object Query(string providerName, string connectionString, string commandText, string commandType, OperationMethod queryMode)
        {
            object returnValue = null;

            DbConnection connection = this.getDbConnection(providerName);

            connection.ConnectionString = connectionString;

            if (this.EnableTracing)
            {
                TracingHelper.Trace(new object[] { connection, commandText, commandType, queryMode }, this.TraceSourceName);
            }

            if ((connection != null) && (!String.IsNullOrEmpty(commandText)))
            {
                //if (queryMode == OperationMethod.Retrieve)
                //{
                //    DbDataAdapter dataAdapter = this.getDbDataAdapter(providerName);

                //    returnValue = this.getDataSetXml(dataAdapter, connection, commandText, null, this.getDbCommandType(commandType));
                //}
                //else
                {
                    returnValue = this.beginQuery(connection, commandText, commandType, queryMode);
                }
            }

            if (this.EnableTracing)
            {
                TracingHelper.Trace(new object[] { connection, commandText, commandType, queryMode, returnValue }, this.TraceSourceName);
            }

            return(returnValue);
        }
Пример #23
0
 public Organizer(string basePath, string mountingPath, OperationMethod operationMethod)
 {
     BasePath        = basePath;
     MountingPath    = mountingPath;
     OperationMethod = operationMethod;
 }
Пример #24
0
 /// <inheritdoc/>
 public FolderizerAudio(string basePath, string mountingPath, uint searchDepth, OperationMethod operationMethod) : base(basePath, mountingPath, searchDepth, operationMethod)
 {
 }
Пример #25
0
Файл: Log.cs Проект: dnzn/Senko
 public Record InitSubProcess(OperationMethod operation)
 {
     return(new Record(Name, operation));
 }
Пример #26
0
        private object beginQuery(DbConnection connection, string commandText, string commandType, OperationMethod queryMode)
        {
            object returnValue = null;

            System.Data.CommandType dbCommandType = this.getDbCommandType(commandType);

            switch (queryMode)
            {
            case OperationMethod.Delete:
            {
                returnValue = this.ExcecuteNonQueryCommand(connection, commandText, null, dbCommandType);
                break;
            }

            case OperationMethod.Retrieve:
            {
                returnValue = new XmlDocument();
                (returnValue as XmlDocument).Load(this.ExcecuteXmlReader(connection, commandText, null, dbCommandType));
                break;
            }

            case OperationMethod.Create:
            {
                returnValue = this.ExcecuteNonQueryCommand(connection, commandText, null, dbCommandType);
                break;
            }

            case OperationMethod.Modify:
            {
                returnValue = this.ExcecuteNonQueryCommand(connection, commandText, null, dbCommandType);
                break;
            }

            default:
            {
                returnValue = new XmlDocument();
                (returnValue as XmlDocument).Load(this.ExcecuteXmlReader(connection, commandText, null, dbCommandType));
                break;
            }
            }

            return(returnValue);
        }
Пример #27
0
Файл: Log.cs Проект: dnzn/Senko
 public static void Initialize(Konsole konsole, OperationMethod operation)
 {
     CurrentRecord = new Record(konsole, operation);
 }
Пример #28
0
Файл: Log.cs Проект: dnzn/Senko
 public static void Initialize(OperationMethod operation)
 {
     Initialize(null, operation);
 }
Пример #29
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShortestPathTreeAlgorithm"/> class.
 /// </summary>
 /// <param name="source">The source.</param>
 /// <param name="target">The target.</param>
 /// <param name="method">The method.</param>
 /// <param name="parameters">The parameters.</param>
 /// <exception cref="System.ArgumentNullException">
 /// The source is null.
 /// or
 /// The method is null.
 /// or
 /// The method requires parameters which are not specified.
 /// </exception>
 /// <exception cref="System.ArgumentException">
 /// The parameters do not contain a required parameter value.
 /// or
 /// The type of a parameter does not match the type specified by the method.
 /// or
 /// The value of a parameter is not within the expected range.
 /// or
 /// The specified source and result are the same objects, but the method does not support in-place operations.
 /// </exception>
 protected ShortestPathTreeAlgorithm(IGeometryGraph source, IGeometryGraph target, OperationMethod method, IDictionary <OperationParameter, Object> parameters)
     : base(source, target, method, parameters)
 {
     _sourceVertex = ResolveParameter <IGraphVertex>(GraphOperationParameters.SourceVertex);
     _weightMetric = ResolveParameter <Func <IGraphEdge, Double> >(GraphOperationParameters.WeightMetric);
 }
Пример #30
0
Файл: Log.cs Проект: dnzn/Senko
 public Record(Konsole konsole, OperationMethod operation)
 {
     Initialize((konsole != null) ? konsole.Name : "", operation);
 }
Пример #31
0
 protected abstract OperationInformation GetOperationInformationByParsingLabel(int idUserGroup, string label, string labelWork, OperationMethod operationMethod);
Пример #32
0
 public int Create(OperationMethod operationMethod)
 {
     return(_operationMethodRepository.Create(operationMethod));
 }