Example #1
0
        /// <summary>
        /// 根据品种标识返回现货_品种_交易规则
        /// </summary>
        /// <param name="breedClassID">品种标识</param>
        /// <returns></returns>
        public Entity.XH_SpotTradeRules GetSpotTradeRulesByBreedClassID(int breedClassID)
        {
            try
            {
                LogHelper.WriteDebug("Debug-8412根据品种标识返回现货_品种_交易规则方法名称:GetSpotTradeRulesByBreedClassID(int breedClassID)参数是:" + breedClassID + "时间是:" + DateTime.Now);
                XH_SpotTradeRulesBLL xH_SpotTradeRulesBLL = new XH_SpotTradeRulesBLL();
                var list = xH_SpotTradeRulesBLL.GetListArray(string.Format("BreedClassID={0}", breedClassID));

                if (list.Count > 0)
                {
                    Entity.XH_SpotTradeRules xH_SpotTradeRules = list[0];
                    if (xH_SpotTradeRules != null)
                    {
                        return(xH_SpotTradeRules);
                    }
                }

                return(null);
            }
            catch (Exception ex)
            {
                string      errCode = "GL-8412";
                string      errMsg  = "根据品种标识返回现货_品种_交易规则失败";
                VTException vte     = new VTException(errCode, errMsg, ex);
                LogHelper.WriteError(vte.ToString(), vte.InnerException);
                return(null);
            }
        }
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(ManagementCenter.Model.XH_SpotTradeRules model)
 {
     try
     {
         return(xH_SpotTradeRulesDAL.Add(model));
     }
     catch (Exception ex)
     {
         LogHelper.WriteError(ex.Message, ex);
         return(false);
         //throw;
     }
 }
 /// <summary>
 /// 更新现货交易规则
 /// </summary>
 /// <param name="model">现货_品种_交易规则实体</param>
 /// <returns></returns>
 public bool UpdateSpotTradeRules(ManagementCenter.Model.XH_SpotTradeRules model)
 {
     try
     {
         return(xH_SpotTradeRulesDAL.UpdateSpotTradeRules(model));
     }
     catch (Exception ex)
     {
         string      errCode   = "GL-5203";
         string      errMsg    = "更新现货交易规则失败!";
         VTException exception = new VTException(errCode, errMsg, ex);
         LogHelper.WriteError(exception.ToString(), exception.InnerException);
         return(false);
     }
 }
 /// <summary>
 ///  添加现货交易规则
 /// </summary>
 /// <param name="xHSpotTradeRules">现货交易规则实体类</param>
 /// <returns></returns>
 public bool AddXHSpotTradeRules(ManagementCenter.Model.XH_SpotTradeRules xHSpotTradeRules)
 {
     try
     {
         XH_SpotTradeRulesDAL xHSpotTradeRulesDAL = new XH_SpotTradeRulesDAL();
         return(xHSpotTradeRulesDAL.Add(xHSpotTradeRules));
     }
     catch (Exception ex)
     {
         string      errCode   = "GL-5200";
         string      errMsg    = "添加现货交易规则失败!";
         VTException exception = new VTException(errCode, errMsg, ex);
         LogHelper.WriteError(exception.ToString(), exception.InnerException);
         return(false);
     }
     //return true;
 }
Example #5
0
        /// <summary>
        /// 更新现货交易规则
        /// </summary>
        /// <param name="model">现货交易规则实体</param>
        /// <returns></returns>
        public static bool UpdateSpotTradeRules(ManagementCenter.Model.XH_SpotTradeRules model)
        {
            XH_SpotTradeRulesBLL xH_SpotTradeRulesBLL = new XH_SpotTradeRulesBLL();

            return(xH_SpotTradeRulesBLL.UpdateSpotTradeRules(model));
        }