コード例 #1
0
 public List<ChargeEntity> Search(QueryCondition<ChargeEntity> entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("ChargeSearch");
     using (DynamicSqlBuilder sqlBuilder = new DynamicSqlBuilder(command, entity.PagingInfo, "SysNo Desc"))
     {
         ChargeEntity query = entity.Condition;
         sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " Status <> -1");
         if (query != null)
         {
             if (!string.IsNullOrEmpty(query.Title))
             {
                 sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " (Title Like'%'+@Title+'%')");
                 command.AddInputParameter("@Title", DbType.String, query.Title);
             }
             if (!string.IsNullOrEmpty(query.InDateCondition) &&
                 query.InDateCondition.IndexOf('-') > 0)
             {
                 sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " InDate BETWEEN @BeginInDate AND @EndInDate");
                 command.AddInputParameter("@BeginInDate", DbType.String, query.InDateCondition.Split('-')[0]);
                 command.AddInputParameter("@EndInDate", DbType.String, query.InDateCondition.Split('-')[1]);
             }
         }
         command.CommandText = sqlBuilder.BuildQuerySql();
         return command.ExecuteEntityList<ChargeEntity>();
     }
 }
コード例 #2
0
        protected override OutputData DoGet(IInputData input)
        {
            using (TableResolver resolver = PlugInFactoryManager.CreateInstance<TableResolver>(
                ResolverPlugInFactory.REG_NAME, "TaxDocument", this))
            {
                MetaDataTableResolver metaResolver = resolver as MetaDataTableResolver;
                string conditionStr = string.Empty;
                if (metaResolver != null)
                {
                    Dictionary<string, string> query = new Dictionary<string, string> 
                    { 
                        { "Title", input.QueryString["Title"] } 
                    };

                    IParamBuilder builder = metaResolver.GetQueryCondition(new QueryConditionObject(false, query));
                    if (builder != null)
                    {
                        QueryCondition condition = new QueryCondition(query, builder);
                        conditionStr = "&Condition=" + HttpUtility.UrlEncode(condition.ToEncodeString());
                    }
                }
                string url = WebUtil.ResolveUrl("~/Library/WebListXmlPage.tkx?Source=Cxcs/FaGui");
                return OutputData.Create(url + conditionStr);
            }
        }
コード例 #3
0
ファイル: FormQueryCondition.cs プロジェクト: suwadee2015/GPS
 public FormQueryCondition(QueryCondition qc)
 {
     InitializeComponent();
     this.SetFormStyle(false, false, false, true);
     temp = qc;
     comboBox1.SelectedIndex = 0;
     comboBox2.SelectedIndex = 0;
 }
コード例 #4
0
ファイル: Data.aspx.cs プロジェクト: ZhouHengYi/HFramework
 protected override void Initialize()
 {
     QueryCondition<ClubMembersEntity> query = new QueryCondition<ClubMembersEntity>();
     query.PagingInfo = new PagingInfo() { PageSize = 1000, PageIndex = 1 };
     query.Condition = new ClubMembersEntity();
     List<ClubMembersEntity> list = ClubMemberFacade.Search(query);
     BindSmallImage(list);
     BindBigImage(list);
 }
コード例 #5
0
ファイル: PlantHelper.cs プロジェクト: RoviABC/ABInvVP
 public List<ABiPlant> getABiPlant(QueryCondition query)
 {
     var result = dbContent.f_getPlant(query.PlantCode);
     return (from obj in result
             select new ABiPlant()
             {
                 ABi_Plant_ID=obj.ABi_Plant_ID.ToString(),
                 PlantCode=obj.PlantCode,
                 PlantName = "<a href='InsertPlant.aspx?ID=" + obj.ABi_Plant_ID + "'>" + obj.PlantName + "</a>"
             }).ToList();
 }
コード例 #6
0
 public List<ABiCompany> getABiCompany(QueryCondition query)
 {
     var result = dbContext.f_getCompany(query.CompanyName,query.CompanyCode);
     return (from obj in result
             select new ABiCompany
             {
                ID=obj.ABi_Company_ID.ToString(),
                CompanyCode=obj.CompanyCode,
                CompanyName="<a href='InsertCompany.aspx?ID="+obj.ABi_Company_ID+"'>"+obj.CompanyName+"</a>"
             }).ToList();
 }
