예제 #1
0
        public void GenerateNewTransactionCode(IDomainDataProvider dataProvider)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(dataProvider);

            this.m_TransactionCode = TransferFacade.MOMaterialTransferJobID + "_"
                                     + currentDateTime.DBDate.ToString() + "_" + currentDateTime.DBTime.ToString() + DateTime.Now.Millisecond.ToString();
        }
예제 #2
0
        private void RunSP(object jobName)
        {
            try
            {
                DataRow rowOfJob = this.FindRow(jobName.ToString());
                rowOfJob["RunStatus"] = "运行中";

                ProcedureParameter pp1 = new ProcedureParameter("v_jobList", typeof(string), 40, DirectionType.Input, jobName.ToString());
                ProcedureParameter pp2 = new ProcedureParameter("v_date", typeof(int), 8, DirectionType.Input, m_InputDate);

                ProcedureCondition pc = new ProcedureCondition("PKG_DBTRANSFER.Transfer", new ProcedureParameter[] { pp1, pp2 });

                // 多线程Run每一个任务,每一个任务自己创建自己的数据库链接
                IDomainDataProvider newProvider = DomainDataProviderManager.DomainDataProvider();
                newProvider.CustomProcedure(ref pc);

                Thread.Sleep(10000);

                rowOfJob["RunStatus"] = "完成";

                TransferJob job = TransferFacade.GetTransferJob(Convert.ToInt32(rowOfJob["Serial"])) as TransferJob;
                rowOfJob["LastRunDate"]     = job.LastRunDate == 0 ? "0" : FormatHelper.TODateTimeString(job.LastRunDate, job.LastRunTime);
                rowOfJob["LastSuccessDate"] = job.LastSuccessDate == 0 ? "0" : FormatHelper.TODateTimeString(job.LastSuccessDate, job.LastSuccessTime);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Invoke(new Action <int>(this.SetFlag), 1);
            }
        }
예제 #3
0
        public SystemParameterListBuilder(string paramGroupCode, string orderbyColumn, IDomainDataProvider dataProvider)
        {
            this._paramGroupCode = paramGroupCode.ToUpper();
            this._orderbyColumn  = orderbyColumn.ToUpper();

            _dataProvider = dataProvider;
        }
예제 #4
0
 private ApplicationService(IDomainDataProvider _dataProvider)
 {
     if (_dataProvider != null)
     {
         _dataProvider = _dataProvider;
     }
 }
예제 #5
0
 public static void CheckDomainObject(object domainObject, IDomainDataProvider domainObjectDataProvider)
 {
     if (!(domainObject is DomainObject))
     {
         ExceptionManager.Raise(typeof(DomainObject), "$Error_Should_Be_DomainObject", string.Format("[$DomainObject={0}]", domainObject), null);
     }
 }
예제 #6
0
 public static void CheckDomainObject(object domainObject, IDomainDataProvider domainObjectDataProvider)
 {
     if (!(domainObject is DomainObject))
     {
         throw new Exception(string.Format("$Error_Should_Be_DomainObject[$DomainObject={0}]", domainObject));
     }
 }
예제 #7
0
        public bool InitWithoutResAndOP(IDomainDataProvider dataProvider, string ssCode, DBDateTime dbDateTime)
        {
            bool returnValue = false;

            BaseModelFacade  baseModelFacade  = new BaseModelFacade(dataProvider);
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(dataProvider);

            _DataProvider = dataProvider;
            _DBDateTime   = dbDateTime;

            //获取对应的SS
            _StepSequence = (StepSequence)baseModelFacade.GetStepSequence(ssCode);
            if (_StepSequence == null)
            {
                return(returnValue);
            }

            //获取当前的ShiftDate
            _ShiftDate = shiftModelFacade.GetShiftDayBySS(_StepSequence, _DBDateTime.DateTime);

            //获取当前的Shift
            _Shift = (Shift)shiftModelFacade.GetShift(_StepSequence.ShiftTypeCode, _DBDateTime.DBTime);
            if (_Shift == null)
            {
                return(returnValue);
            }

            returnValue = true;

            return(returnValue);
        }
예제 #8
0
 public DeleteAssociateCheck(DomainObject obj, IDomainDataProvider dataProvider, Type[] associateTypes)
 {
     this._objs = new DomainObject[1] {
         obj
     };
     this._provider = dataProvider;
     this._types    = associateTypes;
 }
예제 #9
0
파일: Common.cs 프로젝트: windygu/.net-wms
        public static void GetDBDateTime(out int intDate, out int intTime, IDomainDataProvider dataProvider)
        {
            DBDateTime dbDateTime = FormatHelper.GetNowDBDateTime(dataProvider);
            DateTime   dtNow      = FormatHelper.ToDateTime(dbDateTime.DBDate, dbDateTime.DBTime);

            intDate = FormatHelper.TODateInt(dtNow);
            intTime = FormatHelper.TOTimeInt(dtNow);
        }
예제 #10
0
 public ReportSQLHelper(IDomainDataProvider domainDataProvider)
 {
     this._DomainDataProvider = domainDataProvider;
     if (_DomainDataProvider == null)
     {
         _DomainDataProvider = DomainDataProviderManager.DomainDataProvider();
     }
 }
예제 #11
0
//		private CacheManager	_cacheManager = null;

        private ApplicationService(IDomainDataProvider _dataProvider)
        {
            if (_dataProvider != null) //added by carey.cheng on 2010-05-20 for muti db support
            {
                _menuSerivce = new MenuService(_dataProvider);
            }
            ;
        }
예제 #12
0
 public ImportDataEngine(IDomainDataProvider _dataProvider, List <ConfigObject> _listConfigObject, MatchType _matchType, string _userCode, DBDateTime _dbDateTime)
 {
     dataProvider  = _dataProvider;
     listConfigObj = _listConfigObject;
     matchType     = _matchType;
     userCode      = _userCode.Trim().ToUpper();
     dbDateTime    = _dbDateTime;
 }
예제 #13
0
        public ModuleSecurityEntity(Module module, string viewRights, IDomainDataProvider domainDataProvider)
        {
            this._domainDataProvider = domainDataProvider;
            this._module             = module;
            this._viewRights         = viewRights;

            this._distributeViewRights();
        }
예제 #14
0
        public DNConfrimArgument(IDomainDataProvider dataProvider)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(dataProvider);

            this.m_TransactionCode = TransferFacade.DNConfirmJobID + "_"
                                     + currentDateTime.DBDate.ToString()
                                     + "_" + currentDateTime.DBTime.ToString()
                                     + DateTime.Now.Millisecond.ToString();
        }
예제 #15
0
        public UserSecurityEntity(User user, IDomainDataProvider domainDataProvider)
        {
            this._domainDataProvider = domainDataProvider;
            this._user = user;

            this._loadUserGroupSecurityEntity();

            this._mergeSecurity();
        }
예제 #16
0
        public MaterialPOTransferArgument(IDomainDataProvider domainDataProvider)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(domainDataProvider);

            this.m_TransactionCode = TransferFacade.MaterialPOJobID + "_"
                                     + currentDateTime.DBDate.ToString()
                                     + "_" + currentDateTime.DBTime.ToString()
                                     + DateTime.Now.Millisecond.ToString();
        }
예제 #17
0
        public void LoadErrorList(string itemCode, IDomainDataProvider dataProvider)
        {
            TSModelFacade tsFacade = new TSModelFacade(dataProvider);

            try
            {
                this.ClearErrorList();

                object[] errorCodeGroups = tsFacade.GetErrorCodeGroupByItemCode(itemCode);
                if (errorCodeGroups != null)
                {
                    string  errorGroupList = "";
                    DataRow newRow;
                    foreach (ErrorCodeGroupA errorGroup in errorCodeGroups)
                    {
                        errorGroupList += errorGroup.ErrorCodeGroup + ",";

                        newRow = this.m_ErrorList.Tables["ErrorGroup"].NewRow();
                        newRow["ErrorGroupCode"]        = errorGroup.ErrorCodeGroup;
                        newRow["ErrorGroupDescription"] = errorGroup.ErrorCodeGroupDescription;
                        this.m_ErrorList.Tables["ErrorGroup"].Rows.Add(newRow);
                    }
                    if (errorGroupList.Length > 0)
                    {
                        errorGroupList = errorGroupList.Substring(0, errorGroupList.Length - 1);
                    }

                    // Get ErrorCode List By ErrorGroupList
                    if (errorGroupList.Length > 0)
                    {
                        object[] errorCodes = tsFacade.GetErrorCodeByErrorGroupList(errorGroupList);
                        if (errorCodes != null)
                        {
                            DataRow row;
                            foreach (ErrorGrou2ErrorCode4OQC eg2ec in errorCodes)
                            {
                                row                         = this.m_ErrorList.Tables["ErrorCode"].NewRow();
                                row["Checked"]              = "false";
                                row["ErrorCodeCode"]        = eg2ec.ErrorCode;
                                row["ErrorCodeDescription"] = eg2ec.ErrorCodeDescription;
                                row["ErrorGroupCode"]       = eg2ec.ErrorCodeGroup;
                                this.m_ErrorList.Tables["ErrorCode"].Rows.Add(row);
                            }
                        }
                    }

                    this.m_ErrorList.Tables["ErrorGroup"].AcceptChanges();
                    this.m_ErrorList.Tables["ErrorCode"].AcceptChanges();
                    this.m_ErrorList.AcceptChanges();
                    this.ultraGridErrorList.DataSource = this.m_ErrorList;
                }
            }
            catch (Exception ex)
            {
            }
        }
예제 #18
0
 private void Init()
 {
     //_persistBroker = PersistBrokerManager.PersistBroker(@"Provider=Microsoft.Jet.OLEDB.4.0;Password=;Data Source=" + this.FullPath + ";Persist Security Info=True", null);
     //add by klaus
     _persistBroker = PersistBrokerManager.PersistBroker(@"Provider=Microsoft.ACE.OLEDB.12.0;Password=;Data Source=" + this.FullPath + ";Persist Security Info=False", null);
     //end
     _domainDataProvider = DomainDataProviderManager.DomainDataProvider(_persistBroker, null);
     _languageHashtable  = new System.Collections.Hashtable();
     this.CacheLanguage();
 }
예제 #19
0
        public ReportSQLEngine(IDomainDataProvider domainDataProvider, LanguageComponent languageComponent)
        {
            _DomainDataProvider = domainDataProvider;
            _LanguageComponent  = languageComponent;

            //if (_DomainDataProvider == null)
            //{
            //    _DomainDataProvider = DomainDataProviderManager.DomainDataProvider();
            //}
        }
예제 #20
0
 public ImportDateEngine(IDomainDataProvider dataProvider, LanguageComponent languageComponent1, string importType, DataTable table, string userCode, ArrayList importGridRow, GridHelperNew _gridHelper)
 {
     _DataProvider       = dataProvider;
     _LanguageComponent1 = languageComponent1;
     _ImportType         = importType;
     _ImportDataTable    = table;
     _UserCode           = userCode;
     _ImportGridRow      = importGridRow;
     this.gridHelper     = _gridHelper;
 }
예제 #21
0
 public static Updater GetCsVersion(IDomainDataProvider domainDataProvider)
 {
     object[] objs = domainDataProvider.CustomQuery(typeof(Updater),
                                                    new SQLCondition("select CSVERSION,LOCATION,LOGINUSER,LOGINPASSWORD,ISAVIABLE from TBLCSUPDATER where  ISAVIABLE = 1"));
     if (objs == null || objs.Length < 1)
     {
         return(null);
     }
     return((Updater)objs[0]);
 }
예제 #22
0
 public ImportManCountDateEngine(IDomainDataProvider dataProvider, LanguageComponent languageComponent1, string importType, DataTable table, string userCode, ArrayList importGridRow, string checkcolumn)
 {
     _dataProvider       = dataProvider;
     _languageComponent1 = languageComponent1;
     ImportType          = importType;
     ImportDatatable     = table;
     UserCode            = userCode;
     ImportGridRow       = importGridRow;
     checkColumn         = checkcolumn;
 }
예제 #23
0
        public DNTransferArgument(IDomainDataProvider dataProvider)
        {
            DBDateTime currentDateTime = FormatHelper.GetNowDBDateTime(dataProvider);
            DateTime   wantedDateTime  = FormatHelper.ToDateTime(currentDateTime.DBDate, currentDateTime.DBTime).AddDays(InternalVariables.MS_DateOffSet);

            this.m_MaintainDate_B = wantedDateTime.Date;
            this.m_MaintainDate_E = wantedDateTime.Date;

            this.m_TransactionCode = TransferFacade.DNTransferJobID + "_"
                                     + currentDateTime.DBDate.ToString() + "_" + currentDateTime.DBTime.ToString() + DateTime.Now.Millisecond.ToString();
        }
예제 #24
0
 public static DBDateTime GetNowDBDateTime(IDomainDataProvider domainDataProvider)
 {
     object[] objs = domainDataProvider.CustomQuery(typeof(DBDateTime),
                                                    new SQLParamCondition("select to_char(sysdate,'yyyymmdd') as dbdate,to_char(sysdate,'hh24miss')  as dbtime from dual where $RCARD = '1'"
                                                                          , new SQLParameter[] { new SQLParameter("RCARD", typeof(string), "1") }));
     if (objs.Length == 0)
     {
         ExceptionManager.Raise(typeof(FormatHelper), "$SystemError_GetDBTimeError");
     }
     return((DBDateTime)objs[0]);
 }
예제 #25
0
 public static ApplicationService Current()
 {
     if (_applicationService == null)
     {
         if (_dataProvider == null)
         {
             _dataProvider = BenQGuru.eMES.Common.DomainDataProvider.DomainDataProviderManager.DomainDataProvider();
         }
         _applicationService = new ApplicationService(_dataProvider);
     }
     return(_applicationService);
 }
예제 #26
0
        public UserGroupSecurityEntity(string userGroupCode, IDomainDataProvider domainDataProvider)
        {
            this._domainDataProvider = domainDataProvider;
            UserFacade manager = new UserFacade(this.DataProvider);

            this._userGroup = manager.GetUserGroup(userGroupCode) as UserGroup;
            if (this._userGroup == null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_User_Group_Not_Exist");
            }
            this._loadModule();
        }
예제 #27
0
        public ModuleSecurityEntity(string moduleCode, string viewRights, IDomainDataProvider domainDataProvider)
        {
            this._domainDataProvider = domainDataProvider;
            this._viewRights         = viewRights;
            SystemSettingFacade facade = new SystemSettingFacade(this.DataProvider);
            object module = facade.GetModule(moduleCode);

            if (module == null)
            {
                ExceptionManager.Raise(this.GetType(), "$Error_Module_Not_Exist");
            }
            this._distributeViewRights();
        }
예제 #28
0
        private void GetUnVisibilityMenu(IDomainDataProvider _domainDataProvider)
        {
            htUnVisibilityMenu = new Hashtable();
            SystemSettingFacade sysFacade = new SystemSettingFacade(_domainDataProvider);

            object[] objs = sysFacade.GetAllMenuUnVisibility(MenuType.MenuType_BS);
            if (objs != null)
            {
                for (int i = 0; i < objs.Length; i++)
                {
                    htUnVisibilityMenu.Add(((BenQGuru.eMES.Domain.BaseSetting.Menu)objs[i]).MenuCode, ((BenQGuru.eMES.Domain.BaseSetting.Menu)objs[i]).MenuCode);
                }
            }
        }
예제 #29
0
        public bool Init(IDomainDataProvider dataProvider, string resCode, DBDateTime dbDateTime)
        {
            bool returnValue = false;

            BaseModelFacade  baseModelFacade  = new BaseModelFacade(dataProvider);
            ShiftModelFacade shiftModelFacade = new ShiftModelFacade(dataProvider);

            _DataProvider = dataProvider;
            _ResCode      = resCode;
            _DBDateTime   = dbDateTime;

            //获取对应的OPCode
            Operation2Resource op2Res = (Operation2Resource)baseModelFacade.GetOperationByResource(_ResCode);

            if (op2Res != null)
            {
                _Operation = (Operation)baseModelFacade.GetOperation(op2Res.OPCode);
            }
            if (_Operation == null)
            {
                return(returnValue);
            }

            //获取对应的SS
            Resource res = (Resource)baseModelFacade.GetResource(_ResCode);

            if (res != null)
            {
                _StepSequence = (StepSequence)baseModelFacade.GetStepSequence(res.StepSequenceCode);
            }
            if (_StepSequence == null)
            {
                return(returnValue);
            }

            //获取当前的ShiftDate
            _ShiftDate = shiftModelFacade.GetShiftDayBySS(_StepSequence, _DBDateTime.DateTime);

            //获取当前的Shift
            _Shift = (Shift)shiftModelFacade.GetShift(_StepSequence.ShiftTypeCode, _DBDateTime.DBTime);
            if (_Shift == null)
            {
                return(returnValue);
            }

            returnValue = true;

            return(returnValue);
        }
예제 #30
0
        public FInvRecCheck()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            UserControl.UIStyleBuilder.FormUI(this);
            _infoForm = ApplicationRun.GetInfoForm();

            _domainDataProvider = ApplicationService.Current().DataProvider;
            this._facade        = new InventoryFacade(this.DataProvider);
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }