示例#1
0
        public void Init(bool isPostBack)
        {
            _IReimburseView.Operation         = "删除报销单";
            _IReimburseView.SetFormReadonly   = true;
            _IReimburseView.SetDetailReadonly = true;
            AttachViewEvent();
            if (!isPostBack)
            {
                try
                {
                    _IReimburseView.Message = string.Empty;

                    _IReimburseView.ReimburseCategoriesEnumDataSrc = ReimburseCategoriesEnum.GetAll();

                    Employee             employee  = _IReimburseFacade.GetEmployeeReimburseByEmployeeID(_LoginUser.Id);
                    hrmisModel.Reimburse reimburse = employee.FindReimburseByReimburseID(_ReimburseID);
                    employee.Account.Name     = _LoginUser.Name;
                    _IReimburseView.Employee  = employee;
                    _IReimburseView.Reimburse = reimburse;

                    _IReimburseView.ReimburseCategoriesEnumID = reimburse.ReimburseCategoriesEnum.Id.ToString();
                    _IReimburseView.PaperCount   = reimburse.PaperCount.ToString();
                    _IReimburseView.Destinations = reimburse.Destinations;
                    //_IReimburseView.CustomerName = reimburse.CustomerName;
                    _IReimburseView.ProjectName           = reimburse.ProjectName;
                    _IReimburseView.Discription           = reimburse.Discription;
                    _IReimburseView.ConsumeDateFrom       = reimburse.ConsumeDateFrom.ToShortDateString();
                    _IReimburseView.ConsumeDateFromHour   = reimburse.ConsumeDateFrom.Hour.ToString();
                    _IReimburseView.ConsumeDateFromMinute = reimburse.ConsumeDateFrom.Minute.ToString();
                    _IReimburseView.ConsumeDateTo         = reimburse.ConsumeDateTo.ToShortDateString();
                    _IReimburseView.ConsumeDateToHour     = reimburse.ConsumeDateTo.Hour.ToString();
                    _IReimburseView.ConsumeDateToMinute   = reimburse.ConsumeDateTo.Minute.ToString();

                    _IReimburseView.DepartmentName      = _LoginUser.Dept.DepartmentName;
                    _IReimburseView.ReimburseItemSource = reimburse.ReimburseItems;
                    _IReimburseView.SetDeleteFormButton = 2;
                    _IReimburseView.ExchangeRateSource  = ExchangeRateLogic.GetExchangeRateDistinctName();
                    _IReimburseView.ExchangeRateID      = reimburse.ExchangeRateID;
                    BindReimburseHistorySource();
                }
                catch
                {
                    _IReimburseView.Message = "初始化信息失败";
                }
                // 差旅报销
                if (_IReimburseView.ReimburseCategoriesEnumID == "0")
                {
                    _IReimburseView.IsTravelReimburse = true;
                }
                // 非差旅报销
                else if (_IReimburseView.ReimburseCategoriesEnumID == "1")
                {
                    _IReimburseView.IsTravelReimburse = false;
                }
            }
        }
示例#2
0
        public void Init(bool isPostBack)
        {
            AttachViewEvent();
            if (!isPostBack)
            {
                Employee             employee  = _IReimburseFacade.GetEmployeeReimburseByEmployeeID(_LoginUser.Id);
                hrmisModel.Reimburse reimburse = employee.FindReimburseByReimburseID(_ReimburseID);

                if (reimburse.ReimburseStatus == ReimburseStatusEnum.Reimbursing)
                {
                    employee.Account.Name         = _LoginUser.Name;
                    _IPrintReimburseView.Employee = employee;

                    _IPrintReimburseView.Reimburse = reimburse;

                    if (reimburse.ReimburseCategoriesEnum == ReimburseCategoriesEnum.TravelReimburse)
                    {
                        _IPrintReimburseView.Title        = "差旅费报销单";
                        _IPrintReimburseView.Destinations = reimburse.Destinations;
                        //_IPrintReimburseView.CustomerName = reimburse.CustomerName;
                        _IPrintReimburseView.ProjectName = reimburse.ProjectName;
                    }
                    else
                    {
                        _IPrintReimburseView.Title = "非差旅费报销单";
                    }

                    _IPrintReimburseView.DepartmentName = reimburse.Department.DepartmentName;


                    _IPrintReimburseView.PaperCount  = reimburse.PaperCount.ToString();
                    _IPrintReimburseView.ConsumeDate = reimburse.ConsumeDateFrom + " -- " +
                                                       reimburse.ConsumeDateTo;



                    //// 公司名称
                    //_IPrintReimburseView.CompanyName =
                    //    BllInstance.DepartmentBllInstance.GetDepartmentById(
                    //        employee.EmployeeDetails.Work.Company.DepartmentID, _LoginUser).DepartmentName;
                    _IPrintReimburseView.ReimburseItemSource = reimburse.ReimburseItems;
                }
                //// CEO
                //Account accountCeo = _IReimburseFacade.IsCEOElectricName(reimburse);
                //if (accountCeo != null)
                //{
                //    byte[] ElectricNameCeo = BllInstance.AccountBllInstance.GetElectronIdiographByAccountID(accountCeo);
                //    string usbkeyCeo = BllInstance.AccountBllInstance.GetAccountById(
                //        accountCeo.Id).UsbKey;
                //    if (usbkeyCeo != null && ElectricNameCeo != null)
                //    {
                //        _IPrintReimburseView.CEOElectricName = BindElectricName(ElectricNameCeo, usbkeyCeo);
                //    }
                //}
                //// 财务
                //Account accountFinance = _IReimburseFacade.IsFinanceElectricName(reimburse);
                //if (accountFinance != null)
                //{
                //    byte[] ElectricNameFinance = BllInstance.AccountBllInstance.GetElectronIdiographByAccountID(accountFinance);
                //    string usbkeyFinance = BllInstance.AccountBllInstance.GetAccountById(
                //        accountFinance.Id).UsbKey;
                //    if (usbkeyFinance != null && ElectricNameFinance != null)
                //    {
                //        _IPrintReimburseView.FinanceElectricName = BindElectricName(ElectricNameFinance, usbkeyFinance);
                //    }
                //}
                //// 部门领导
                //Account accountDepartmentLeader = _IReimburseFacade.IsDepartmentLeaderElectricName(reimburse);
                //if (accountDepartmentLeader != null)
                //{
                //    byte[] ElectricNameDepartmentLeader = BllInstance.AccountBllInstance.GetElectronIdiographByAccountID(accountDepartmentLeader);
                //    string usbkeyDepartmentLeader = BllInstance.AccountBllInstance.GetAccountById(
                //        accountDepartmentLeader.Id).UsbKey;
                //    if (usbkeyDepartmentLeader != null && ElectricNameDepartmentLeader != null)
                //    {
                //        _IPrintReimburseView.DepartmentLeaderElectricName = BindElectricName(ElectricNameDepartmentLeader, usbkeyDepartmentLeader);
                //    }
                //}
                //_IPrintReimburseView.RecipientsElectricName = SecurityUtil.SymmetricDecryptStream(BllInstance.AccountBllInstance.GetElectronIdiographByAccountID(_LoginUser), BllInstance.AccountBllInstance.GetAccountById(
                //                         _LoginUser.Id).UsbKey);
            }
        }