コード例 #7
0
ファイル: Product.aspx.cs プロジェクト: ZhouHengYi/HFramework
 public string Search(QueryCondition<ProductEntity> query)
 {
     try
     {
         List<ProductEntity> list = ProductFacade.Search(query);
         return new JsonSerializer().Serialization(list, typeof(List<ProductEntity>));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
 public string Search(QueryCondition<SystemUser_PrivilegeEntity> query)
 {
     try
     {
         List<SystemUser_PrivilegeEntity> list = SystemUser_PrivilegeFacade.Seach(query);
         return new JsonSerializer().Serialization(list, typeof(List<SystemUser_PrivilegeEntity>));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #9
0
        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public List<ABiUsersRoles> getABiUsersRoles(QueryCondition query)
        {
            var result = dbContext.f_getUsers(query.UserName, query.Name, query.Status, query.ABi_Admin_Roles_ID);

            return (from obj in result
                    select new ABiUsersRoles
                    {
                        UserName="******"+obj.ABi_Admin_Users_ID+"'>"+obj.Username+"</a>",
                        Name=obj.Name,
                        DateCreated=obj.DateCreated,
                        Status = this.GetStatusNameByID(obj.Status.ToString()),
                        RoleName=obj.RoleName,
                        ABi_Admin_Users_ID=obj.ABi_Admin_Users_ID
                    }).ToList();
        }
コード例 #10
0
 public List<ABiPOIV> getPOIV(QueryCondition query)
 {
     try
     {
         var result = dbContent.f_getPOInvoiceReport(query.CompanyCode,
                                                     query.CompanyName,
                                                     query.MeterialNumber,
                                                     query.VendorCode,
                                                     query.PONumber,
                                                     query.GetMinDate(query.DateBegin),
                                                     query.GetMaxDate(query.DateEnd),
                                                     query.UserID);
         return (from obj in result
                 select new ABiPOIV()
                 {
                     CompanyCode = obj.CompanyCode,
                     PlantCode = obj.PlantCode,
                     VendorCode = obj.VendorCode,
                     VendorName = obj.VendorName,
                     PONumber = obj.PONumber,
                     POItemNumber = obj.POItemNumber,
                     GRNumber = obj.GRNumber,
                     GRItemNumber = obj.GRItemNumber,
                     MeterialNumber = obj.MeterialNumber,
                     MeterialName = obj.MeterialName,
                     Quantity = obj.Quantity ?? 0,
                     QuantityUnit = obj.QuantityUnit,
                     TaxRate = obj.TaxCode,
                     NetPrice = obj.NetPrice ?? 0,
                     PriceUnit = obj.PirceUnit,
                     Amount = obj.Amount ?? 0,
                     Currency = obj.Currency,
                     POCreateDate = obj.POCreateDate ?? DateTime.MinValue,
                     DeliveryDate = obj.DeliveryDate ?? DateTime.MinValue,
                     POCreator = obj.POCreator,
                     IVNumber = obj.IVNumber,
                     IVPostDate = obj.IVPostDate ?? DateTime.MinValue,
                     InvoiceNumber = obj.InvoiceNumber,
                     InvoiceDate = obj.InvoiceDate ?? DateTime.MinValue
                 }).ToList();
     }
     catch (Exception ex)
     {
         logger.LogError(query, ex);
     }
     return new List<ABiPOIV>();
 }
コード例 #11
0
        public List<ABiPO> getPO(QueryCondition query)
        {
            List<ABiPO> result = new List<ABiPO>();

            try
            {
                var poList = dbContent.f_getPOReprot(query.CompanyCode,
                                                     query.CompanyName,
                                                     query.MeterialNumber,
                                                     query.VendorCode,
                                                     query.PONumber,
                                                     query.GetMinDate(query.DateBegin),
                                                     query.GetMaxDate(query.DateEnd),
                                                     query.UserID);
                result = (from obj in poList
                         select new ABiPO()
                         {
                             CompanyCode = obj.CompanyCode,
                             Amount = obj.Amount ?? 0,
                             Currency = obj.Currency,
                             MeterialName = obj.MeterialName,
                             MeterialNumber = obj.MeterialNumber,
                             NetPrice = obj.NetPrice ?? 0,
                             PriceUnit = obj.PirceUnit,
                             PlantCode = obj.PlantCode,
                             POCreateDate = obj.POCreateDate ?? DateTime.MinValue,
                             POCreator = obj.POCreator,
                             PODeliverDate = obj.DeliveryDate ?? DateTime.MinValue,
                             PONumber = obj.PONumber,
                             POItemNumber = obj.POItemNumber,
                             Quantity = obj.Quantity ?? 0,
                             QuantityUnit = obj.QuantityUnit,
                             TaxCode = obj.TaxCode,
                             VendorCode = obj.VendorCode,
                             VendorName = obj.VendorName,
                             POStatus = obj.POStatus,
                             IsReturn = (obj.IsReturn == 1 ? true : false),
                             RoleID = query.RoleID
                         }).ToList();
            }
            catch (Exception ex)
            {
                logger.LogError(query, ex);
            }
            return result;
        }
コード例 #12
0
 public List<ErrorLogEntity> Seach(QueryCondition<ErrorLogEntity> entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("ErrorLogSearch");
     using (DynamicSqlBuilder sqlBuilder = new DynamicSqlBuilder(command, entity.PagingInfo, "SysNo Desc"))
     {
         ErrorLogEntity query = entity.Condition;
         if (query != null)
         {
             if (!string.IsNullOrEmpty(query.GlobalName))
             {
                 sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " (GlobalName Like'%'+@GlobalName+'%')");
                 command.AddInputParameter("@GlobalName", DbType.String, query.GlobalName);
                 //sqlBuilder.Conditions.AddCondition("UserName", DbType.String, "@UserName", query.UserName);
             }
         }
         command.CommandText = sqlBuilder.BuildQuerySql();
         return command.ExecuteEntityList<ErrorLogEntity>();
     }
 }
コード例 #13
0
 public List<BrowsingHistoryEntity> Search(QueryCondition<BrowsingHistoryEntity> entity)
 {
     CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("BrowsingHistorySearch");
     using (DynamicSqlBuilder sqlBuilder = new DynamicSqlBuilder(command, entity.PagingInfo, "SysNo Desc"))
     {
         BrowsingHistoryEntity query = entity.Condition;
         sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " Status <> -1");
         if (query != null)
         {
             if (!string.IsNullOrEmpty(query.PageName))
             {
                 sqlBuilder.Conditions.AddCustomCondition(RelationType.AND, " (PageName Like'%'+@PageName+'%')");
                 command.AddInputParameter("@PageName", DbType.String, query.PageName);
             }
         }
         command.CommandText = sqlBuilder.BuildQuerySql();
         return command.ExecuteEntityList<BrowsingHistoryEntity>();
     }
 }
コード例 #14
0
 public List<SystemUser_RoleEntity> Search(QueryCondition<SystemUser_RoleEntity> entity)
 {
     return ObjectFactory<ISystemUser_RoleDataAccess>.Instance.Search(entity);
 }
コード例 #15
0
 /// <summary>
 /// Gets the occur.
 /// </summary>
 /// <param name="condition">The condition.</param>
 /// <returns>Returns Lucene Occurrence</returns>
 protected virtual LuceneSearch.Occur GetOccur(QueryCondition condition)
 {
   return condition == QueryCondition.And ? LuceneSearch.Occur.MUST : LuceneSearch.Occur.SHOULD;
 }
コード例 #16
0
    public override OpRes makeQuery(object param, GMUser user, QueryCondition queryCond) 
    {
        ParamQueryRecharge p = (ParamQueryRecharge)param;

        int condCount = 0;
        PlatformInfo pinfo = null;

        if (!string.IsNullOrEmpty(p.m_param))
        {
            switch (p.m_way)
            {
                case QueryWay.by_way0: //  通过玩家id查询
                    {
                        int val = -1;
                        if (!int.TryParse(p.m_param, out val))
                        {
                            return OpRes.op_res_param_not_valid;
                        }
                        Dictionary<string, object> ret = QueryBase.getPlayerProperty(val, user, s_field);
                        if (ret == null)
                        {
                            return OpRes.op_res_not_found_data;
                        }
                        if (!ret.ContainsKey("platform"))
                        {
                            return OpRes.op_res_failed;
                        }

                        // 取玩家ID所在平台
                        string platName = Convert.ToString(ret["platform"]);
                        queryCond.addQueryCond("PlayerId", val);

                        pinfo = ResMgr.getInstance().getPlatformInfoByName(platName);

                        // 获取服务器ID
                        /*DbServerInfo dbInfo = ResMgr.getInstance().getDbInfo(user.m_dbIP);
                        if (dbInfo != null)
                        {
                            queryCond.addQueryCond("ServerId", dbInfo.m_serverId);
                        }*/
                    }
                    break;
                case QueryWay.by_way1: //  通过账号查询
                    {
                        Dictionary<string, object> ret = QueryBase.getPlayerPropertyByAcc(p.m_param, user, s_field);
                        if (ret == null)
                        {
                            return OpRes.op_res_not_found_data;
                        }
                        if (!ret.ContainsKey("platform"))
                        {
                            return OpRes.op_res_failed;
                        }
                       
                        // 取玩家账号所在平台,然后从相应的平台去查
                        string platName = Convert.ToString(ret["platform"]);
                        queryCond.addQueryCond("Account", p.m_param);

                        pinfo = ResMgr.getInstance().getPlatformInfoByName(platName);

                        // 获取服务器ID
                       /* DbServerInfo dbInfo = ResMgr.getInstance().getDbInfo(user.m_dbIP);
                        if (dbInfo != null)
                        {
                            queryCond.addQueryCond("ServerId", dbInfo.m_serverId);
                        }*/
                    }
                    break;
                case QueryWay.by_way2: //  通过订单号查询
                    {
                        pinfo = ResMgr.getInstance().getPlatformInfo(p.m_platIndex);
                        queryCond.addQueryCond("OrderID", p.m_param);
                    }
                    break;
                default:
                    {
                        return OpRes.op_res_failed;
                    }
            }
            condCount++;
        }
        else
        {
            pinfo = ResMgr.getInstance().getPlatformInfo(p.m_platIndex);

            // 获取服务器ID
            /*DbServerInfo dbInfo = ResMgr.getInstance().getDbInfo(user.m_dbIP);
            if (dbInfo != null)
            {
                queryCond.addQueryCond("ServerId", dbInfo.m_serverId);
            }*/
        }

        if (pinfo == null)
            return OpRes.op_res_need_sel_platform;

        if (!m_items.ContainsKey(pinfo.m_engName))
            return OpRes.op_res_not_found_data;

        m_rbase = m_items[pinfo.m_engName];
        
        m_platInfo.m_tableName = pinfo.m_tableName;
        m_platInfo.m_platName = pinfo.m_engName;

        if (queryCond.isExport())
        {
            queryCond.addCond("table", m_platInfo.m_tableName);
            queryCond.addCond("plat", m_platInfo.m_platName);
        }

        if (p.m_time != "")
        {
            DateTime mint = DateTime.Now, maxt = DateTime.Now;
            bool res = Tool.splitTimeStr(p.m_time, ref mint, ref maxt);
            if (!res)
                return OpRes.op_res_time_format_error;

            condCount++;
            if (queryCond.isExport())
            {
                queryCond.addCond("time", p.m_time);
            }
            else
            {
                IMongoQuery imq1 = Query.LT("PayTime", BsonValue.Create(maxt));
                IMongoQuery imq2 = Query.GTE("PayTime", BsonValue.Create(mint));
                queryCond.addImq(Query.And(imq1, imq2));
            }
        }

        if (p.m_result > 0)
        {
            queryCond.addQueryCond("Process", p.m_result == 1 ? true : false);
        }
        if (!string.IsNullOrEmpty(p.m_range))
        {
            if (!Tool.isTwoNumValid(p.m_range))
                return OpRes.op_res_param_not_valid;

            if (queryCond.isExport())
            {
                queryCond.addCond("range", p.m_range);
            }
            else
            {
                List<int> range = new List<int>();
                Tool.parseNumList(p.m_range, range);
                IMongoQuery timq1 = Query.LTE("RMB", BsonValue.Create(range[1]));
                IMongoQuery timq2 = Query.GTE("RMB", BsonValue.Create(range[0]));
                IMongoQuery tmpImq = Query.And(timq1, timq2);
                queryCond.addImq(tmpImq);
            }
        }
        
        if (condCount == 0)
            return OpRes.op_res_need_at_least_one_cond;

        return OpRes.opres_success; 
    }
コード例 #17
0
        ///<summary>
        ///获取列表:
        ///</summary>
        /// <param name="qc">查询条件</param>
        /// <returns>符合条件的数据集合</returns>
        public Result <List <Epm_TzProjectProposal> > GetTzFirstNegotiationList(QueryCondition qc)
        {
            Result <List <Epm_TzProjectProposal> > result = new Result <List <Epm_TzProjectProposal> >();

            try
            {
                var query = from first in context.Epm_TzFirstNegotiation.Where(p => p.IsDelete == false)
                            join project in context.Epm_TzProjectProposal.Where(p => p.IsDelete == false) on first.ProjectId equals project.Id
                            select new
                {
                    first.ProjectId,
                    project.ProjectName,
                    project.Nature,
                    project.NatureName,
                    project.StationName,
                    project.StationId,
                    project.ApplyTime,
                    first.State,
                    first.OperateUserName,
                    first.OperateTime,
                    project.CompanyId
                };

                var projectList = query.ToList().Select(c => new Epm_TzProjectProposal
                {
                    Id          = c.ProjectId,
                    ProjectName = c.ProjectName,
                    Nature      = c.Nature,
                    NatureName  = c.NatureName,
                    StationName = c.StationName,
                    StationId   = c.StationId,
                    ApplyTime   = c.ApplyTime,
                    State       = c.State.Value,
                    //OperateUserName = c.OperateUserName,
                    OperateUserName = c.State != (int)PreProjectState.WaitSubmitted ? c.OperateUserName:"",
                    OperateTime     = c.OperateTime,
                    CompanyId       = c.CompanyId
                }).ToList();

                if (qc != null && qc.ConditionList.Any())
                {
                    foreach (var conditionExpression in qc.ConditionList)
                    {
                        string value     = (conditionExpression.ExpValue ?? "").ToString();
                        string valueName = (conditionExpression.ExpName ?? "").ToString();
                        if (!string.IsNullOrWhiteSpace(value))
                        {
                            switch (valueName)
                            {
                            case "name":
                            {
                                projectList = projectList.Where(t => t.ProjectName.Contains(value)).ToList();
                                break;
                            }

                            case "ProjectNature":
                            {
                                projectList = projectList.Where(t => t.Nature == value).ToList();
                                break;
                            }

                            case "CompanyId":
                            {
                                long id = Convert.ToInt64(value);
                                projectList = projectList.Where(t => t.CompanyId == id).ToList();
                                break;
                            }

                            case "StationName":
                            {
                                projectList = projectList.Where(t => t.StationName.Contains(value)).ToList();
                                break;
                            }

                            case "startTime":
                            {
                                DateTime startTime1 = Convert.ToDateTime(value);
                                projectList = projectList.Where(t => t.ApplyTime >= startTime1).ToList();
                                break;
                            }

                            case "endTime":
                            {
                                DateTime endTime1 = Convert.ToDateTime(value);
                                projectList = projectList.Where(t => t.ApplyTime <= endTime1).ToList();
                                break;
                            }

                            case "State":
                            {
                                int state = Convert.ToInt32(value);
                                projectList = projectList.Where(t => t.State == state).ToList();
                                break;
                            }

                            default:
                                break;
                            }
                        }
                    }
                }
                result.AllRowsCount = projectList.Count();
                projectList         = projectList.OrderByDescending(t => t.OperateTime).Skip((qc.PageInfo.CurrentPageIndex - 1) * qc.PageInfo.PageRowCount).Take(qc.PageInfo.PageRowCount).ToList();
                result.Data         = projectList;
                result.Flag         = EResultFlag.Success;
            }
            catch (Exception ex)
            {
                result.Data      = null;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "GetTzFirstNegotiationList");
            }
            return(result);
        }
コード例 #18
0
ファイル: IVHelper.cs プロジェクト: RoviABC/ABInvVP
        public List<ABiIVCompleted> getIVCompleted(QueryCondition query)
        {
            try
            {
                bool? isTolerance = null;
                switch (query.IsTolerance)
                {
                    case "0":
                        isTolerance = false;
                        break;
                    case "1":
                        isTolerance = true;
                        break;
                }

                var objList = dbContent.f_getInvoiceCompleted(query.VendorCode,
                                                           query.CompanyCode,
                                                           query.InvoiceNumber,
                                                           isTolerance,
                                                           query.GetMinDate(query.DateBegin),
                                                           query.GetMaxDate(query.DateEnd),
                                                           query.UserID);

                return (from obj in objList
                        select new ABiIVCompleted()
                        {
                            InvoiceNumber = obj.InvoiceNumber,
                            CompanyCode = obj.CompanyCode,
                            VendorCode = obj.VendorCode,
                            TotalAmount = obj.TotalAmount ?? 0,
                            TaxAmount = obj.TaxAmount ?? 0,
                            InvoiceDate = obj.InvoiceDate ?? DateTime.MinValue,
                            IVNumber = obj.IVNumber,
                            IVPostDate = obj.IVPostDate ?? DateTime.MinValue,
                            Status = obj.InvoiceStatus,
                            IsTolerance = obj.IsTolerance ?? false,
                            InvoiceID = obj.InvoiceID
                        }).ToList();
            }
            catch (Exception ex)
            {
                logger.LogError(query, ex);
            }
            return new List<ABiIVCompleted>();
        }
コード例 #19
0
        public bool DeleteEntities(QueryCondition queryCondition)
        {
            _dbService.Logger?.Debug(nameof(DeleteEntities));

            if (_entityModel.IsView)
            {
                _dbService.Logger?.Warning("Deleting rows of view with a query condition is not supported");
                _dbService.LastErrorMessage = "Cannot delete entities of a view";
                return(false);
            }

            lock (_dbService.Lock)
            {
                var opened = _dbService.Connection.State != ConnectionState.Open;

                try
                {
                    if (opened)
                    {
                        _dbService.Connection.Open();
                    }

                    var parameters = new Dictionary <string, object>();

                    var command = new SqlCommand(_dbService.ScriptGenerator.GetDeleteQuery(parameters, queryCondition), _dbService.Connection);
                    if (_dbService.CurrentTransaction != null)
                    {
                        command.Transaction = _dbService.CurrentTransaction;
                    }

                    foreach (var parameter in parameters)
                    {
                        command.Parameters.AddWithValue(parameter.Key, parameter.Value);
                    }

                    _dbService.Logger?.Info(_dbService.GenerateLoggingMessage(command));

                    command.ExecuteNonQuery();

                    return(true);
                }
                catch (Exception exception)
                {
                    _dbService.Logger?.Error("Error while executing query", exception);
                    _dbService.LastErrorMessage = exception.Message;

                    if (_dbService.CurrentTransaction != null)
                    {
                        _dbService.Logger?.Info("Rollback transaction and closing connection");
                        _dbService.CurrentTransaction.Rollback();
                        _dbService.CurrentTransaction = null;
                        _dbService.Connection.Close();
                    }

                    return(false);
                }
                finally
                {
                    if (opened)
                    {
                        _dbService.Logger?.Info("Closing connection");
                        _dbService.Connection.Close();
                    }
                }
            }
        }
コード例 #20
0
 /// 查询油站信息列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_OilStation> > GetOilStationList(QueryCondition qc)
 {
     return(base.Channel.GetOilStationList(qc));
 }
コード例 #21
0
 ///<summary>
 ///获取列表:短信接口设置
 ///</summary>
 public Result <List <Msg_SMSSetting> > GetSMSSettingList(QueryCondition qc)
 {
     return(base.Channel.GetSMSSettingList(qc));
 }
コード例 #22
0
        ///<summary>
        ///添加:
        ///</summary>
        /// <param name="model">要添加的model</param>
        /// <returns>受影响的行数</returns>
        public Result <int> AddDangerousWork(Epm_DangerousWork model, List <Base_Files> files)
        {
            Result <int> result = new Result <int>();

            try
            {
                model = SetCurrentUser(model);
                model.SubmitCompanyId   = CurrentCompanyID.ToLongReq();
                model.SubmitCompanyName = CurrentCompanyName;
                model.SubmitUserId      = CurrentUserID.ToLongReq();
                model.SubmitUserName    = CurrentUserName;
                model.CrtCompanyId      = CurrentCompanyID.ToLongReq();
                model.CrtCompanyName    = CurrentCompanyName;

                var rows = DataOperateBusiness <Epm_DangerousWork> .Get().Add(model);

                QueryCondition qc = new QueryCondition()
                {
                    PageInfo = new PageListInfo()
                    {
                        isAllowPage = false
                    }
                };
                qc.ConditionList.Add(new ConditionExpression()
                {
                    ExpName     = "ProjectId",
                    ExpValue    = model.ProjectId,
                    ExpOperater = eConditionOperator.Equal,
                    ExpLogical  = eLogicalOperator.And
                });
                qc.ConditionList.Add(new ConditionExpression()
                {
                    ExpName     = "UploadTime",
                    ExpValue    = DateTime.Today,
                    ExpOperater = eConditionOperator.Equal,
                    ExpLogical  = eLogicalOperator.And
                });

                // 关联危险作业实景
                var workRealScenenResult = GetWorkRealSceneList(qc);
                if (workRealScenenResult.Flag == EResultFlag.Success && workRealScenenResult.Data != null)
                {
                    List <Epm_SupervisorLogWork> workList = workRealScenenResult.Data.Select(p =>
                                                                                             new Epm_SupervisorLogWork
                    {
                        WorkId       = p.WorkId,
                        LogId        = model.Id,
                        WorkUploadId = p.Id,
                        State        = p.State
                    }).ToList();

                    workList.ForEach(p =>
                    {
                        SetCurrentUser(p);
                        SetCreateUser(p);
                    });

                    DataOperateBusiness <Epm_SupervisorLogWork> .Get().AddRange(workList);
                }

                AddFilesByTable(model, files);

                result.Data = rows;
                result.Flag = EResultFlag.Success;
                WriteLog(BusinessType.Dangerous.GetText(), SystemRight.Add.GetText(), "新增: " + model.Id);

                if (model.State == (int)ApprovalState.WaitAppr)
                {
                    #region 生成待办
                    var project = DataOperateBusiness <Epm_Project> .Get().GetModel(model.ProjectId.Value);

                    List <Epm_Approver> list = new List <Epm_Approver>();
                    Epm_Approver        app  = new Epm_Approver();
                    app.Title            = CurrentUserName + "提报了危险作业单,待审核";
                    app.Content          = CurrentUserName + "提报了危险作业单,待审核";
                    app.SendUserId       = CurrentUserID.ToLongReq();
                    app.SendUserName     = CurrentUserName;
                    app.SendTime         = DateTime.Now;
                    app.LinkURL          = string.Empty;
                    app.BusinessTypeNo   = BusinessType.Dangerous.ToString();
                    app.Action           = SystemRight.Add.ToString();
                    app.BusinessTypeName = BusinessType.Dangerous.GetText();
                    app.BusinessState    = (int)(ApprovalState.WaitAppr);
                    app.BusinessId       = model.Id;
                    app.ApproverId       = project.ContactUserId;
                    app.ApproverName     = project.ContactUserName;
                    app.ProjectId        = model.ProjectId;
                    app.ProjectName      = project.Name;
                    list.Add(app);
                    AddApproverBatch(list);
                    WriteLog(BusinessType.Dangerous.GetText(), SystemRight.Add.GetText(), "提交危险作业生成待办: " + model.Id);
                    #endregion

                    #region 消息
                    //var waitSend = GetWaitSendMessageList(model.ProjectId.Value);
                    //foreach (var send in waitSend)
                    //{
                    //    Epm_Massage modelMsg = new Epm_Massage();
                    //    modelMsg.ReadTime = null;
                    //    modelMsg.RecId = send.Key;
                    //    modelMsg.RecName = send.Value;
                    //    modelMsg.RecTime = DateTime.Now;
                    //    modelMsg.SendId = CurrentUserID.ToLongReq();
                    //    modelMsg.SendName = CurrentUserName;
                    //    modelMsg.SendTime = DateTime.Now;
                    //    modelMsg.Title = CurrentUserName + "提报了危险作业单,待审核";
                    //    modelMsg.Content = CurrentUserName + "提报了危险作业单,待审核";
                    //    modelMsg.Type = 2;
                    //    modelMsg.IsRead = false;
                    //    modelMsg.BussinessId = model.Id;
                    //    modelMsg.BussinesType = BusinessType.Dangerous.ToString();
                    //    modelMsg.ProjectId = model.ProjectId.Value;
                    //    modelMsg.ProjectName = model.ProjectName;
                    //    modelMsg = base.SetCurrentUser(modelMsg);
                    //    modelMsg = base.SetCreateUser(modelMsg);
                    //    DataOperateBusiness<Epm_Massage>.Get().Add(modelMsg);
                    //}
                    #endregion

                    #region 发送短信
                    //Dictionary<string, string> parameterSms = new Dictionary<string, string>();
                    //parameterSms.Add("UserName", CurrentUserName);
                    //WriteSMS(project.ContactUserId.Value, project.CompanyId, MessageStep.WorkAdd, parameterSms);
                    #endregion
                }
            }
            catch (Exception ex)
            {
                result.Data      = -1;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "AddDangerousWork");
            }
            return(result);
        }
