Beispiel #1
0
        public DocumentData GetHistoryReportByJobId(long jobId)
        {
            DocumentData          documentData  = null;
            IList <IdRefLangName> statusLookup  = CoreCache.GetIdRefLangNames("EN", 39);
            IList <ColumnSetting> columnSetting = CoreCache.GetColumnSettingsByEntityAlias("EN", Entities.EntitiesAlias.Job);
            DataTable             tblResult     = _commands.GetJobHistoryDataTable(ActiveUser, jobId, columnSetting, statusLookup);

            if (tblResult != null && tblResult.Rows.Count > 0)
            {
                documentData = new DocumentData();
                using (MemoryStream memoryStream = new MemoryStream())
                {
                    using (StreamWriter writer = new StreamWriter(memoryStream))
                    {
                        WriteDataTable(tblResult, writer, true);
                    }

                    documentData.DocumentContent = memoryStream.ToArray();
                    documentData.DocumentName    = string.Format("JobHistory_{0}.csv", jobId);
                    documentData.ContentType     = "text/csv";
                }
            }

            return(documentData);
        }
Beispiel #2
0
        public DocumentStatus IsHistoryPresentForJob(List <long> selectedJobId)
        {
            IList <IdRefLangName> statusLookup   = CoreCache.GetIdRefLangNames("EN", 39);
            IList <ColumnSetting> columnSetting  = CoreCache.GetColumnSettingsByEntityAlias("EN", Entities.EntitiesAlias.Job);
            DocumentStatus        documentStatus = new DocumentStatus()
            {
                IsAttachmentPresent = false, IsPODPresent = false, IsHistoryPresent = false
            };
            List <Task> tasks = new List <Task>();
            List <IList <JobHistory> > jobHistory = new List <IList <JobHistory> >();

            foreach (var currentJobId in selectedJobId)
            {
                tasks.Add(Task.Factory.StartNew(() =>
                {
                    jobHistory.Add(DataAccess.Job.JobHistoryCommands.GetPagedData(ActiveUser, new PagedDataInfo()
                    {
                        RecordId = currentJobId
                    }, columnSetting, statusLookup));
                }));
            }

            if (tasks.Count > 0)
            {
                Task.WaitAll(tasks.ToArray());
            }
            if (jobHistory?.Count > 0 && jobHistory.Where(x => x?.Count > 0).Any())
            {
                documentStatus.IsHistoryPresent = true;
            }

            return(documentStatus);
        }
Beispiel #3
0
        protected void submit_Click(object sender, EventArgs e)
        {
            XtmUser userM = new XtmUser();

            userM.UserCode = this.txtUsername.Text.Trim();
            userM.UserPwd  = Encry.Encode(this.txtUserpwd.Text.Trim());
            BaseDao         baseDao = new BaseDao();
            IList <XtmUser> userL   = baseDao.List <XtmUser>(userM);

            if (userL != null && userL.Count > 0)
            {
                userM = userL[0];
                if (userM.Status != "x")
                {
                    Page.RegisterStartupScript("onclick", "<script>alert('账号已停用')</script>");
                }
                else
                {
                    CoreCache.SetCache("SysDepartId", userM.DepartId);
                    CoreCache.SetCache("SysUserType", userM.UserType);
                    CoreCache.SetCache("SysUserId", userM.Did);
                    CoreCache.SetCache("SysUserCode", userM.UserCode);
                    CoreCache.SetCache("SysUserName", userM.UserName);
                    Response.Redirect("Index/content.htm");
                }
            }
            else
            {
                Page.RegisterStartupScript("onclick", "<script>alert('账号或密码错误')</script>");
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreCache.GetCache("SysUserCode") == null)
            {
                TimeOut.ExecTimeOut(this);
                return;
            }
            string usertype = CoreCache.GetCache("SysUserType").ToString();

            XtmMenu menu = new XtmMenu();

            menu.SysKey = Request.QueryString["Action"].ToString();

            menu = WebUiProcess.Get(menu);
            if (errmsg != "")
            {
                Response.Write("加载页面出错:" + errmsg);
                Response.End();
                return;
            }
            if (menu.Pri == "n" && usertype != "man")
            {
                Response.Write("您没有操作该页面的权限,请和管理员联系!");
                Response.End();
            }
            else
            {
                string strurl = "../" + menu.MenuConfig;
                Navigate(strurl, menu.MenuCode);
            }
        }
Beispiel #5
0
 protected void butModifyPwd_Click(object sender, EventArgs e)
 {
     if (CoreCache.GetCache("SysUserCode") == null)
     {
         TimeOut.ExecTimeOut(this);
         return;
     }
     Page.ClientScript.RegisterStartupScript(this.GetType(), "Close", "<script language=JavaScript>open('../Index/ModifyPwd.aspx','modifyPwd','height=200,width=300,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'); </script>");
 }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (CoreCache.GetCache("SysUserCode") == null)
     {
         TimeOut.ExecTimeOut(this);
         return;
     }
     if (!IsPostBack)
     {
         InitTree();
     }
 }
Beispiel #7
0
 /// <summary>
 /// Creates an instance of the class
 /// </summary>
 public Core()
 {
     CoreDomain              = new CurrentAppDomain(this);
     InternalObjectRegister  = new CoreManagement(this);
     InternalObjectActivator = new CoreActivator(this);
     InternalObjectResolver  = new CoreResolver(this);
     InternalObjectEvents    = new CoreEvents(this);
     InternalFactories       = new CoreFactories(this);
     InternalCache           = new CoreCache(this);
     Console  = OnCreateConsole();
     Settings = OnCreateSettings();
     Invoker  = OnCreateInvoker();
     OnCreate();
 }
Beispiel #8
0
        public override void Init()
        {
            base.Init();
            // setup stuff & searches & etc
            lock (LockObject)
            {
                if (!_runThrough)
                {
                    CoreCache.Initialize("EN");                     //EN For English Language
                }
            }

            // set run through
            _runThrough = true;
        }
Beispiel #9
0
        private void InitTree()
        {
            string usertype = CoreCache.GetCache("SysUserType").ToString();

            switch (usertype)
            {
            case "man":
                InitSMTree();
                break;

            default:
                InitPTTree();
                break;
            }
        }
Beispiel #10
0
        protected override void OnFirstCallback()
        {
            _hostConfigRuleSubs = Client.CreateCache(
                delegate(CacheChangeData update)
            {
                Interlocked.Increment(ref _ruleUpdatesQueued);
                _MainThreadQueue.Dispatch <object>(null, OnRuleUpdate);
            }, null);
            _hostConfigRuleSubs.SubscribeWait <HostConfigRule>(RuleHelper.MakeRuleFilter(
                                                                   EnvHelper.EnvName(Client.ClientInfo.ConfigEnv),
                                                                   Client.ClientInfo.HostName,
                                                                   ServerInstance,
                                                                   Client.ClientInfo.UserName));

            Interlocked.Increment(ref _ruleUpdatesQueued);
            _MainThreadQueue.Dispatch <object>(null, OnRuleUpdate);
        }
Beispiel #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreCache.GetCache("SysUserCode") == null)
            {
                TimeOut.ExecTimeOut(this);
                return;
            }
            this.labUserName.Text = CoreCache.GetCache("SysUserName").ToString();
            switch (CoreCache.GetCache("SysUserType").ToString())
            {
            case "man":
                this.labUserType.Text = "管理员";
                break;

            case "ywy":
                this.labUserType.Text = "业务员";
                break;

            case "yh":
                this.labUserType.Text = "普通用户";
                break;
            }
        }
Beispiel #12
0
 /// <summary>
 /// Gets the list of app menu data
 /// </summary>
 /// <returns></returns>
 public static IList <RibbonMenu> GetRibbonMenus(bool forceUpdate = false)
 {
     return(CoreCache.GetRibbonMenus(ActiveUser.LangCode, forceUpdate));
 }
Beispiel #13
0
 /// <summary>
 /// Gets the list of tables
 /// </summary>
 /// <returns></returns>
 public static IList <TableReference> GetTables(bool forceUpdate = false)
 {
     return(CoreCache.GetTables(forceUpdate));
 }
Beispiel #14
0
 public static SysSetting GetSystemSettings(string langCode, bool forceUpdate = false)
 {
     return(CoreCache.GetSystemSettings(langCode, forceUpdate));
 }
Beispiel #15
0
 /// <summary>
 /// Get System Settings from cache
 /// </summary>
 /// <param name="forceUpdate"></param>
 /// <returns></returns>
 public static SysSetting GetSystemSettings(bool forceUpdate = false)
 {
     return(CoreCache.GetSystemSettings(ActiveUser.LangCode, forceUpdate));
 }
Beispiel #16
0
 public static IList <ConditionalOperator> GetConditionalOperators(bool forceUpdate = false)
 {
     return(CoreCache.GetConditionalOperators(ActiveUser.LangCode, forceUpdate));
 }
Beispiel #17
0
        /// <summary>
        /// Gets list of grid coulmn settings based on the entity name
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        public static IList <ColumnSetting> GetGridColumnSettingsByEntityAlias(EntitiesAlias entity, bool forceUpdate, bool isGridSetting)
        {
            return(CoreCache.GetGridColumnSettingsByEntityAlias(ActiveUser.LangCode, entity, forceUpdate, isGridSetting));
        }
Beispiel #18
0
        /// <summary>
        /// Gets list of page information
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        public static IList <PageInfo> GetPageInfos(EntitiesAlias entity, bool forceUpdate = false)
        {
            return(CoreCache.GetPageInfos(ActiveUser.LangCode, entity, forceUpdate));
        }
Beispiel #19
0
        /// <summary>
        /// gets list of operations
        /// </summary>
        /// <param name="lookup"></param>
        /// <returns></returns>

        public static IList <Operation> GetOperations(LookupEnums lookup, bool forceUpdate = false)
        {
            return(CoreCache.GetOperations(ActiveUser.LangCode, lookup, forceUpdate));
        }
Beispiel #20
0
        /// <summary>
        /// Gets list of reference language names
        /// </summary>
        /// <param name="lookupId"></param>
        /// <returns></returns>

        public static IList <IdRefLangName> GetIdRefLangNames(int lookupId, bool forceUpdate = false)
        {
            return(CoreCache.GetIdRefLangNames(ActiveUser.LangCode, lookupId, forceUpdate));
        }
Beispiel #21
0
 public static BusinessConfiguration GetBusinessConfiguration(bool forceUpdate)
 {
     return(CoreCache.GetBusinessConfiguration(ActiveUser.LangCode, forceUpdate));
 }
Beispiel #22
0
 public static void Configure(string baseUrl, string loginBaseUrl, string tenant, string appId, string appSecrete)
 {
     CoreCache.Configure(baseUrl, loginBaseUrl, tenant, appId, appSecrete);
 }
Beispiel #23
0
        /// <summary>
        /// Gets column validtions based on the table name
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>

        public static IList <ValidationRegEx> GetValidationRegExpsByEntityAlias(EntitiesAlias entity, bool forceUpdate = false)
        {
            return(CoreCache.GetValidationRegExpsByEntityAlias(ActiveUser.LangCode, entity, forceUpdate));
        }
Beispiel #24
0
        /// <summary>
        /// Gets Display message based on the message code
        /// </summary>
        /// <param name="messageType"></param>
        /// <param name="messageCode"></param>
        /// <returns></returns>

        public static DisplayMessage GetDisplayMessageByCode(MessageTypeEnum messageType, string messageCode, bool forceUpdate = false)
        {
            return(CoreCache.GetDisplayMessageByCode(ActiveUser.LangCode, messageCode, forceUpdate));
        }
Beispiel #25
0
 public static object GetMasterTableObject(EntitiesAlias entity, bool forceUpdate = false)
 {
     return(CoreCache.GetMasterTableObject(ActiveUser.LangCode, entity, forceUpdate));
 }