Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
        {
            //ddlTypeSupp.SelectedValue = "";
            int typeId = 0;

            int.TryParse(this.ddlType.SelectedValue, out typeId);
            if (typeId > 0)
            {
                viviapi.Model.Channel.ChannelTypeInfo type = ChannelType.GetModelByTypeId(typeId);
                if (type != null)
                {
                    //ddlTypeSupp.SelectedValue = type.supplier.ToString();
                    litTypeSupplier.Text      = WebUtility.GetSupplierName(type.supplier);
                    rblTypeOpen.SelectedValue = ((int)type.isOpen).ToString();
                }
            }
        }
Пример #2
0
        private void LoadData()
        {
            DataTable data = viviapi.BLL.Channel.ChannelType.GetList(true).Tables[0];

            //通道类别状态
            if (!data.Columns.Contains("type_status"))
            {
                data.Columns.Add("type_status", typeof(string));
            }

            //系统设置
            if (!data.Columns.Contains("sys_setting"))
            {
                data.Columns.Add("sys_setting", typeof(string));
            }

            //用户前台设置
            if (!data.Columns.Contains("user_setting"))
            {
                data.Columns.Add("user_setting", typeof(string));
            }

            if (!data.Columns.Contains("payrate"))
            {
                data.Columns.Add("payrate", typeof(double));
            }

            if (!data.Columns.Contains("suppid"))
            {
                data.Columns.Add("suppid", typeof(int));
            }



            foreach (DataRow dr in data.Rows)
            {
                int typeId = int.Parse(dr["typeId"].ToString());

                bool type_stutas  = false;
                bool?sys_setting  = null;
                bool?user_setting = null;

                ChannelTypeUserInfo setting  = ChannelTypeUsers.GetModel(CurrentUser.ID, typeId);
                ChannelTypeInfo     typeInfo = ChannelType.GetModelByTypeId(typeId);
                switch (typeInfo.isOpen)
                {
                case OpenEnum.Close:
                case OpenEnum.AllClose:

                    type_stutas = false;
                    break;

                case OpenEnum.Open:
                case OpenEnum.AllOpen:
                    type_stutas = true;
                    break;
                }

                dr["type_status"]  = type_stutas ? "right" : "wrong";
                dr["sys_setting"]  = "Unknown";
                dr["user_setting"] = "Unknown";

                dr["suppid"] = 0;
                if (setting != null)
                {
                    if (setting.sysIsOpen.HasValue)
                    {
                        dr["sys_setting"] = setting.sysIsOpen.Value ? "right" : "wrong";
                        if (!setting.sysIsOpen.Value) //如果端口未开放
                        {
                            if (typeId == 101)        //支付宝
                            {
                                class992 = hid;
                            }
                            else if (typeId == 100)//财付通
                            {
                                class993 = hid;
                            }
                            else if (typeId == 207)//微信支付
                            {
                                class1004 = hid;
                            }
                            else if (typeId == 300)//wap微信支付
                            {
                                class1007 = hid;
                            }
                            else if (typeId == 213)//qq支付
                            {
                                class51 = hid;
                            }
                            else if (typeId == 200)//Wap支付宝
                            {
                                class1008 = hid;
                            }
                            lit1.Text += "sysIsOpen" + typeId + ",";
                        }
                    }
                    if (setting.userIsOpen.HasValue)
                    {
                        dr["user_setting"] = setting.userIsOpen.Value ? "right" : "wrong";
                        if (!setting.userIsOpen.Value) //如果端口未开放
                        {
                            if (typeId == 101)         //支付宝
                            {
                                class992 = hid;
                            }
                            else if (typeId == 100)//财付通
                            {
                                class993 = hid;
                            }
                            else if (typeId == 207)//微信支付
                            {
                                class1004 = hid;
                            }
                            else if (typeId == 300)//wap微信支付
                            {
                                class1007 = hid;
                            }
                            else if (typeId == 213)//qq支付
                            {
                                class51 = hid;
                            }
                            else if (typeId == 200)//Wap支付宝
                            {
                                class1008 = hid;
                            }
                            lit2.Text += "userIsOpen" + typeId + ",";
                        }
                    }
                    lit3.Text += "userIsOpenuserIsOpen" + typeId + ",";

                    if (setting.suppid.HasValue)
                    {
                        dr["suppid"] = setting.suppid.Value;
                    }
                }
                //dr["payrate"] = 100 * viviapi.BLL.Finance.PayRate.Instance.GetUserPayRate(this.UserID, Convert.ToInt32(dr["typeId"]));
            }
            //rpt_paymode.DataSource = data;
            //rpt_paymode.DataBind();
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        private void LoadData()
        {
            DataTable data = viviapi.BLL.Channel.ChannelType.GetList(true).Tables[0];

            //通道类别状态
            if (!data.Columns.Contains("type_status"))
            {
                data.Columns.Add("type_status", typeof(string));
            }

            //系统设置
            if (!data.Columns.Contains("sys_setting"))
            {
                data.Columns.Add("sys_setting", typeof(string));
            }

            //用户前台设置
            if (!data.Columns.Contains("user_setting"))
            {
                data.Columns.Add("user_setting", typeof(string));
            }

            if (!data.Columns.Contains("payrate"))
            {
                data.Columns.Add("payrate", typeof(double));
            }

            if (!data.Columns.Contains("suppid"))
            {
                data.Columns.Add("suppid", typeof(int));
            }



            foreach (DataRow dr in data.Rows)
            {
                int typeId = int.Parse(dr["typeId"].ToString());

                bool type_stutas  = false;
                bool?sys_setting  = null;
                bool?user_setting = null;

                ChannelTypeUserInfo setting  = ChannelTypeUsers.GetModel(UserID, typeId);
                ChannelTypeInfo     typeInfo = ChannelType.GetModelByTypeId(typeId);
                switch (typeInfo.isOpen)
                {
                case OpenEnum.Close:
                case OpenEnum.AllClose:
                    type_stutas = false;
                    break;

                case OpenEnum.Open:
                case OpenEnum.AllOpen:
                    type_stutas = true;
                    break;
                }

                dr["type_status"]  = type_stutas ? "right" : "wrong";
                dr["sys_setting"]  = "Unknown";
                dr["user_setting"] = "Unknown";

                dr["suppid"] = 0;
                if (setting != null)
                {
                    if (setting.sysIsOpen.HasValue)
                    {
                        dr["sys_setting"] = setting.sysIsOpen.Value ? "right" : "wrong";
                    }
                    if (setting.userIsOpen.HasValue)
                    {
                        dr["user_setting"] = setting.userIsOpen.Value ? "right" : "wrong";
                    }
                    if (setting.suppid.HasValue)
                    {
                        dr["suppid"] = setting.suppid.Value;
                    }
                }
                dr["payrate"] = 100 * viviapi.BLL.Finance.PayRate.Instance.GetUserPayRate(this.UserID, Convert.ToInt32(dr["typeId"]));
            }
            rpt_paymode.DataSource = data;
            rpt_paymode.DataBind();
        }