コード例 #23
0
        public ActionResult Index(string planName = "", string state = "", string projectName = "", string applyCompanyName = "", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.Title            = "监理日志列表";
            ViewBag.planName         = planName;
            ViewBag.projectName      = projectName;
            ViewBag.applyCompanyName = applyCompanyName;
            ViewBag.pageIndex        = pageIndex;
            ViewBag.pageSize         = pageSize;
            ViewBag.state            = state;
            QueryCondition qc = new QueryCondition()
            {
                PageInfo = GetPageInfo(pageIndex, pageSize)
            };
            ConditionExpression ce = null;

            if (!string.IsNullOrEmpty(planName))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "PlanName";
                ce.ExpValue    = "%" + planName + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(projectName))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "ProjectName";
                ce.ExpValue    = "%" + projectName + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(applyCompanyName))
            {
                ce             = new ConditionExpression();
                ce.ExpName     = "ApplyCompanyName";
                ce.ExpValue    = "%" + applyCompanyName + "%";
                ce.ExpOperater = eConditionOperator.Like;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            if (!string.IsNullOrEmpty(state))
            {
                int statu = (int)Enum.Parse(typeof(ApprovalState), state);
                ce             = new ConditionExpression();
                ce.ExpName     = "State";
                ce.ExpValue    = statu;
                ce.ExpOperater = eConditionOperator.Equal;
                ce.ExpLogical  = eLogicalOperator.And;
                qc.ConditionList.Add(ce);
            }
            Result <List <Epm_PlanDelay> > result = new Result <List <Epm_PlanDelay> >();

            using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request)))
            {
                result = proxy.GetPlanDelayList(qc);

                //long projectId = result.Data[0].ProjectId;
                //bool IsSupervisor = proxy.IsSupervisor(projectId, CurrentUser.UserId);
                ViewBag.Total     = result.AllRowsCount;
                ViewBag.TotalPage = Math.Ceiling((decimal)result.AllRowsCount / pageSize);
                ViewBag.UserID    = ApplicationContext.Current.UserID;
                ViewBag.UserName  = ApplicationContext.Current.UserName;
                ViewBag.State     = typeof(ApprovalState).AsSelectList(true, state, new List <string>()
                {
                    ApprovalState.WorkPartAppr.ToString(), ApprovalState.WorkFinish.ToString()
                });

                //ViewBag.IsSupervisor = IsSupervisor;
            }
            return(View(result.Data));
        }
