Beispiel #1
0
        public SaveResult Save(FBEntity fbEntity, CurrentUserPost user)
        {
            SaveResult result = new SaveResult();

            try
            {
                using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
                {
                    fbCommonBLL.user = user;
                    fbCommonBLL.BeginTransaction();
                    result = fbCommonBLL.FBCommSaveEntity(fbEntity);
                    if (result.Successful)
                    {
                        fbCommonBLL.CommitTransaction();
                    }
                }
            }
            catch (Exception ex)
            {
                result.Successful = false;
                result.Exception  = ex.Message;
                Tracer.Debug(ex.ToString());
            }
            return(result);
        }
Beispiel #2
0
        public void Save(FBEntity fbEntity)
        {
            SetVisitUser(fbEntity);
            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;
            FBService.SaveAsync(fbEntity, user);
        }
Beispiel #3
0
 public bool SaveList(List <FBEntity> fbEntityList, CurrentUserPost user)
 {
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             return(fbCommonBLL.FBcommonBllSaveList(fbEntityList));
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         throw ex;
     }
 }
Beispiel #4
0
        public void SaveList(ObservableCollection <FBEntity> listOfFBEntity)
        {
            //for (int i = 0; i < listOfFBEntity.Count; i++)
            //{
            //    fbService.SaveAsync(listOfFBEntity[i]);
            //}
            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;

            FBService.SaveListAsync(listOfFBEntity, user);
        }
Beispiel #5
0
        public void SaveList(ObservableCollection<FBEntity> listOfFBEntity)
        {
            //for (int i = 0; i < listOfFBEntity.Count; i++)
            //{
            //    fbService.SaveAsync(listOfFBEntity[i]);
            //}
            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;

            FBService.SaveListAsync(listOfFBEntity, user);
        }
Beispiel #6
0
        public void Save(FBEntity fbEntity)
        {
            SetVisitUser(fbEntity);
            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;
            FBService.SaveAsync(fbEntity, user);

         
        }
Beispiel #7
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"));
        }
Beispiel #8
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"));
        }
Beispiel #9
0
 public bool SaveList(List<FBEntity> fbEntityList,CurrentUserPost user)
 {
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             return fbCommonBLL.FBcommonBllSaveList(fbEntityList);
         }
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         throw ex;
     }
     
 }
Beispiel #10
0
 public SaveResult Save(FBEntity fbEntity,CurrentUserPost user)
 {
     SaveResult result = new SaveResult();
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             fbCommonBLL.BeginTransaction();
             result = fbCommonBLL.FBCommSaveEntity(fbEntity);
             if (result.Successful)
             {
                 fbCommonBLL.CommitTransaction();
             }
         }
     }
     catch (Exception ex)
     {
         result.Successful = false;
         result.Exception = ex.Message;
         Tracer.Debug(ex.ToString());
     }
     return result;
 }