Exemplo n.º 1
0
        public List <TradingType> CustomGridData()
        {
            try
            {
                List <TradingType> lstobj         = new List <TradingType>();
                UserLoginBO        objUserLoginBO = new UserLoginBO();
                TradeBO            objBO          = new TradeBO();
                objUserLoginBO = HttpContext.Current.Session["UserDetails"] as UserLoginBO;
                if (objUserLoginBO == null)
                {
                    objBO.UserId = new Guid();
                }
                else
                {
                    objBO.UserId = (Guid)objUserLoginBO.UserId;
                }

                lstobj = new TradeBL().CustomGridData(objBO.UserId);
                return(lstobj);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 public List <TradeBO> GetTradeHistoryData()
 {
     try
     {
         TradeBO        objBO          = new TradeBO();
         List <TradeBO> objList        = new List <TradeBO>();
         UserLoginBO    objUserLoginBO = new UserLoginBO();
         objUserLoginBO = HttpContext.Current.Session["UserDetails"] as UserLoginBO;
         if (objUserLoginBO != null)
         {
             objBO.UserId = (Guid)objUserLoginBO.UserId;
             objList      = new TradeBL().GetTradeHistoryData(objBO);
             return(objList);
         }
         else
         {
             objList = null;
             return(objList);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
        public string InsertBidData(string tradingTypeId, string bidType, string assestId, string investedAmount, string exTime)
        {
            string      result     = "";
            UserLoginBO objLoginBo = CheckUserActiveOrNotSession();

            if (objLoginBo.Isactive == true)
            {
                result = "1";
            }
            else
            {
                result = "-1";
            }
            try
            {
                if (result == "1")
                {
                    int ExTime;
                    var massestId = new Guid();
                    if (Guid.TryParse(assestId, out massestId))
                    {
                        // Parsed OK
                    }
                    var sec = exTime.Split(' ');
                    if (sec[1].ToLower() == "seconds")
                    {
                        ExTime = Convert.ToInt32(sec[0]);
                    }
                    else
                    {
                        ExTime = Convert.ToInt32(sec[0]) * 60;
                    }
                    TradeBO     objBO          = new TradeBO();
                    UserLoginBO objUserLoginBO = new UserLoginBO();
                    objUserLoginBO       = HttpContext.Current.Session["UserDetails"] as UserLoginBO;
                    objBO.UserId         = (Guid)objUserLoginBO.UserId;
                    objBO.TradingTypeId  = Convert.ToInt32(tradingTypeId);
                    objBO.BidType        = bidType;
                    objBO.AssetId        = massestId;
                    objBO.InvestedAmount = Convert.ToDouble(investedAmount);
                    // objBO.TargetPrice = Convert.ToDouble(targetPrice);


                    string   serverDateTime = DateTime.Now.ToString("M d yy HH:mm:ss");
                    DateTime Exptime        = Convert.ToDateTime(serverDateTime).AddSeconds(Convert.ToDouble(ExTime));
                    //var TradeTime = serverDateTime.ToString("M/d/yy HH:mm:ss");
                    objBO.ExpiryTime = Exptime.ToString("HH:mm:ss");
                    result           = new TradeBL().InsertBidData(objBO, serverDateTime);
                    return(result);
                }
                else
                {
                    return(result);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        public string InsertCustomGrid(string assetId)
        {
            string result = "";

            try
            {
                UserLoginBO objUserLoginBO = new UserLoginBO();
                TradeBO     objBO          = new TradeBO();
                objUserLoginBO = HttpContext.Current.Session["UserDetails"] as UserLoginBO;
                objBO.UserId   = (Guid)objUserLoginBO.UserId;
                if (assetId != "")
                {
                    assetId = assetId.Remove(assetId.Length - 1, 1);
                }
                else
                {
                    assetId = null;
                }
                result = new TradeBL().InsertCustomGrid(objBO, assetId);
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
 public List <TradeBO> GetGraphFeed(string assetId, Int32 tradeId, Int32 graphType)
 {
     try
     {
         var myGuid = new Guid();
         if (Guid.TryParse(assetId, out myGuid))
         {
             // Parsed OK
         }
         TradeBO objBO = new TradeBO();
         objBO.AssetId       = myGuid;
         objBO.TradingTypeId = tradeId;
         objBO.GraphType     = graphType;
         List <TradeBO> lstTradeBO = new TradeBL().GetGraphFeed(objBO);
         return(lstTradeBO);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 public List <TradeBO> GetGridDataByTradingTypeID(string tradingTypeId, string assetTypeId)
 {
     try
     {
         UserLoginBO objUserLoginBO = new UserLoginBO();
         TradeBO     objBO          = new TradeBO();
         objUserLoginBO = HttpContext.Current.Session["UserDetails"] as UserLoginBO;
         if (objUserLoginBO == null)
         {
             objBO.UserId = new Guid();
         }
         else
         {
             objBO.UserId = (Guid)objUserLoginBO.UserId;
         }
         List <TradeBO> lstTradeBO = new TradeBL().GetGridDataByTradingTypeID(Convert.ToInt32(tradingTypeId), Convert.ToInt32(assetTypeId), objBO.UserId);
         return(lstTradeBO);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }