コード例 #1
0
        /// <summary>
        /// 信息员自动完成的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AutoCompleteData()
        {
            string userValueInputted = RequestHelper.GetValue("term");
            List<AutoCompleteEntity> itemList = new List<AutoCompleteEntity>();
            string whereClause = string.Format(" ( InformationBrokerName like '%{0}%' OR InformationBrokerNameShort like '%{0}%' OR HigherOrganization like '%{0}%'  ) AND  CanUsable={1}", userValueInputted, (int)Logics.True);
            List<InformationBrokerEntity> userList = InformationBrokerBLL.Instance.GetList(whereClause);

            foreach (InformationBrokerEntity currentLabor in userList)
            {
                AutoCompleteEntity item = new AutoCompleteEntity();
                item.details = "nothing";
                item.key = currentLabor.InformationBrokerGuid.ToString();
                item.label = string.Format("{0}([{1}]{2})", currentLabor.InformationBrokerName, EnumHelper.GetDisplayValue(currentLabor.InformationBrokerType),currentLabor.HigherOrganization);
                item.value = currentLabor.InformationBrokerName;

                itemList.Add(item);
            }

            return Json(itemList, JsonRequestBehavior.AllowGet);
        }
コード例 #2
0
        /// <summary>
        /// 企业自动完成的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult AutoCompleteData()
        {
            string userValueInputted = RequestHelper.GetValue("term");
            List<AutoCompleteEntity> itemList = new List<AutoCompleteEntity>();
            string whereClause = string.Format(" ( CompanyName like '%{0}%' OR CompanyNameShort like '%{0}%' ) AND  CanUsable={1}", userValueInputted, (int)Logics.True);
            List<EnterpriseEntity> userList = EnterpriseBLL.Instance.GetList(Logics.True, whereClause, 10, String.Empty);

            foreach (EnterpriseEntity currentLabor in userList)
            {
                AutoCompleteEntity item = new AutoCompleteEntity();
                item.details = "nothing";
                item.key = currentLabor.EnterpriseGuid.ToString();
                item.label = string.Format("{0}({1})", currentLabor.CompanyName, currentLabor.CompanyNameShort);
                item.value = currentLabor.CompanyName;

                itemList.Add(item);
            }

            return Json(itemList, JsonRequestBehavior.AllowGet);
        }
コード例 #3
0
        /// <summary>
        /// 劳务人员自动完成的数据
        /// </summary>
        /// <returns></returns>
        public ActionResult LaborAutoCompleteData()
        {
            string userValueInputted = RequestHelper.GetValue("term");
            string enterpriserGuid = RequestHelper.GetValue("autoCompleteExtraParam");
            List<AutoCompleteEntity> itemList = new List<AutoCompleteEntity>();
            string whereClause = string.Format(" UserNameCN like '{0}%' AND UserType={1} ", userValueInputted, (int)UserTypes.CommonUser);

            //为了能够为刚刚离职的人员派发薪资,此处不再使用按照企业过滤劳务人员数据
            //if (string.IsNullOrWhiteSpace(enterpriserGuid) == false)
            //{
            //    whereClause += string.Format(" AND CurrentEnterpriseKey='{0}' ", enterpriserGuid);
            //}

            List<LaborEntity> userList = LaborBLL.Instance.GetList(whereClause);

            foreach (LaborEntity currentLabor in userList)
            {
                string inCurrentEnterpriseDesc = string.Empty;
                if (string.IsNullOrWhiteSpace(enterpriserGuid) == false
                    && string.IsNullOrWhiteSpace(currentLabor.CurrentEnterpriseKey) == false
                    && enterpriserGuid.ToLower() == currentLabor.CurrentEnterpriseKey.ToLower())
                {
                    inCurrentEnterpriseDesc = "在职";
                }
                else
                {
                    inCurrentEnterpriseDesc = "其他";
                }

                AutoCompleteEntity item = new AutoCompleteEntity();
                item.details = "nothing";
                item.key = currentLabor.UserGuid.ToString();
                item.label = string.Format("{0}({1}({2}))", currentLabor.UserNameCN, currentLabor.UserCardID, inCurrentEnterpriseDesc);
                item.value = currentLabor.UserNameCN;

                itemList.Add(item);
            }

            return Json(itemList, JsonRequestBehavior.AllowGet);
        }