Ejemplo n.º 1
0
        public static bool InsertData(string symbol, SideEnum side, PriceComparisonEnum evaluator,
                                      RatePriceOrFeeEnum ratePriceFee, DateTime expiration, bool usePercentMoney, double bidStrike,
                                      double midStrike, double highStrike, string account, double limit, ListenerTypeEnum listenerType,
                                      string jobId, string comments)
        {
            try
            {
                var           collection = _db.GetCollection <ProjectMaster>("ProjectMaster");
                ProjectMaster t          = new ProjectMaster()
                {
                    Symbol          = symbol,
                    Side            = Enum.GetName(typeof(SideEnum), side),
                    Evaluator       = Enum.GetName(typeof(PriceComparisonEnum), evaluator),
                    RatePriceFee    = Enum.GetName(typeof(RatePriceOrFeeEnum), ratePriceFee),
                    Expiration      = expiration,
                    UsePercentMoney = usePercentMoney,
                    BidStrike       = bidStrike,
                    MidStrike       = midStrike,
                    HighStrike      = highStrike,
                    Account         = account,
                    Limit           = limit,
                    ListenerType    = Enum.GetName(typeof(ListenerTypeEnum), listenerType),
                    JobId           = jobId,
                    Comments        = comments,
                };
                collection.InsertOne(t);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool UpdateData(string id, string symbol, SideEnum side, PriceComparisonEnum evaluator,
                                      RatePriceOrFeeEnum ratePriceFee, DateTime expiration, bool usePercentMoney, double bidStrike,
                                      double midStrike, double highStrike, string account, double limit, ListenerTypeEnum listenerType,
                                      string jobId, string comments)
        {
            var select = MyObj.UpdateData(id, symbol, side, evaluator, ratePriceFee, expiration, usePercentMoney, bidStrike, midStrike, highStrike, account, limit, listenerType, jobId, comments);

            /*   return new JavaScriptSerializer().Serialize(
             *     "Hello, " + item + ", " + qty + " " + date+ " "+ phone+"!");*/

            return(select);
            //return "Hello i am parth";
        }
Ejemplo n.º 3
0
        public static bool UpdateData(string id, string symbol, SideEnum side, PriceComparisonEnum evaluator, RatePriceOrFeeEnum ratePriceFee, DateTime expiration, bool usePercentMoney, double bidStrike, double midStrike, double highStrike, string account, double limit, ListenerTypeEnum listenerType, string jobId, string comments)
        {
            /*UpdateDefinition<ProjectMaster> update;*/
            try
            {
                var collection = _db.GetCollection <ProjectMaster>("test");
                var filter     = Builders <ProjectMaster> .Filter.Eq("_id", id);

                var update = Builders <ProjectMaster> .Update.Set("Comments", comments);

                collection.UpdateOne(filter, update);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }