Пример #1
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = TeamId.ToString(),
                filter1   = Type,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableWFComponents
            };
            var teamMasters = _controlPanel.GetTeams(queryArgument);

            if (teamMasters != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = teamMasters.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    TeamId     = firstOrDefault.ComponentId;
                    TeamName   = firstOrDefault.ComponentDesp;
                    Categories = WebControls.SetCheckboxListSelectedItem(Categories, firstOrDefault.Relation1.SplitTo <string>(new string[] { Constants.DelimeterSinglePipe }).ToList());

                    Users = WebControls.SetCheckboxListSelectedItem(Users, firstOrDefault.wfComponentSubs.Select(x => x.WFCSCode).ToList());
                    uplForm.Update();
                }
                else
                {
                    var team = teamMasters.ToList();
                    if (UserContext.UserProfile.Designation.Id.Trim() != "SA")
                    {
                        if (teamMasters.Any())
                        {
                            team = teamMasters.Where(x => x.ComponentId.Trim() != "13").ToList();
                        }
                    }
                    GridViewTable.DataSource = team;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = team;
                    GridViewTable.DataBind();
                    UplView.Update();
                }
            }
        }