예제 #1
0
        /// <summary>
        /// EIMS单据查询
        /// </summary>
        /// <param name="filter">查询条件集合</param>
        /// <param name="callback">回调函数</param>
        public void QueryEIMSInvoice(EIMSInvoiceQueryFilter filter, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            string relativeUrl = "ExternalSYSService/ExternalSYS/QueryEIMSInvoice";

            filter.CompanyCode = CPApplication.Current.CompanyCode;
            restClient.QueryDynamicData(relativeUrl, filter, callback);
        }
예제 #2
0
        /// <summary>
        /// 查询EIMS单据
        /// </summary>
        /// <param name="filter">查询条件集合</param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        public DataTable EIMSInvoiceQuery(EIMSInvoiceQueryFilter filter, out int totalCount)
        {
            CustomDataCommand cmd;

            if (filter.IsC1Summary == null ||
                filter.IsC1Summary == false)
            {
                cmd = DataCommandManager.CreateCustomDataCommandFromConfig("ExternalSYS_Query_EIMSInvoice");
            }
            else
            {
                cmd = DataCommandManager.CreateCustomDataCommandFromConfig("ExternalSYS_Query_EIMSInvoiceBYC1Name");
            }

            using (DynamicQuerySqlBuilder sb = new DynamicQuerySqlBuilder(cmd.CommandText, cmd, HelpDA.ToPagingInfo(filter.PagingInfo), "vendor.SysNo DESC"))
            {
                AddEIMSInvoiceParameters(filter, sb, cmd);
                DataTable dt = cmd.ExecuteDataTable();

                EnumColumnList         enumColList     = new EnumColumnList();
                CodeNamePairColumnList codeNameColList = new CodeNamePairColumnList();
                codeNameColList.Add("EIMSType", "ExternalSYS", "EIMSType");
                codeNameColList.Add("ReceiveType", "ExternalSYS", "ReceivedType");
                codeNameColList.Add("Status", "ExternalSYS", "InvoiceStatus");

                cmd.ConvertColumn(dt, enumColList, codeNameColList);

                totalCount = Convert.ToInt32(cmd.GetParameterValue("@TotalCount"));
                return(dt);
            }
        }
예제 #3
0
 public QueryResult QueryEIMSInvoice(EIMSInvoiceQueryFilter filter)
 {
     return(QueryList <EIMSInvoiceQueryFilter>(filter, ObjectFactory <IComprehensiveReportDA> .Instance.EIMSInvoiceQuery));
 }
예제 #4
0
 /// <summary>
 /// 数据导出
 /// </summary>
 /// <param name="filter"></param>
 /// <param name="columns"></param>
 public void ExportEIMSInvoice(EIMSInvoiceQueryFilter filter, ColumnSet[] columns)
 {
     filter.CompanyCode = CPApplication.Current.CompanyCode;
     restClient.ExportFile("/ExternalSYSService/ExternalSYS/QueryEIMSInvoice", filter, columns);
 }
예제 #5
0
        private void AddEIMSInvoiceParameters(EIMSInvoiceQueryFilter filter, DynamicQuerySqlBuilder sb, CustomDataCommand cmd)
        {
            sb.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "vendor.CompanyCode", DbType.AnsiStringFixedLength, "@CompanyCode", QueryConditionOperatorType.Equal, filter.CompanyCode);

            if (filter.VendorSysNo.HasValue)
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "vendor.SysNo",
                    DbType.String,
                    "@SysNo",
                    QueryConditionOperatorType.Equal,
                    filter.VendorSysNo);
            }
            if (!string.IsNullOrEmpty(filter.VendorName))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "vendor.VendorName",
                    DbType.String,
                    "@VendorName",
                    QueryConditionOperatorType.Like,
                    filter.VendorName);
            }
            if (!string.IsNullOrEmpty(filter.RuleNo))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "ruleMaster.AssignedCode",
                    DbType.String,
                    "@RuleNo",
                    QueryConditionOperatorType.Equal,
                    filter.RuleNo);
            }
            if (!string.IsNullOrEmpty(filter.InvoiceNo))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.AssignedCode",
                    DbType.String,
                    "@InvoiceNo",
                    QueryConditionOperatorType.Equal,
                    filter.InvoiceNo);
            }
            if (!string.IsNullOrEmpty(filter.EIMSType))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.EIMSType",
                    DbType.String,
                    "@EIMSType",
                    QueryConditionOperatorType.Equal,
                    filter.EIMSType);
            }
            if (!string.IsNullOrEmpty(filter.ReceivedType))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.ReceiveType",
                    DbType.String,
                    "@ReceivedType",
                    QueryConditionOperatorType.Equal,
                    filter.ReceivedType);
            }
            if (filter.InvoiceApprovedStart.HasValue)
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.ApproveDate",
                    DbType.DateTime,
                    "@ApproveDateStart",
                    QueryConditionOperatorType.MoreThanOrEqual,
                    filter.InvoiceApprovedStart);
            }
            if (filter.InvocieApprovedEnd.HasValue)
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.ApproveDate",
                    DbType.DateTime,
                    "@ApproveDateEnd",
                    QueryConditionOperatorType.LessThanOrEqual,
                    filter.InvocieApprovedEnd);
            }
            if (!string.IsNullOrEmpty(filter.InvoiceStatus))
            {
                sb.ConditionConstructor.AddCondition(
                    QueryConditionRelationType.AND,
                    "invoiceMaster.Status",
                    DbType.String,
                    "@InvoiceStatus",
                    QueryConditionOperatorType.Equal,
                    filter.InvoiceStatus);
            }

            cmd.AddOutParameter("@SumNoReceivedAmount", DbType.Double, 50);
            object obj = cmd.GetParameterValue("@SumNoReceivedAmount");

            if (obj == null ||
                Convert.IsDBNull(obj))
            {
                obj = 0;
            }
            cmd.AddInputParameter("@PageSize", DbType.Int32, filter.PagingInfo.PageSize);
            cmd.AddInputParameter("@PageIndex", DbType.Int32, filter.PagingInfo.PageIndex);

            cmd.CommandText = sb.BuildQuerySql();
        }
예제 #6
0
 /// <summary>
 /// 初始化
 /// </summary>
 private void IniPageData()
 {
     m_commonDataFacade = new CommonDataFacade(CPApplication.Current.CurrentPage);
     this.SearchCondition.DataContext = m_queryRequest = new EIMSInvoiceQueryFilter();
     BindComboBoxData();
 }