コード例 #24
0
        ///<summary>
        ///获取列表:
        ///</summary>
        /// <param name="qc">查询条件</param>
        /// <returns>符合条件的数据集合</returns>
        public Result <List <TzTenderingCountView> > GetTzTenderingCountList(QueryCondition qc)
        {
            Result <List <TzTenderingCountView> > result = new Result <List <TzTenderingCountView> >();

            try
            {
                var query = from pp in context.Epm_TzProjectProposal.Where(p => p.IsDelete == false)
                            select new
                {
                    //pp.Id,
                    //pp.ProjectName,
                    //pp.NatureName,
                    //pp.StationName
                    pp
                };

                var projectList = query.ToList().Select(c => new TzTenderingCountView()
                                                        //query.ToList().OrderByDescending(p => p.pp.ProjectName).Skip(skip).Take(take).AsEnumerable().Select(c => new TzTenderingCountView()
                {
                    Id          = c.pp.Id,
                    ProjectName = c.pp.ProjectName,
                    StationName = c.pp.StationName,
                    NatureName  = c.pp.NatureName,
                    OperateTime = c.pp.OperateTime,
                    counts      = GetCounts(c.pp.Id.ToString())
                }).ToList();


                if (qc != null && qc.ConditionList.Any())
                {
                    foreach (var conditionExpression in qc.ConditionList)
                    {
                        string value     = (conditionExpression.ExpValue ?? "").ToString();
                        string valueName = (conditionExpression.ExpName ?? "").ToString();
                        if (!string.IsNullOrWhiteSpace(value))
                        {
                            switch (valueName)
                            {
                            case "ProjectName":
                            {
                                projectList = projectList.Where(t => t.ProjectName.Contains(value)).ToList();
                                break;
                            }

                            case "counts":
                            {
                                projectList = projectList.Where(t => t.counts == Convert.ToInt32(value)).ToList();
                                break;
                            }

                            default:
                                break;
                            }
                        }
                    }
                }
                //int skip = (qc.PageInfo.CurrentPageIndex - 1) * qc.PageInfo.PageRowCount;
                //int take = qc.PageInfo.PageRowCount;
                //int total = projectList.Count();
                result.AllRowsCount = projectList.Count();
                projectList         = projectList.OrderByDescending(t => t.OperateTime).Skip((qc.PageInfo.CurrentPageIndex - 1) * qc.PageInfo.PageRowCount).Take(qc.PageInfo.PageRowCount).ToList();
                result.Data         = projectList;
                result.Flag         = EResultFlag.Success;
            }
            catch (Exception ex)
            {
                result.Data      = null;
                result.Flag      = EResultFlag.Failure;
                result.Exception = new ExceptionEx(ex, "GetTzTenderingCountList");
            }
            return(result);
        }
コード例 #25
0
 ///<summary>
 ///获取列表:邮件发送记录
 ///</summary>
 public Result <List <Msg_Email> > GetEmailList(QueryCondition qc)
 {
     return(base.Channel.GetEmailList(qc));
 }
コード例 #26
0
 ///<summary>
 ///获取列表:短信模板
 ///</summary>
 public Result <List <Msg_SMSTemplete> > GetSMSTempleteList(QueryCondition qc)
 {
     return(base.Channel.GetSMSTempleteList(qc));
 }
コード例 #27
0
    /// <summary>
    /// Adds the content sub query.
    /// </summary>
    /// <param name="query">The boolean query.</param>
    /// <param name="key">The field key.</param>
    /// <param name="value">The field value.</param>
    /// <param name="matchVariant">The match variant.</param>
    /// <param name="condition">The condition.</param>
    /// <param name="isFirst">if set to <c>true</c> [is first].</param>
    private void AddContentSubQuery(LuceneSearch.BooleanQuery query, string key, string value, MatchVariant matchVariant, QueryCondition condition)
    {
      if (matchVariant == MatchVariant.NotEquals)
      {
        query.Add(new LuceneSearch.TermQuery(new Term(key, value)), LuceneSearch.Occur.MUST_NOT);
        return;
      }

      LuceneSearch.Occur occurrence = this.GetOccur(condition);

      LuceneSearch.TermRangeQuery rangeQuery = this.GetRangeQuery(key, value, matchVariant);
      if (rangeQuery != null)
      {
        query.Add(rangeQuery, occurrence);
        return;
      }

      string[] keywords = value.Split(' ');
      if (keywords.Length > 1)
      {
        LuceneSearch.PhraseQuery phraseQuery = new Lucene.Net.Search.PhraseQuery();

        foreach (string keyword in keywords)
        {
          phraseQuery.Add(new Term(key, keyword));
        }

        query.Add(phraseQuery, occurrence);
      }
      else if (matchVariant == MatchVariant.Like)
      {
        query.Add(new LuceneSearch.WildcardQuery(new Term(key, value + "*")), occurrence);
      }
      else
      {
        query.Add(new LuceneSearch.TermQuery(new Term(key, value)), occurrence);
      }
    }
コード例 #28
0
 public Result <List <Base_VideoManage> > GetVideoManageList(QueryCondition qc)
 {
     return(base.Channel.GetVideoManageList(qc));
 }
コード例 #29
0
        // GET: TzGcGoodsOrdersApply
        /// <summary>
        /// 工程甲供物资订单列表
        /// </summary>
        /// <param name="title">标题</param>
        /// <param name="projectName">项目名称</param>
        /// <param name="companyName">申请单位</param>
        /// <param name="companyId">申请单位Id</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="supplierName">供应商名称</param>
        /// <param name="materialNumber">物资种类</param>
        /// <param name="state">状态</param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ActionResult Index(string title = "", string projectName = "", string companyName = "", string companyId = "", string startTime = "", string endTime = "", string supplierName = "", string materialNumber = "", string state = "", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.projectName    = projectName;
            ViewBag.companyName    = companyName;
            ViewBag.pageIndex      = pageIndex;
            ViewBag.startTime      = startTime;
            ViewBag.endTime        = endTime;
            ViewBag.title          = title;
            ViewBag.supplierName   = supplierName;
            ViewBag.materialNumber = materialNumber;
            ViewBag.state          = state;

            Result <List <TzGcGoodsOrdersItemView> > result = new Result <List <TzGcGoodsOrdersItemView> >();

            using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request)))
            {
                ViewBag.IsAgencyUser = false;
                var companyInfo = proxy.GetCompanyModel(CurrentUser.CompanyId).Data;
                if (companyInfo != null)
                {
                    //是省公司
                    if (companyInfo.OrgType == "1" || (companyInfo.PId == 10 && companyInfo.OrgType == "3"))
                    {
                        ViewBag.IsAgencyUser = true;
                        companyId            = "";
                    }
                    else if (companyInfo.OrgType == "2" || (companyInfo.PId != 10 && companyInfo.OrgType == "3"))
                    {
                        companyId           = CurrentUser.CompanyId.ToString();
                        ViewBag.CompanyName = CurrentUser.CompanyName;
                    }
                }

                #region 查询条件
                QueryCondition      qc = new QueryCondition();
                ConditionExpression ce = null;
                if (!string.IsNullOrEmpty(title))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "Title";
                    ce.ExpValue    = title;
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrEmpty(supplierName))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "SupplierName";
                    ce.ExpValue    = supplierName;
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrEmpty(materialNumber))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "MaterialNumber";
                    ce.ExpValue    = materialNumber;
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrEmpty(state))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "State";
                    ce.ExpValue    = state;
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrEmpty(projectName))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "ProjectName";
                    ce.ExpValue    = projectName;
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrEmpty(companyId))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "CompanyId";
                    ce.ExpValue    = Convert.ToInt64(companyId);
                    ce.ExpOperater = eConditionOperator.Equal;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrWhiteSpace(startTime))
                {
                    DateTime stime = Convert.ToDateTime(startTime);
                    qc.ConditionList.Add(new ConditionExpression()
                    {
                        ExpName     = "ApplyDate",
                        ExpValue    = stime,
                        ExpLogical  = eLogicalOperator.And,
                        ExpOperater = eConditionOperator.GreaterThanOrEqual
                    });
                }
                if (!string.IsNullOrWhiteSpace(endTime))
                {
                    DateTime etime = Convert.ToDateTime(endTime + " 23:59:59");
                    qc.ConditionList.Add(new ConditionExpression()
                    {
                        ExpName     = "ApplyDate",
                        ExpValue    = etime,
                        ExpLogical  = eLogicalOperator.And,
                        ExpOperater = eConditionOperator.LessThanOrEqual
                    });
                }
                qc.SortList.Add(new SortExpression("OperateTime", eSortType.Desc));
                qc.PageInfo = GetPageInfo(pageIndex, pageSize);
                #endregion

                result            = proxy.GetTzGcGoodsOrdersApplyListAll(qc);
                ViewBag.Total     = result.AllRowsCount;
                ViewBag.TotalPage = Math.Ceiling((decimal)result.AllRowsCount / pageSize);

                //根据字典类型集合获取字典数据
                List <DictionaryType> subjectsList = new List <DictionaryType>()
                {
                    DictionaryType.MaterialNumber
                };
                var subjects = proxy.GetTypeListByTypes(subjectsList).Data;

                // 物资种类
                ViewBag.MaterialNumber = subjects[DictionaryType.MaterialNumber].ToSelectList("Name", "No", true);
            }

            return(View(result.Data));
        }
コード例 #30
0
 public Result <List <Epm_Project> > GetIndexProject(QueryCondition qc)
 {
     return(base.Channel.GetIndexProject(qc));
 }
コード例 #31
0
 /// <summary>
 ///JQResource字段值
 /// </summary>
 /// <param name="field">JQResource字段</param>
 /// <param name="fieldValue">字段值</param>
 /// <param name="queryOperator">条件操作类型</param>
 /// <param name="queryCondition">条件关系</param>
 public JQResourceWhereFields(JQResourceFields field,object fieldValue, QueryCondition queryCondition,QueryOperator queryOperator)
 {
     this.field = field;
     this.fieldValue = fieldValue;
     this.queryOperator = queryOperator;
     this.queryCondition = queryCondition;
 }
コード例 #32
0
 ///<summary>
 ///获取列表:
 ///</summary>
 ///<param name="qc">查询条件</param>
 ///<returns>符合条件的数据集合</returns>
 public Result <List <Epm_TemplateDetails> > GetTemplateDetailsList(QueryCondition qc)
 {
     return(base.Channel.GetTemplateDetailsList(qc));
 }
コード例 #33
0
 /// <summary>
 /// 获取消息环节配置列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Msg_MessageSection> > GetSectionList(QueryCondition qc)
 {
     return(base.Channel.GetSectionList(qc));
 }
コード例 #34
0
 /// <summary>
 /// 获取新闻列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_News> > GetNewsList(QueryCondition qc)
 {
     return(base.Channel.GetNewsList(qc));
 }
コード例 #35
0
 /// <summary>
 /// 获取id
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public int GetId(QueryCondition query)
 {
     return(EntityDao.GetId(query));
 }
コード例 #36
0
 /// <summary>
 /// 获取广告位列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_AdTarget> > GetAdTargetListWhr(QueryCondition qc)
 {
     return(base.Channel.GetAdTargetListWhr(qc));
 }
コード例 #37
0
 public List<BrowsingHistoryEntity> Search(QueryCondition<BrowsingHistoryEntity> entity)
 {
     return RestClient.Post<List<BrowsingHistoryEntity>>("BrowsingHistoryService/Search", entity);
 }
コード例 #38
0
 /// <summary>
 /// 获取广告投放列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_AdPutRecord> > GetAdPutRecordList(QueryCondition qc)
 {
     return(base.Channel.GetAdPutRecordList(qc));
 }
