protected override void OnLoadControlComplete() { DetailGrid dGrid = this.EditForm.FindControl("OrderGrid") as DetailGrid; if (dGrid != null && !this.EditForm.IsReInitForm) { dGrid.ToolBars[0].Title = "选择需要汇总的公司"; dGrid.AddToolBarItems(dGrid.ToolBars); double width = dGrid.ADGrid.Columns[dGrid.ADGrid.Columns.Count - 1].Width.Value; dGrid.ToolBarItemClick += new EventHandler <ToolBarItemClickEventArgs>(dGrid_ToolBarItemClick); } Grid grid = this.EditForm["DetailRemark"] as Grid; if (grid != null) { grid.Height = 250; StackPanel sp = new StackPanel(); sp.Children.Add(new TextBlock { Text = "汇总提示:", FontSize = 12 }); sp.Children.Add(new TextBlock { Text = "1.此功能可满足2级预算汇总功能,若未设置,即按单个公司生成月度预算汇总。", FontSize = 12 }); sp.Children.Add(new TextBlock { Text = "2.设置的汇总人即最后一级汇总提交人", FontSize = 12 }); grid.Children.Add(sp); } }
protected override void OnLoadControlComplete() { base.OnLoadControlComplete(); DetailGrid grid = this.EditForm.FindControl("OrderGrid") as DetailGrid; if (grid != null) { grid.P1.Visibility = System.Windows.Visibility.Visible; List <ToolbarItem> list = new List <ToolbarItem>(); ToolbarItem item = new ToolbarItem { DisplayType = ToolbarItemDisplayTypes.Image, Key = "S1", Title = "按科目查看", ImageUrl = "/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/18_addView.png", }; list.Add(item); item = new ToolbarItem { DisplayType = ToolbarItemDisplayTypes.Image, Key = "S2", Title = "按公司部门单据查看", ImageUrl = "/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/18_addView.png" }; list.Add(item); grid.AddToolBarItems(list); } var dGrid = grid; dGrid.ADGrid.LoadingRow += (object sender, DataGridRowEventArgs e) => { if ((this.EditForm.OperationType == OperationTypes.Add || this.EditForm.OperationType == OperationTypes.Edit || this.EditForm.OperationType == OperationTypes.ReSubmit) && SumType == 1) { var con = dGrid.ADGrid.Columns[7].GetCellContent(e.Row) as StackPanel; Action a2 = () => { Label label = new Label(); label.Content = "已打回"; con.Children.Clear(); con.Children.Add(label); }; Action a1 = () => { ImageButton myButton = new ImageButton(); myButton.Margin = new Thickness(0); myButton.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", "打回"); myButton.Tag = e.Row.DataContext; myButton.Click += (oo, ee) => { Control c = oo as Control; var entity = c.Tag as FBEntity; Action action = () => { // dGrid.Delete(new List<FBEntity> { entity }); var saveEntity = entity.Entity.ToFBEntity(); saveEntity.SetObjValue("Entity.CHECKSTATES", 4); saveEntity.FBEntityState = FBEntityState.Modified; FBEntityService fbs = new FBEntityService(); fbs.SetVisitUser(saveEntity); fbs.FBService.SaveCompleted += (ooo, eee) => { this.CloseProcess(); if (eee.Error != null) { CommonFunction.ShowErrorMessage("操作失败, " + eee.Error.Message); } else if (eee.Result.Exception != null) { CommonFunction.ShowErrorMessage(eee.Result.Exception); } else { a2(); } }; this.ShowProcess(); fbs.FBService.SaveAsync(saveEntity); // none; }; var personName = entity.GetObjValue("Entity.T_FB_COMPANYBUDGETAPPLYMASTER.OWNERDEPARTMENTNAME"); var msg = "你确定要打回 [" + personName + "] 的部门年度预算吗?"; CommonFunction.AskDelete(msg, action); }; con.Children.Clear(); con.Children.Add(myButton); }; var cs = e.Row.DataContext.GetObjValue("Entity.CHECKSTATES") as decimal?; if (cs.Equal(4)) { a2(); } else { a1(); } } }; grid.deatilGridBar.ItemClicked += new EventHandler <ToolBar.ToolBarItemClickArgs>(deatilGridBar_ItemClicked); deatilGridBar_ItemClicked(grid, new ToolBar.ToolBarItemClickArgs("S1")); }
protected override void OnLoadControlComplete() { DetailGrid dGrid = this.EditForm.FindControl("OrderGrid") as DetailGrid; if (dGrid != null && !this.EditForm.IsReInitForm) { dGrid.ToolBars[0].Title = "选择下拨人员"; if (dGrid.ToolBars.Count > 1) { dGrid.ToolBars.Remove(dGrid.ToolBars[1]); } dGrid.AddToolBarItems(dGrid.ToolBars); double width = dGrid.ADGrid.Columns[dGrid.ADGrid.Columns.Count - 1].Width.Value; dGrid.ToolBarItemClick += new EventHandler <ToolBarItemClickEventArgs>(dGrid_ToolBarItemClick); //if (this.OrderEntity.FBEntityState != FBEntityState.Added) //{ // dGrid.ADGrid.Columns[5].Visibility = Visibility.Collapsed; //} //else //{ // dGrid.ADGrid.Columns[5].Visibility = Visibility.Visible; //} var totalWidth = dGrid.ADGrid.Columns.Sum(item => item.Width.Value); dGrid.ADGrid.MinWidth = totalWidth + 10; dGrid.ADGrid.LoadingRow += (object sender, DataGridRowEventArgs e) => { if (this.EditForm.OperationType == OperationTypes.Add || this.EditForm.OperationType == OperationTypes.Edit || this.EditForm.OperationType == OperationTypes.ReSubmit) { var con = dGrid.ADGrid.Columns[1].GetCellContent(e.Row) as StackPanel; ImageButton myButton = new ImageButton(); myButton.Margin = new Thickness(0); myButton.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", Utility.GetResourceStr("DELETE")); myButton.Tag = e.Row.DataContext; myButton.Click += (oo, ee) => { Control c = oo as Control; var entity = c.Tag as FBEntity; Action action = () => { dGrid.Delete(new List <FBEntity> { entity }); // none; }; var personName = entity.GetObjValue("Entity.OWNERNAME"); var msg = "你确定要删除" + personName + "的个人活动经费下拨吗?"; CommonFunction.AskDelete(msg, action); }; con.Children.Clear(); con.Children.Add(myButton); } }; } if (this.EditForm.OperationType != OperationTypes.Add) { LookUp lu = this.EditForm.FindControl("AssignCompanyID") as LookUp; if (lu != null) { lu.IsEnabled = false; } } }