Ejemplo n.º 1
0
        public static void GetTradeJuJianList(JJQueryCon JJqc, string ParentOrgID, ref TradeJuJianInfo TdInfo)
        {
            System.Data.Common.DbDataReader dbreader = null;
            try
            {
                string orgname = string.Empty;
                if (!string.IsNullOrEmpty(JJqc.OrgName))
                {
                    orgname = JJqc.OrgName;
                }
                dbreader = DbHelper.RunProcedureGetDataReader("GetJujianDataEx",
                      new System.Data.Common.DbParameter[]{
                           DbHelper.CreateDbParameter(JinTong.Jyrj.Data.DataBase.Type,
                    "@ParentOrgID",DbParameterType.String,ParentOrgID,ParameterDirection.Input),

                        DbHelper.CreateDbParameter(JinTong.Jyrj.Data.DataBase.Type,
                    "@OrgID",DbParameterType.String,orgname,ParameterDirection.Input),

                     DbHelper.CreateDbParameter(JinTong.Jyrj.Data.DataBase.Type,
                    "@StartTime",DbParameterType.String,JJqc.StartTime.ToString("yyyy-MM-dd"),ParameterDirection.Input),

                        DbHelper.CreateDbParameter(JinTong.Jyrj.Data.DataBase.Type,
                    "@EndTime",DbParameterType.String,JJqc.EndTime.ToString("yyyy-MM-dd"),ParameterDirection.Input)});
                while (dbreader.Read())
                {
                    TradeJuJian tdjj = new TradeJuJian();
                    tdjj.OrgName = System.DBNull.Value != dbreader["orgname"] ? dbreader["orgname"].ToString() : string.Empty;
                    tdjj.qichu = System.DBNull.Value != dbreader["qichu"] ? Convert.ToDouble(dbreader["qichu"]) : 0;
                    tdjj.qimo = System.DBNull.Value != dbreader["qimo"] ? Convert.ToDouble(dbreader["qimo"]) : 0;
                    tdjj.rujin = System.DBNull.Value != dbreader["rujin"] ? Convert.ToDouble(dbreader["rujin"]) : 0;
                    tdjj.chujin = System.DBNull.Value != dbreader["chujin"] ? Convert.ToDouble(dbreader["chujin"]) : 0;
                    tdjj.Manual_rujin = System.DBNull.Value != dbreader["manual_rujin"] ? Convert.ToDouble(dbreader["manual_rujin"]) : 0;
                    tdjj.Manual_chujin = System.DBNull.Value != dbreader["manual_chujin"] ? Convert.ToDouble(dbreader["manual_chujin"]) : 0;
                    tdjj.Money = System.DBNull.Value != dbreader["money"] ? Convert.ToDouble(dbreader["money"]) : 0;
                    tdjj.Hisyingkui = System.DBNull.Value != dbreader["hisyingkui"] ? Convert.ToDouble(dbreader["hisyingkui"]) : 0;
                    tdjj.tradefee = System.DBNull.Value != dbreader["tradefee"] ? Convert.ToDouble(dbreader["tradefee"]) : 0;
                    tdjj.storagefee = System.DBNull.Value != dbreader["storagefee"] ? Convert.ToDouble(dbreader["storagefee"]) : 0;

                    tdjj.KC_Copper_20t_Num = System.DBNull.Value != dbreader["KC_Copper_20t_Num"] ? Convert.ToDouble(dbreader["KC_Copper_20t_Num"]) : 0;
                    tdjj.KC_Copper_50t_Num = System.DBNull.Value != dbreader["KC_Copper_50t_Num"] ? Convert.ToDouble(dbreader["KC_Copper_50t_Num"]) : 0;
                    tdjj.KC_UKOil_100_Num = System.DBNull.Value != dbreader["KC_UKOil_100_Num"] ? Convert.ToDouble(dbreader["KC_UKOil_100_Num"]) : 0;
                    tdjj.KC_UKOil_20_Num = System.DBNull.Value != dbreader["KC_UKOil_20_Num"] ? Convert.ToDouble(dbreader["KC_UKOil_20_Num"]) : 0;
                    tdjj.KC_UKOil_50_Num = System.DBNull.Value != dbreader["KC_UKOil_50_Num"] ? Convert.ToDouble(dbreader["KC_UKOil_50_Num"]) : 0;
                    tdjj.KC_XAG_100kg_Num = System.DBNull.Value != dbreader["KC_XAG_100kg_Num"] ? Convert.ToDouble(dbreader["KC_XAG_100kg_Num"]) : 0;
                    tdjj.KC_XAG_20kg_Num = System.DBNull.Value != dbreader["KC_XAG_20kg_Num"] ? Convert.ToDouble(dbreader["KC_XAG_20kg_Num"]) : 0;
                    tdjj.KC_XAG_50kg_Num = System.DBNull.Value != dbreader["KC_XAG_50kg_Num"] ? Convert.ToDouble(dbreader["KC_XAG_50kg_Num"]) : 0;
                    tdjj.KC_XAU_1000g_Num = System.DBNull.Value != dbreader["KC_XAU_1000g_Num"] ? Convert.ToDouble(dbreader["KC_XAU_1000g_Num"]) : 0;
                    tdjj.KC_XPD_1000g_Num = System.DBNull.Value != dbreader["KC_XPD_1000g_Num"] ? Convert.ToDouble(dbreader["KC_XPD_1000g_Num"]) : 0;
                    tdjj.KC_XPT_1000g_Num = System.DBNull.Value != dbreader["KC_XPT_1000g_Num"] ? Convert.ToDouble(dbreader["KC_XPT_1000g_Num"]) : 0;

                    tdjj.XAG_100kg_Num = System.DBNull.Value != dbreader["XAG_100kg_Num"] ? Convert.ToDouble(dbreader["XAG_100kg_Num"]) : 0;
                    tdjj.XAG_20kg_Num = System.DBNull.Value != dbreader["XAG_20kg_Num"] ? Convert.ToDouble(dbreader["XAG_20kg_Num"]) : 0;
                    tdjj.XAG_50kg_Num = System.DBNull.Value != dbreader["XAG_50kg_Num"] ? Convert.ToDouble(dbreader["XAG_50kg_Num"]) : 0;
                    tdjj.XAU_1000g_Num = System.DBNull.Value != dbreader["XAU_1000g_Num"] ? Convert.ToDouble(dbreader["XAU_1000g_Num"]) : 0;
                    tdjj.XPD_1000g_Num = System.DBNull.Value != dbreader["XPD_1000g_Num"] ? Convert.ToDouble(dbreader["XPD_1000g_Num"]) : 0;
                    tdjj.XPT_1000g_Num = System.DBNull.Value != dbreader["XPT_1000g_Num"] ? Convert.ToDouble(dbreader["XPT_1000g_Num"]) : 0;
                    tdjj.Copper_20t_Num = System.DBNull.Value != dbreader["Copper_20t_Num"] ? Convert.ToDouble(dbreader["Copper_20t_Num"]) : 0;
                    tdjj.Copper_50t_Num = System.DBNull.Value != dbreader["Copper_50t_Num"] ? Convert.ToDouble(dbreader["Copper_50t_Num"]) : 0;
                    tdjj.UKOil_100_Num = System.DBNull.Value != dbreader["UKOil_100_Num"] ? Convert.ToDouble(dbreader["UKOil_100_Num"]) : 0;
                    tdjj.UKOil_50_Num = System.DBNull.Value != dbreader["UKOil_50_Num"] ? Convert.ToDouble(dbreader["UKOil_50_Num"]) : 0;
                    tdjj.UKOil_20_Num = System.DBNull.Value != dbreader["UKOil_20_Num"] ? Convert.ToDouble(dbreader["UKOil_20_Num"]) : 0;

                    tdjj.XAUUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["XAUUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["XAUUSD_DHAVG_PRICE"]) : 0;
                    tdjj.XAGUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["XAGUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["XAGUSD_DHAVG_PRICE"]) : 0;
                    tdjj.XPDUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["XPDUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["XPDUSD_DHAVG_PRICE"]) : 0;
                    tdjj.XPTUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["XPTUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["XPTUSD_DHAVG_PRICE"]) : 0;
                    tdjj.Copper_DHAVG_PRICE = System.DBNull.Value != dbreader["Copper_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["Copper_DHAVG_PRICE"]) : 0;
                    tdjj.UKOil_DHAVG_PRICE = System.DBNull.Value != dbreader["UKOil_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["UKOil_DHAVG_PRICE"]) : 0;
                    tdjj.EURGBP_DHAVG_PRICE = System.DBNull.Value != dbreader["EURGBP_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["EURGBP_DHAVG_PRICE"]) : 0;
                    tdjj.GBPUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["GBPUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["GBPUSD_DHAVG_PRICE"]) : 0;
                    tdjj.EURUSD_DHAVG_PRICE = System.DBNull.Value != dbreader["EURUSD_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["EURUSD_DHAVG_PRICE"]) : 0;
                    tdjj.USDJPY_DHAVG_PRICE = System.DBNull.Value != dbreader["USDJPY_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["USDJPY_DHAVG_PRICE"]) : 0;
                    tdjj.USDCHF_DHAVG_PRICE = System.DBNull.Value != dbreader["USDCHF_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["USDCHF_DHAVG_PRICE"]) : 0;
                    tdjj.USDOLLAR_DHAVG_PRICE = System.DBNull.Value != dbreader["USDOLLAR_DHAVG_PRICE"] ? Convert.ToDouble(dbreader["USDOLLAR_DHAVG_PRICE"]) : 0;

                    tdjj.XAUUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["XAUUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["XAUUSD_HSAVG_PRICE"]) : 0;
                    tdjj.XAGUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["XAGUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["XAGUSD_HSAVG_PRICE"]) : 0;
                    tdjj.XPDUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["XPDUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["XPDUSD_HSAVG_PRICE"]) : 0;
                    tdjj.XPTUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["XPTUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["XPTUSD_HSAVG_PRICE"]) : 0;
                    tdjj.Copper_HSAVG_PRICE = System.DBNull.Value != dbreader["Copper_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["Copper_HSAVG_PRICE"]) : 0;
                    tdjj.UKOil_HSAVG_PRICE = System.DBNull.Value != dbreader["UKOil_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["UKOil_HSAVG_PRICE"]) : 0;
                    tdjj.EURGBP_HSAVG_PRICE = System.DBNull.Value != dbreader["EURGBP_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["EURGBP_HSAVG_PRICE"]) : 0;
                    tdjj.GBPUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["GBPUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["GBPUSD_HSAVG_PRICE"]) : 0;
                    tdjj.EURUSD_HSAVG_PRICE = System.DBNull.Value != dbreader["EURUSD_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["EURUSD_HSAVG_PRICE"]) : 0;
                    tdjj.USDJPY_HSAVG_PRICE = System.DBNull.Value != dbreader["USDJPY_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["USDJPY_HSAVG_PRICE"]) : 0;
                    tdjj.USDCHF_HSAVG_PRICE = System.DBNull.Value != dbreader["USDCHF_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["USDCHF_HSAVG_PRICE"]) : 0;
                    tdjj.USDOLLAR_HSAVG_PRICE = System.DBNull.Value != dbreader["USDOLLAR_HSAVG_PRICE"] ? Convert.ToDouble(dbreader["USDOLLAR_HSAVG_PRICE"]) : 0;

                    tdjj.XAUUSD_DH_NUM = System.DBNull.Value != dbreader["XAUUSD_DH_NUM"] ? Convert.ToDouble(dbreader["XAUUSD_DH_NUM"]) : 0;
                    tdjj.XAGUSD_DH_NUM = System.DBNull.Value != dbreader["XAGUSD_DH_NUM"] ? Convert.ToDouble(dbreader["XAGUSD_DH_NUM"]) : 0;
                    tdjj.XPDUSD_DH_NUM = System.DBNull.Value != dbreader["XPDUSD_DH_NUM"] ? Convert.ToDouble(dbreader["XPDUSD_DH_NUM"]) : 0;
                    tdjj.XPTUSD_DH_NUM = System.DBNull.Value != dbreader["XPTUSD_DH_NUM"] ? Convert.ToDouble(dbreader["XPTUSD_DH_NUM"]) : 0;
                    tdjj.Copper_DH_NUM = System.DBNull.Value != dbreader["Copper_DH_NUM"] ? Convert.ToDouble(dbreader["Copper_DH_NUM"]) : 0;
                    tdjj.UKOil_DH_NUM = System.DBNull.Value != dbreader["UKOil_DH_NUM"] ? Convert.ToDouble(dbreader["UKOil_DH_NUM"]) : 0;
                    tdjj.EURGBP_DH_NUM = System.DBNull.Value != dbreader["EURGBP_DH_NUM"] ? Convert.ToDouble(dbreader["EURGBP_DH_NUM"]) : 0;
                    tdjj.GBPUSD_DH_NUM = System.DBNull.Value != dbreader["GBPUSD_DH_NUM"] ? Convert.ToDouble(dbreader["GBPUSD_DH_NUM"]) : 0;
                    tdjj.EURUSD_DH_NUM = System.DBNull.Value != dbreader["EURUSD_DH_NUM"] ? Convert.ToDouble(dbreader["EURUSD_DH_NUM"]) : 0;
                    tdjj.USDJPY_DH_NUM = System.DBNull.Value != dbreader["USDJPY_DH_NUM"] ? Convert.ToDouble(dbreader["USDJPY_DH_NUM"]) : 0;
                    tdjj.USDCHF_DH_NUM = System.DBNull.Value != dbreader["USDCHF_DH_NUM"] ? Convert.ToDouble(dbreader["USDCHF_DH_NUM"]) : 0;
                    tdjj.USDOLLAR_DH_NUM = System.DBNull.Value != dbreader["USDOLLAR_DH_NUM"] ? Convert.ToDouble(dbreader["USDOLLAR_DH_NUM"]) : 0;

                    tdjj.XAUUSD_HS_NUM = System.DBNull.Value != dbreader["XAUUSD_HS_NUM"] ? Convert.ToDouble(dbreader["XAUUSD_HS_NUM"]) : 0;
                    tdjj.XAGUSD_HS_NUM = System.DBNull.Value != dbreader["XAGUSD_HS_NUM"] ? Convert.ToDouble(dbreader["XAGUSD_HS_NUM"]) : 0;
                    tdjj.XPDUSD_HS_NUM = System.DBNull.Value != dbreader["XPDUSD_HS_NUM"] ? Convert.ToDouble(dbreader["XPDUSD_HS_NUM"]) : 0;
                    tdjj.XPTUSD_HS_NUM = System.DBNull.Value != dbreader["XPTUSD_HS_NUM"] ? Convert.ToDouble(dbreader["XPTUSD_HS_NUM"]) : 0;
                    tdjj.Copper_HS_NUM = System.DBNull.Value != dbreader["Copper_HS_NUM"] ? Convert.ToDouble(dbreader["Copper_HS_NUM"]) : 0;
                    tdjj.UKOil_HS_NUM = System.DBNull.Value != dbreader["UKOil_HS_NUM"] ? Convert.ToDouble(dbreader["UKOil_HS_NUM"]) : 0;
                    tdjj.EURGBP_HS_NUM = System.DBNull.Value != dbreader["EURGBP_HS_NUM"] ? Convert.ToDouble(dbreader["EURGBP_HS_NUM"]) : 0;
                    tdjj.GBPUSD_HS_NUM = System.DBNull.Value != dbreader["GBPUSD_HS_NUM"] ? Convert.ToDouble(dbreader["GBPUSD_HS_NUM"]) : 0;
                    tdjj.EURUSD_HS_NUM = System.DBNull.Value != dbreader["EURUSD_HS_NUM"] ? Convert.ToDouble(dbreader["EURUSD_HS_NUM"]) : 0;
                    tdjj.USDJPY_HS_NUM = System.DBNull.Value != dbreader["USDJPY_HS_NUM"] ? Convert.ToDouble(dbreader["USDJPY_HS_NUM"]) : 0;
                    tdjj.USDCHF_HS_NUM = System.DBNull.Value != dbreader["USDCHF_HS_NUM"] ? Convert.ToDouble(dbreader["USDCHF_HS_NUM"]) : 0;
                    tdjj.USDOLLAR_HS_NUM = System.DBNull.Value != dbreader["USDOLLAR_HS_NUM"] ? Convert.ToDouble(dbreader["USDOLLAR_HS_NUM"]) : 0;

                    TdInfo.TdJuJianList.Add(tdjj);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message, ex);
            }
            finally
            {
                if (null != dbreader)
                {
                    dbreader.Close(); dbreader.Dispose();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 居间管理
        /// </summary>
        /// <param name="JJqc">查询条件</param>
        /// <returns></returns>
        public TradeJuJianInfo GetTradeJuJianInfo(JJQueryCon JJqc)
        {
            TradeJuJianInfo TdInfo = new TradeJuJianInfo();
            try
            {
                TradeUser TdUser = new TradeUser();
                #region 判断登陆标识是否过期

                if (!ComFunction.ExistUserLoginID(JJqc.LoginID, ref TdUser))
                {
                    TdInfo.Result = false;
                    TdInfo.Desc = ResCode.UL003Desc;
                    return TdInfo;
                }
                if (UserType.NormalType == TdUser.UType)
                {
                    TdInfo.Result = false;
                    TdInfo.Desc = ComFunction.NotRightUser;
                    return TdInfo;
                }

                #endregion

                string ParentOrgID = string.Empty;
                if (UserType.OrgType == TdUser.UType && !string.IsNullOrEmpty(TdUser.OrgId))
                {
                    ParentOrgID = TdUser.OrgId;
                }

                TdInfo.TdJuJianList = new List<TradeJuJian>();
                ComFunction.GetTradeJuJianList(JJqc, ParentOrgID, ref TdInfo);
                TdInfo.Result = true;
                TdInfo.Desc = "查询成功";
            }
            catch (Exception ex)
            {
                ComFunction.WriteErr(ex);
                TdInfo.Result = false;
                TdInfo.Desc = "查询居间管理失败";
            }
            return TdInfo;
        }