コード例 #39
0
ファイル: FormQuery1.cs プロジェクト: jerryshi2007/AK47Source
        /// <summary>
        /// 表单分页查询
        /// </summary>
        /// <param name="startRowIndex"></param>
        /// <param name="maximumRows"></param>
        /// <param name="where"></param>
        /// <param name="orderBy"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public AppCommonInfoCollection GetFormQueryWithCount(int startRowIndex, int maximumRows, string where, string orderBy, ref int totalCount)
        {
            if (string.IsNullOrEmpty(where))
                where = "1 = 1";

            if (string.IsNullOrEmpty(orderBy))
                orderBy = "CREATE_TIME DESC";

            if (RolesDefineConfig.GetConfig().IsCurrentUserInRoles("ProcessAdmin") == false)
            {
                ConnectiveSqlClauseCollection cscc = WfAclAdapter.Instance.GetAclQueryConditionsByUser(string.Empty);

                string resourceIDList = string.Format("SELECT RESOURCE_ID FROM WF.ACL WHERE {0}", cscc.ToSqlString(TSqlBuilder.Instance));

                where = string.Format("{0} AND ACI.RESOURCE_ID IN ({1})", where, resourceIDList);
            }

            //LDM 加上ACI.PROGRAM_NAME as [PROGRAM_NAME1],
            //兼容远洋地产的查询(表单工作程序里没有对 APPLICATIONFORM_INFO 表插入数据行)
            string strSelect = @" ACI.APPLICATION_NAME,ACI.[PROGRAM_NAME] as [PROGRAM_NAME_MCS],ACI.RESOURCE_ID,ACI.[SUBJECT],ACI.[EMERGENCY]," +
                               "  ACI.URL,ACI.CREATOR_ID, ACI.CREATOR_NAME,ACI.CREATE_TIME,ACI.DRAFT_DEPARTMENT_NAME";

            string strfrom = @" WF.APPLICATIONS_COMMON_INFO as ACI (nolock)";
           

            QueryCondition qc = new QueryCondition(
                       startRowIndex,
                       maximumRows,
                       strSelect,
                       strfrom,
                       orderBy,
                       where
                       );
            CommonAdapter commonAdapter = new CommonAdapter(ConnectionDefine.SearchConnectionName);
            DataSet ds = commonAdapter.SplitPageQuery(qc, totalCount < 0);

            AppCommonInfoCollection FormQueryEntitys = new AppCommonInfoCollection();

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                AppCommonInfo entity = new AppCommonInfo();

                ORMapping.DataRowToObject(row, entity);
                FormQueryEntitys.Add(entity);
            }

            if (ds.Tables.Count > 1)
                totalCount = (int)ds.Tables[1].Rows[0][0];

            HttpContext.Current.Items["UserFormQueryEntityCount"] = totalCount;

            //当页码超出索引的,返回最大页
            if (FormQueryEntitys.Count == 0 && totalCount > 0)
            {
                int newStartRowIndex = (totalCount - 1) / maximumRows * maximumRows;

                totalCount = -1;

                FormQueryEntitys = GetFormQueryWithCount(newStartRowIndex, maximumRows, where, orderBy, ref totalCount);
            }

            return FormQueryEntitys;
        }
コード例 #40
0
 public Result <List <NoticeView> > GetNoticeViewList(QueryCondition qc)
 {
     return(base.Channel.GetNoticeViewList(qc));
 }
コード例 #41
0
    /// <summary>
    /// Adds the term query.
    /// </summary>
    /// <param name="query">The query.</param>
    /// <param name="subquery">The subquery.</param>
    /// <param name="condition">The condition.</param>
    /// <param name="isFirst">if set to <c>true</c> [is first].</param>
    protected virtual void AddSubQuery(LuceneSearch.BooleanQuery query, SubQuery subquery, QueryCondition condition)
    {
      string value = ID.IsID(subquery.Value) ? subquery.Value : subquery.Value.ToLower();
      string key = subquery.Key.ToLower();
      if (subquery is AttributeQuery)
      {
        key = this.MapAttributes(key);
      }

      // optimizing search query
      if (key == Sitecore.Search.BuiltinFields.ID ||
          key == Sitecore.Search.BuiltinFields.Template ||
          key == BuiltinFields.ProductBaseTemplate ||
          key == Sitecore.Search.BuiltinFields.AllTemplates)
      {
        this.AddIdQuery(query, key, value, condition);
      }
      else
      {
        this.AddContentSubQuery(query, key, value, subquery.MatchVariant, condition);
      }
    }
コード例 #42
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="log"></param>
 public static List<ProductEntity> Search(QueryCondition<ProductEntity> entity)
 {
     return RestClient.Post<List<ProductEntity>>("ProductService/Search", entity);
 }
コード例 #43
0
 /// <summary>
 /// Adds the simple query.
 /// </summary>
 /// <param name="query">The boolean query.</param>
 /// <param name="key">The field key.</param>
 /// <param name="value">The field value.</param>
 /// <param name="condition">The condition.</param>
 /// <param name="isFirst">if set to <c>true</c> [is first].</param>
 private void AddIdQuery(LuceneSearch.BooleanQuery query, string key, string value, QueryCondition condition)
 {
   value = this.GetItemPath(new ID(value));
   LuceneSearch.Occur occurrence = this.GetOccur(condition);
   query.Add(new LuceneSearch.TermQuery(new Term(key, value)), occurrence);
 }
コード例 #44
0
 /// <summary>
 /// 获取消息发送策略列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Msg_MessageStrategy> > GetStrategyList(QueryCondition qc)
 {
     return(base.Channel.GetStrategyList(qc));
 }
コード例 #45
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="log"></param>
 public static List<ClubMembersEntity> Search(QueryCondition<ClubMembersEntity> entity)
 {
     return RestClient.Post<List<ClubMembersEntity>>("ClubMemberService/Search", entity);
 }
コード例 #46
0
 /// <summary>
 ///Comments字段值
 /// </summary>
 /// <param name="field">Comments字段</param>
 /// <param name="fieldValue">字段值</param>
 /// <param name="queryOperator">条件操作类型</param>
 /// <param name="queryCondition">条件关系</param>
 public CommentsWhereFields(CommentsFields field,object fieldValue, QueryCondition queryCondition,QueryOperator queryOperator)
 {
     this.field = field;
     this.fieldValue = fieldValue;
     this.queryOperator = queryOperator;
     this.queryCondition = queryCondition;
 }
コード例 #47
0
 ///<summary>
 ///获取列表:
 ///</summary>
 ///<param name="qc">查询条件</param>
 ///<returns>符合条件的数据集合</returns>
 public Result <List <Epm_CheckItem> > GetCheckItemList(QueryCondition qc)
 {
     return(base.Channel.GetCheckItemList(qc));
 }
コード例 #48
0
 ///<summary>
 ///获取列表:历史短信
 ///</summary>
 public Result <List <Msg_SMSHistory> > GetSMSHistoryList(QueryCondition qc)
 {
     return(base.Channel.GetSMSHistoryList(qc));
 }
コード例 #49
0
 public List<ErrorLogEntity> Search(QueryCondition<ErrorLogEntity> entity)
 {
     return ObjectFactory<IErrorLogDataAccess>.Instance.Seach(entity);
 }
コード例 #50
0
 ///<summary>
 ///获取列表:
 ///</summary>
 /// <param name="qc">查询条件</param>
 /// <returns>符合条件的数据集合</returns>
 public Result <List <Epm_Constitute> > GetConstituteList(QueryCondition qc)
 {
     return(base.Channel.GetConstituteList(qc));
 }
コード例 #51
0
 /// <summary>
 ///Comments字段值
 /// </summary>
 /// <param name="field">Comments字段</param>
 /// <param name="fieldValue">字段值</param>
 public CommentsWhereFields(CommentsFields field,object fieldValue)
 {
     this.field = field;
     this.fieldValue = fieldValue;
     this.queryOperator = QueryOperator.And;
     this.queryCondition = QueryCondition.Equal;
 }
コード例 #52
0
 /// <summary>
 /// 获取服务商(根据总批复构成获取关联的服务商)
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_ConstituteCompanyDetails> > GetConstituteCompanyDetailsList(QueryCondition qc)
 {
     return(base.Channel.GetConstituteCompanyDetailsList(qc));
 }
