Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void rpt_paymode_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                DataRowView dr     = e.Item.DataItem as DataRowView;
                int         typeId = int.Parse(dr["typeId"].ToString());

                ChannelTypeUserInfo setting = ChannelTypeUsers.GetModel(UserID, typeId);
                if (setting != null)
                {
                    if (setting.sysIsOpen.HasValue)
                    {
                        Button btnOpen  = e.Item.FindControl("btn_open") as Button;
                        Button btnClose = e.Item.FindControl("btn_close") as Button;

                        btnOpen.Enabled  = !setting.sysIsOpen.Value;
                        btnClose.Enabled = setting.sysIsOpen.Value;
                    }
                }

                DropDownList ddlsupp = e.Item.FindControl("ddlsupp") as DropDownList;
                if (ddlsupp != null)
                {
                    ////ddlsupp.Visible = (typeId == 102);
                    //if (typeId == 102)
                    //{

                    //}

                    int suppid = int.Parse(dr["suppid"].ToString());
                    bind(ddlsupp, suppid);
                }
            }
        }
Beispiel #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();
        }
Beispiel #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();
        }