Ejemplo n.º 1
0
 public QueryFBOrder()
 {
     InitializeComponent();
     this.FBBasePageLoaded += new EventHandler(QueryBudgetAccount_FBBasePageLoaded);
     fbEntityService = new FBEntityService();
     fbEntityService.QueryFBEntitiesCompleted += new EventHandler<QueryFBEntitiesCompletedEventArgs>(fbEntityService_QueryFBEntitiesCompleted);
 }
Ejemplo n.º 2
0
 public DeptBudgetAddForm(OrderEntity orderEntity)
     : base(orderEntity)
 {
     fbService = new FBEntityService();
     fbService.QueryFBEntitiesCompleted += new EventHandler<QueryFBEntitiesCompletedEventArgs>(fbService_QueryFBEntitiesCompleted);
     this.EditForm.Saving += new EventHandler<SavingEventArgs>(EditForm_Saving);
 }
Ejemplo n.º 3
0
        public static void InitDataCore()
        {
            if (SMT.SAAS.Main.CurrentContext.Common.CurrentConfig == null)
            {
                throw new Exception("没有登录信息");
            }
            CompanyList = new List <VirtualCompany>();

            //InitHR(); --2011年6月21日注释,原因是:新平台组织架构缓存是按需加载,因此不能直接使用了
            InitHR();  // 新的加载2013.12.24

            FBEntityService service = new FBEntityService();

            service.QueryFBEntitiesCompleted += new EventHandler <QueryFBEntitiesCompletedEventArgs>(service_QueryFBEntitiesCompleted);

            var fbVersion = "";

            service.QueryFBEntities(new QueryExpression()
            {
                QueryType = "InitDataCore", PropertyName = "FBVerson", PropertyValue = fbVersion
            });

            SuperUser                  = new EmployeerData();
            SuperUser.Company          = new CompanyData();
            SuperUser.Department       = new DepartmentData();
            SuperUser.Post             = new PostData();
            SuperUser.Company.Value    = "001";
            SuperUser.Company.Text     = "001";
            SuperUser.Department.Value = "001";
            SuperUser.Department.Text  = "001";
            SuperUser.Post.Value       = "001";
            SuperUser.Post.Text        = "001";
            SuperUser.Value            = "001";
            SuperUser.Text             = "001";
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 个人经费下拨 构造函数
 /// </summary>
 /// <param name="orderEntity"></param>
 public PersonMoneyAssignAAForm(OrderEntity orderEntity)
     : base(orderEntity)
 {
     fbService = new FBEntityService();
     fbService.QueryFBEntitiesCompleted += new EventHandler<QueryFBEntitiesCompletedEventArgs>(fbService_QueryFBEntitiesCompleted);
     this.EditForm.Saving += new EventHandler<SavingEventArgs>(EditForm_Saving);
 }
Ejemplo n.º 5
0
 public static void QueryFBEntities(QueryExpression qe, Action<object, QueryFBEntitiesCompletedEventArgs> callBackMethod)
 {
     FBEntityService service = new FBEntityService();
     service.QueryFBEntitiesCompleted += (o, e) =>
         {
             callBackMethod(o, e);
         };
     service.QueryFBEntities(qe);
 }
Ejemplo n.º 6
0
 void SystemSetting_FBBasePageLoaded(object sender, EventArgs e)
 {
     InitToolBar();
     FBEntityService fbService = new FBEntityService();
     QueryExpression qe = new QueryExpression();
     qe.QueryType = typeof(T_FB_SYSTEMSETTINGS).Name;
     fbService.QueryFBEntitiesCompleted += new EventHandler<QueryFBEntitiesCompletedEventArgs>(fbService_QueryFBEntitiesCompleted);
     fbService.QueryFBEntities(qe);
 }
Ejemplo n.º 7
0
        public static void QueryFBEntities(QueryExpression qe, Action <object, QueryFBEntitiesCompletedEventArgs> callBackMethod)
        {
            FBEntityService service = new FBEntityService();

            service.QueryFBEntitiesCompleted += (o, e) =>
            {
                callBackMethod(o, e);
            };
            service.QueryFBEntities(qe);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 预算汇总设置 构造函数
 /// </summary>
 /// <param name="orderEntity"></param>
 public SumSettingsForm(OrderEntity orderEntity)
     : base(orderEntity)
 {
     fbService = new FBEntityService();
     this.EditForm.Saving += new EventHandler<SavingEventArgs>(EditForm_Saving);
 }
Ejemplo n.º 9
0
        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();

                                CurrentUserPost user = new CurrentUserPost();
                                user.EmployeeName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName;
                                user.EmployeeID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID;
                                user.PostName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].PostName;
                                user.DepartmentName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].DepartmentName;
                                user.CompanyName = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserPosts[0].CompanyName;
                              
                                fbs.FBService.SaveAsync(saveEntity,user);
                                // none;
                            };
                            var personName = entity.GetObjValue("Entity.T_FB_DEPTBUDGETAPPLYMASTER.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"));
        }