コード例 #53
0
 /// <summary>
 ///JQResource字段值
 /// </summary>
 /// <param name="field">JQResource字段</param>
 /// <param name="fieldValue">字段值</param>
 public JQResourceWhereFields(JQResourceFields field,object fieldValue)
 {
     this.field = field;
     this.fieldValue = fieldValue;
     this.queryOperator = QueryOperator.And;
     this.queryCondition = QueryCondition.Equal;
 }
コード例 #54
0
 /// <summary>
 /// 获取项目资料列表
 /// </summary>
 /// <param name="qc"></param>
 /// <returns></returns>
 public Result <List <Epm_DataConfig> > GetDataConfigListWhr(QueryCondition qc)
 {
     return(base.Channel.GetDataConfigListWhr(qc));
 }
コード例 #55
0
ファイル: IVHelper.cs プロジェクト: RoviABC/ABInvVP
        public List<ABiIV> getIV(QueryCondition query)
        {
            try
            {

                var objList = dbContent.f_getInvoiceStatus(query.VendorCode,
                                                           query.CompanyCode,
                                                           query.InvoiceNumber,
                                                           query.GetMinDate(query.DateBegin),
                                                           query.GetMaxDate(query.DateEnd),
                                                           query.PaymentStatus,
                                                           query.UserID);

                return (from obj in objList
                        select new ABiIV()
                        {
                            CompanyCode = obj.CompanyCode,
                            VendorCode = obj.VendorCode,
                            InvoiceNumber = obj.InvoiceNumber,
                            InvoiceDate = obj.InvoiceDate ?? DateTime.MinValue,
                            PaymentStatus = obj.PaymentStatus,
                            DueDate = obj.DueDate ?? DateTime.MinValue,
                            PaymentDate = obj.DatePayment ?? DateTime.MinValue,
                            PayAmount = obj.PayAmount ?? 0,
                            RoleID = query.RoleID,
                            InvoiceID = obj.ABi_Invoice_ID,
                            IsSynced = obj.IsSynced ?? false
                        }).ToList();
            }
            catch (Exception ex)
            {
                logger.LogError(query, ex);
            }
            return new List<ABiIV>();
        }
コード例 #56
0
 ///<summary>
 ///获取列表:项目考勤设置表
 ///</summary>
 ///<param name="qc">查询条件</param>
 ///<returns>符合条件的数据集合</returns>
 public Result <List <Epm_ProjectAttendance> > GetProjectAttendanceList(QueryCondition qc)
 {
     return(base.Channel.GetProjectAttendanceList(qc));
 }
コード例 #57
0
ファイル: IVHelper.cs プロジェクト: RoviABC/ABInvVP
        public List<ABiIVPending> getIVPending(QueryCondition query)
        {
            try
            {
                var objList = dbContent.f_getInvoicePending(query.VendorCode,
                                                            query.VendcorName,
                                                           query.CompanyCode,
                                                           query.InvoiceNumber,
                                                           query.GetMinDate(query.DateBegin),
                                                           query.GetMaxDate(query.DateEnd),
                                                           query.Buys,
                                                           query.UserID);

                return (from obj in objList
                        select new ABiIVPending()
                        {
                            InvoiceNumber = obj.InvoiceNumber,
                            CompanyCode = obj.CompanyCode,
                            VendorCode = obj.VendorCode,
                            TotalAmount = obj.TotalAmount ?? 0,
                            TaxAmount = obj.TaxAmount ?? 0,
                            InvoiceDate = obj.InvoiceDate ?? DateTime.MinValue,
                            Remark = obj.Remark,
                            InvoiceID = obj.ABi_Invoice_ID,
                            POCreator = obj.POCreator
                        }).ToList();
            }
            catch (Exception ex)
            {
                logger.LogError(query, ex);
            }
            return new List<ABiIVPending>();
        }
コード例 #58
0
 public Result <List <Epm_Milepost> > GetMilepostListQc(QueryCondition qc)
 {
     return(base.Channel.GetMilepostListQc(qc));
 }
コード例 #59
0
 ///<summary>
 ///获取列表:
 ///</summary>
 /// <param name="qc">查询条件</param>
 /// <returns>符合条件的数据集合</returns>
 public Result <List <Epm_WorkMainPoints> > GetWorkMainPointsList(QueryCondition qc)
 {
     return(base.Channel.GetWorkMainPointsList(qc));
 }
コード例 #60
0
        public ActionResult Index(string projectName = "", string companyIds = "", string userName = "", string startTime = "", string endTime = "", string state = "-1", int pageIndex = 1, int pageSize = 10)
        {
            ViewBag.projectName = projectName;
            ViewBag.companyIds  = companyIds;
            ViewBag.userName    = userName;
            ViewBag.startTime   = startTime;
            ViewBag.endTime     = endTime;
            ViewBag.pageIndex   = pageIndex;
            ViewBag.state       = state;

            Result <List <Epm_TzProjectPolit> > result = new Result <List <Epm_TzProjectPolit> >();

            using (ClientSiteClientProxy proxy = new ClientSiteClientProxy(ProxyEx(Request)))
            {
                QueryCondition      qc = new QueryCondition();
                ConditionExpression ce = null;

                if (!string.IsNullOrEmpty(projectName))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "ProjectName";
                    ce.ExpValue    = "%" + projectName + "%";
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }

                if (!string.IsNullOrEmpty(companyIds))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "CompanyId";
                    ce.ExpValue    = companyIds;
                    ce.ExpOperater = eConditionOperator.In;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }

                if (!string.IsNullOrEmpty(userName))
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "CreateUserName";
                    ce.ExpValue    = "%" + userName + "%";
                    ce.ExpOperater = eConditionOperator.Like;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                if (!string.IsNullOrWhiteSpace(startTime))
                {
                    DateTime stime = Convert.ToDateTime(startTime);
                    qc.ConditionList.Add(new ConditionExpression()
                    {
                        ExpName     = "CreateTime",
                        ExpValue    = stime,
                        ExpLogical  = eLogicalOperator.And,
                        ExpOperater = eConditionOperator.GreaterThanOrEqual
                    });
                }
                if (!string.IsNullOrWhiteSpace(endTime))
                {
                    DateTime etime = Convert.ToDateTime(endTime);
                    qc.ConditionList.Add(new ConditionExpression()
                    {
                        ExpName     = "CreateTime",
                        ExpValue    = etime,
                        ExpLogical  = eLogicalOperator.And,
                        ExpOperater = eConditionOperator.LessThanOrEqual
                    });
                }

                if (!string.IsNullOrEmpty(state) && state != "-1")
                {
                    ce             = new ConditionExpression();
                    ce.ExpName     = "State";
                    ce.ExpValue    = state;
                    ce.ExpOperater = eConditionOperator.In;
                    ce.ExpLogical  = eLogicalOperator.And;
                    qc.ConditionList.Add(ce);
                }
                qc.PageInfo = GetPageInfo(pageIndex, pageSize);
                result      = proxy.GetProjectApprovalList(qc);

                ViewBag.Total     = result.AllRowsCount;
                ViewBag.TotalPage = Math.Ceiling((decimal)result.AllRowsCount / pageSize);

                var compamyList = proxy.GetAreaCompanyList();

                //地市公司
                ViewBag.CompanyName = compamyList.Data.ToSelectList("Name", "Id", true);

                //ViewBag.BranchCompany = JsonConvert.SerializeObject(compamyList.Data);
            }

            return(View(result.Data));
        }