コード例 #1
0
        public void Initial(string mode, long costCenterID)
        {
            ResetValue();
            Mode         = mode;
            CostCenterID = costCenterID;
            if (mode == FlagEnum.EditFlag)
            {
                DbCostCenter costCenter = DbCostCenterService.FindByIdentity(costCenterID);
                if ((costCenter.CompanyID != null))
                {
                    DbCompany company = DbCompanyService.FindByIdentity(costCenter.CompanyID.CompanyID);
                    ctlCompanyTextboxAutoComplete.CompanyCode = costCenter.CompanyID.CompanyCode;
                }

                this.CostCenterCode              = costCenter.CostCenterCode;
                ctlCostCenterCodeLabel.Text      = costCenter.CostCenterCode;
                ctlCostCenterCodeLabel.Visible   = true;
                ctlTextBoxCostCenterCode.Visible = false;
                ctlTextBoxDescription.Text       = costCenter.Description;

                //ctlCalendarValid.DateValue = costCenter.Valid.ToString(Constant.CalendarDateFormat);
                //ctlCalendarExpire.DateValue = costCenter.Valid.ToString(Constant.CalendarDateFormat);

                ctlCalendarValid.Value  = costCenter.Valid;
                ctlCalendarExpire.Value = costCenter.Expire;
                ctlChkLock.Checked      = costCenter.ActualPrimaryCosts;
                ctlChkActive.Checked    = costCenter.Active;
                ctlBusinessArea.Text    = costCenter.BusinessArea;
                ctlProfitCenter.Text    = costCenter.ProfitCenter;
            }
        }
コード例 #2
0
        public static Company GetCompany(long CompanyID)
        {
            DbCompanyService dbComService = new DbCompanyService();
            DbCompany        dbCompany    = dbComService.FindByIdentity(CompanyID);

            Company com = new Company();

            if (dbCompany != null)
            {
                com.CompanyID   = dbCompany.CompanyCode;
                com.CompanyName = dbCompany.CompanyName;
            }
            else
            {
                com.CompanyID   = "";
                com.CompanyName = "";
            }
            return(com);
        }
コード例 #3
0
        public static string GetFixedPostingAccountReturnCr(long UserID)
        {
            SuUserService    suUserService   = new SuUserService();
            SuUser           suUser          = suUserService.FindByIdentity(UserID);
            DbCompanyService dbComService    = new DbCompanyService();
            DbCompany        dbCompany       = dbComService.FindByIdentity(suUser.Company.CompanyID);
            string           fixedadvanceAcc = "";

            if (dbCompany != null)
            {
                //fixedadvanceAcc = "113220";
                fixedadvanceAcc = "111250";
            }
            else
            {
                //fixedadvanceAcc = "111250";
                fixedadvanceAcc = "113220";
            }
            return(fixedadvanceAcc);
        }
コード例 #4
0
        public static Employee GetEmployee(long UserID)
        {
            SuUserService    suUserService = new SuUserService();
            SuUser           suUser        = suUserService.FindByIdentity(UserID);
            DbCompanyService dbComService  = new DbCompanyService();
            DbCompany        dbCompany     = dbComService.FindByIdentity(suUser.Company.CompanyID);

            Employee emp = new Employee();

            if (suUser != null)
            {
                emp.EmployeeID     = suUser.EmployeeCode;
                emp.EmployeeName   = suUser.EmployeeName;
                emp.UserName       = suUser.UserName;
                emp.CostCenterCode = suUser.CostCenterCode;
                emp.VendorCode     = suUser.VendorCode;
            }
            else
            {
                emp.EmployeeID     = string.Empty;
                emp.EmployeeName   = string.Empty;
                emp.UserName       = string.Empty;
                emp.CostCenterCode = string.Empty;
                emp.VendorCode     = string.Empty;
            }

            if (dbCompany != null)
            {
                emp.CompanyID   = dbCompany.CompanyCode;
                emp.CompanyName = dbCompany.CompanyName;
            }
            else
            {
                emp.CompanyID   = "";
                emp.CompanyName = "";
            }

            return(emp);
        }