示例#1
0
        protected void ddXMProject_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.ddXMProject.SelectedValue.ToString().Trim().Length > 0)
            {
                //店铺数据源
                if (HozestERPContext.Current.User.CustomerID == 7 || HozestERPContext.Current.User.CustomerID == 84 || HozestERPContext.Current.User.CustomerID == 658)
                {
                    var nickList = base.XMOrderInfoAPIService.GetXMNickList("", Convert.ToInt32(true), Convert.ToInt32(this.ddXMProject.SelectedValue));
                    this.ddlNick.Items.Clear();
                    // var NickListNew = nickList.Where(p => p.nick_id != 16 && p.nick_id != 17 && p.nick_id != 18).ToList();
                    this.ddlNick.DataSource     = nickList;
                    this.ddlNick.DataTextField  = "nick";
                    this.ddlNick.DataValueField = "nick_id";
                    this.ddlNick.DataBind();
                    this.ddlNick.Items.Insert(0, new ListItem("---所有---", "-1"));
                }
                else
                {
                    //其他
                    //var xMNickList = base.XMNickService.GetMyNickListByCustomer(HozestERPContext.Current.User.CustomerID, "", 0);
                    var nickList = base.XMOrderInfoAPIService.GetXMNickListSS("", Convert.ToInt32(true), Convert.ToInt32(this.ddXMProject.SelectedValue), HozestERPContext.Current.User.CustomerID, 0);
                    this.ddlNick.Items.Clear();
                    // var NickListNew = nickList.Where(p => p.nick_id != 16 && p.nick_id != 17 && p.nick_id != 18).ToList();
                    if (nickList.Count() == 0)
                    {
                        this.ddlNick.Items.Insert(0, new ListItem("---无店铺权限---", "0"));
                    }
                    else
                    {
                        if (nickList.Count() > 0)
                        {
                            this.ddlNick.DataSource     = nickList;
                            this.ddlNick.DataTextField  = "nick";
                            this.ddlNick.DataValueField = "nick_id";
                            this.ddlNick.DataBind();
                        }
                        this.ddlNick.Items.Insert(0, new ListItem("---所有---", "99"));
                    }
                }

                int ProjectID = int.Parse(ddXMProject.SelectedValue.ToString());
                var list      = XMClaimReasonService.getList(a => a.ProjectID == ProjectID).ToList();
                foreach (GridViewRow item in grdvClaimInfo.Rows)
                {
                    DropDownList ddlReason = item.FindControl("ddlReason") as DropDownList;
                    ddlReason.DataSource     = list;
                    ddlReason.DataTextField  = "Reason";
                    ddlReason.DataValueField = "Reason";
                    ddlReason.DataBind();
                    ddlReason.Items.Insert(0, new ListItem("---所有---", "-1"));
                    ddlReason.Items[0].Selected = true;
                }
            }
        }
示例#2
0
        protected void grdvClaimInfo_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                var info = e.Row.DataItem as XMClaimInfoDetail;

                //查看详情
                CheckBoxList cblDamagedCondition = e.Row.FindControl("cblDamagedCondition") as CheckBoxList;
                DropDownList ddlReason           = e.Row.FindControl("ddlReason") as DropDownList;

                if (cblDamagedCondition != null)
                {
                    var List = base.CodeService.GetCodeListInfoByCodeTypeID(242, false);//受损情况
                    cblDamagedCondition.DataSource     = List;
                    cblDamagedCondition.DataTextField  = "CodeName";
                    cblDamagedCondition.DataValueField = "CodeID";
                    cblDamagedCondition.DataBind();

                    if (info.DamagedCondition != null)
                    {
                        string[] damagedCondition = info.DamagedCondition.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (ListItem li in cblDamagedCondition.Items)
                        {
                            if (damagedCondition.Contains(li.Value))
                            {
                                li.Selected = true;
                            }
                        }
                    }
                }

                if (ddlReason != null)
                {
                    int ProjectID = int.Parse(ddXMProject.SelectedValue);
                    var list      = XMClaimReasonService.getList(a => a.ProjectID == ProjectID).ToList();
                    ddlReason.DataSource     = list;
                    ddlReason.DataTextField  = "Reason";
                    ddlReason.DataValueField = "Reason";
                    ddlReason.DataBind();
                    ddlReason.Items.Insert(0, new ListItem("---所有---", "-1"));
                    if (string.IsNullOrEmpty(info.Reason))
                    {
                        ddlReason.Items[0].Selected = true;
                    }
                    else
                    {
                        ddlReason.SelectedValue = info.Reason;
                    }
                }
            }
        }