Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 2
0
        public void BindData(BindType bindType)
        {
            var queryArgument = new QueryArgument(UserContext.DataBaseInfo)
            {
                Key       = StageId.ToString(),
                filter1   = Type,
                filter4   = bindType == BindType.List ? Constants.RetriveList : Constants.RetriveForm,
                FilterKey = Constants.TableWFComponents
            };
            var stageMasters = _controlPanel.GetStages(queryArgument);

            if (stageMasters != null)
            {
                if (bindType == BindType.Form)
                {
                    var firstOrDefault = stageMasters.FirstOrDefault();
                    if (firstOrDefault == null)
                    {
                        return;
                    }
                    StageId        = firstOrDefault.Id;
                    StageName      = firstOrDefault.Stage;
                    Link           = firstOrDefault.ActionLink;
                    Teams          = WebControls.SetCheckboxListSelectedItem(Teams, firstOrDefault.Relation1.SplitTo <string>(new string[] { Constants.DelimeterSinglePipe }).ToList());
                    ReferencesData = firstOrDefault.Referances.FirstOrDefault().WFCDesp == null ? new WFComponentSubs() : firstOrDefault.Referances;
                    SubLink        = firstOrDefault.Relation2;
                    uplForm.Update();
                }
                else
                {
                    GridViewTable.DataSource = stageMasters;
                    if (_newPageIndex >= 0)
                    {
                        GridViewTable.PageIndex = _newPageIndex;
                    }
                    GridViewTable.DataSource = stageMasters;
                    GridViewTable.DataBind();
                    UplView.Update();
                }
            }
        }
Exemplo n.º 3
0
 public void BindAccessLevel(Designations designations)
 {
     GridViewTable.DataSource = designations;
     GridViewTable.DataBind();
     UplView.Update();
 }