public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <Department> collection = new XPCollection <Department>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                new BinaryOperator("OrganizationId.OrganizationId", Utility.CurrentSession.Instance.AccessingOrganizationId),
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    )
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
示例#2
0
        public static BaseObject PullCachedInstance(DevExpress.Xpo.Session session, BaseObject CachedInstance,
                                                    Type objType)
        {
            // return previous instance if session matches
            try
            {
                if (CachedInstance != null &&
                    ((BaseObject)CachedInstance).Session == session &&
                    !CachedInstance.IsDeleted)
                {
                    return(CachedInstance);
                }
            }
            catch (ObjectDisposedException)
            {
            }

            // return instance from new session
            var instance = session.FindObject(
                PersistentCriteriaEvaluationBehavior.InTransaction, objType, null) as BaseObject;

            if (instance == null)
            {
                // create SetOfBooks if it doesn't exist
                instance = Activator.CreateInstance(objType, session) as BaseObject;
                instance.Save();
            }
            return(instance);
        }
示例#3
0
 private SingletonTPFact()
 {
     Sess              = TP.SessionManager.XPOController.SessionPrincipale;
     FactureEntetes    = new FactureEntetes(Sess);
     ConditionPaiement =
         (from pc in new XPQuery <ConditionPaiement>(Sess) select pc).FirstOrDefault();
 }
示例#4
0
        protected void Page_Init(object sender, EventArgs e)
        {
            XpoSession = XpoHelper.GetNewSession();
            ASPxComboBox1.DataSource = GetCustomerTypes();

            XpoDataSource1.Session = XpoSession;
        }
示例#5
0
 public override void TransformTransaction(DevExpress.Xpo.Session session)
 {
     if (IsRelatedStrategy)
     {
         this.fFinancialTransformData = base.TransformTransaction(session, this.fFinancialTransactionData, ACCOUNT_CODE);
     }
 }
        public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <InventoryCommand> collection = new XPCollection <InventoryCommand>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            //Get SUPPLIER trading type
            //TradingCategory supplierTradingCategory =
            //    session.FindObject<TradingCategory>(new BinaryOperator("Code", "SUPPLIER"));

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                //CriteriaOperator.Or(
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                //    new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_BOOKED_ENTRY)
                //),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                new BinaryOperator("CommandType", 'I', BinaryOperatorType.Equal)
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
        public override void ComboBoxItem_ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox        combo      = source as ASPxComboBox;
            XPCollection <Item> collection = new XPCollection <Item>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                new ContainsOperator("ItemCustomTypes",
                                     new BinaryOperator("ObjectTypeId", ObjectType.GetDefault(session, ObjectTypeEnum.FIXED_ASSETS)))
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
 public override void TransformTransaction(DevExpress.Xpo.Session session)
 {
     if (IsRelatedStrategy)
     {
         this.fDetailAfterTransformData = base.TransformTransactionFinancialActualPriceDetail(session, this.fActualPriceTransaction, ACCOUNT_CODE);
     }
 }
示例#9
0
        public virtual void DeleteBillItem(DevExpress.Xpo.Session session, Guid billItemId)
        {
            try
            {
                NAS.DAL.Invoice.BillItem billItem =
                    session.GetObjectByKey <NAS.DAL.Invoice.BillItem>(billItemId);
                Bill bill = billItem.BillId;
                if (billItem == null)
                {
                    return;
                }
                billItem.Delete();

                //Update totalprice
                bill.SumOfItemPrice = bill.BillItems.Sum(r => r.TotalPrice);
                bill.Save();

                if (bill.PromotionCalculationType.Equals(Utility.Constant.CALCULATION_TYPE_ON_ITEMS))
                {
                    UpdatePromotionOnItems(session, bill.BillId);
                }

                UpdateSumOfTax(session, bill);

                #region Update bill Total
                bill.Total = bill.SumOfItemPrice - bill.SumOfPromotion + bill.SumOfTax;
                bill.Save();
                #endregion Update bill Total
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#10
0
 public NAS.DAL.Accounting.Currency.Currency GetDefaultCurrency(DevExpress.Xpo.Session session)
 {
     try
     {
         CurrencyType currencyType_Id_true = session.FindObject <CurrencyType>(
             CriteriaOperator.And(
                 new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.Equal),
                 new BinaryOperator("IsMaster", true, BinaryOperatorType.Equal)
                 ));
         Currency currency_Id_true = session.FindObject <Currency>(
             CriteriaOperator.And(
                 new BinaryOperator("CurrencyTypeId", currencyType_Id_true.CurrencyTypeId, BinaryOperatorType.Equal),
                 new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.Equal),
                 new BinaryOperator("IsDefault", true, BinaryOperatorType.Equal)
                 ));
         if (currency_Id_true != null)
         {
             return(currency_Id_true);
         }
         return(null);
     }
     catch (Exception)
     {
         throw new NotImplementedException();
     }
 }
示例#11
0
        public override void FixInvokedBussinessObjects(DevExpress.Xpo.Session session, DevExpress.Xpo.XPCollection <DAL.System.Log.BusinessObject> invokedBussinessObjects)
        {
            if (invokedBussinessObjects == null || invokedBussinessObjects.Count == 0)
            {
                return;
            }

            CriteriaOperator criteria_0 = CriteriaOperator.Parse("not(IsNull(FinancialTransactionDimId))");
            CriteriaOperator criteria_1 = new InOperator("FinancialTransactionDimId.RefId", invokedBussinessObjects.Select(i => i.RefId));
            CriteriaOperator criteria_2 = new BinaryOperator("RowStatus", 0, BinaryOperatorType.Greater);
            CriteriaOperator criteria   = new GroupOperator(GroupOperatorType.And, criteria_0, criteria_1, criteria_2);
            CorrespondFinancialAccountDim defaultCorrespondAccDim = CorrespondFinancialAccountDim.GetDefault(session, CorrespondFinancialAccountDimEnum.NAAN_DEFAULT);

            XPCollection <GoodsInTransitForSaleDetail> neededToBeFixList = new XPCollection <GoodsInTransitForSaleDetail>(session, criteria);
            GoodsInTransitForSaleSummary_Fact          fact = null;

            if (neededToBeFixList != null && neededToBeFixList.Count > 0)
            {
                foreach (GoodsInTransitForSaleDetail detail in neededToBeFixList)
                {
                    fact             = detail.GoodsInTransitForSaleSummary_FactId;
                    detail.RowStatus = Utility.Constant.ROWSTATUS_DELETED;
                    detail.Save();
                }
            }
        }
 public override void ExtractTransaction(DevExpress.Xpo.Session session)
 {
     base.GetIsRelatedStrategy(session);
     if (IsRelatedStrategy)
     {
         this.fActualPriceTransaction = base.ExtractTransaction(session, TransactionId, ACCOUNT_CODE);
     }
 }
示例#13
0
 public override void ExtractTransaction(DevExpress.Xpo.Session session)
 {
     base.GetIsRelatedStrategy(session);
     if (IsRelatedStrategy)
     {
         this.fFinancialTransactionData = base.ExtractTransaction(session, TransactionId, ACCOUNT_CODE);
     }
 }
 public void GetTotalSummaries(DevExpress.Mvvm.Xpf.GetSummariesAsyncArgs args)
 {
     args.Result = Task.Run(() =>
     {
         using (var session = new DevExpress.Xpo.Session()) {
             return(session.Query <XPOIssues.Issues.Issue>().Where(MakeFilterExpression((DevExpress.Data.Filtering.CriteriaOperator)args.Filter)).GetSummaries(args.Summaries));
         }
     });
 }
示例#15
0
 void OnGetTotalSummaries(System.Object sender, DevExpress.Xpf.Data.GetSummariesAsyncEventArgs e)
 {
     e.Result = Task.Run(() =>
     {
         using (var session = new DevExpress.Xpo.Session()) {
             return(session.Query <XPOIssues.Issues.Issue>().Where(MakeFilterExpression(e.Filter)).GetSummaries(e.Summaries));
         }
     });
 }
示例#16
0
 public abstract void UpdateBillItem(
     DevExpress.Xpo.Session session,
     Guid billItemId,
     Guid itemId,
     Guid unitId,
     double quantity,
     double price,
     double promotionInPercentage,
     string comment);
        public override void ComboBoxItem_ItemRequestedByValue(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemRequestedByValueEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            Item         obj   = session.GetObjectByKey <Item>(e.Value);

            if (obj != null)
            {
                combo.DataSource = new Item[] { obj };
                combo.DataBindItems();
            }
        }
 public void FetchRows(DevExpress.Mvvm.Xpf.FetchRowsAsyncArgs args)
 {
     args.Result = Task.Run <DevExpress.Xpf.Data.FetchRowsResult>(() =>
     {
         using (var session = new DevExpress.Xpo.Session()) {
             var queryable = session.Query <XPOIssues.Issues.Issue>().SortBy(args.SortOrder, defaultUniqueSortPropertyName: nameof(XPOIssues.Issues.Issue.Oid)).Where(MakeFilterExpression((DevExpress.Data.Filtering.CriteriaOperator)args.Filter));
             var items     = queryable.Skip(args.Skip).Take(args.Take ?? 100).ToArray();
             return(DetachedObjectsHelper.ConvertToDetachedObjects(items));
         }
     });
 }
 void OnFetchRows(System.Object sender, DevExpress.Xpf.Data.FetchRowsAsyncEventArgs e)
 {
     e.Result = Task.Run <DevExpress.Xpf.Data.FetchRowsResult>(() =>
     {
         using (var session = new DevExpress.Xpo.Session()) {
             var queryable = session.Query <XPOIssues.Issues.Issue>().SortBy(e.SortOrder, defaultUniqueSortPropertyName: nameof(XPOIssues.Issues.Issue.Oid)).Where(MakeFilterExpression(e.Filter));
             var items     = queryable.Skip(e.Skip).Take(e.Take ?? 100).ToArray();
             return(_DetachedObjectsHelper.ConvertToDetachedObjects(items));
         }
     });
 }
示例#20
0
        private void btnProcessStatements_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            using (ProcessStatementsDialogue dlg = new ProcessStatementsDialogue())
            {
                LayoutControlGrid.Validate();


                using (var uow = new DevExpress.Xpo.Session())
                {
                    XDB.ORG_Company company = null;
                    foreach (XDB.GLX_Account account in this.XPCollection)
                    {
                        switch (IsCustomer)
                        {
                        case true: company = uow.Query <XDB.ORG_Company>().SingleOrDefault(n => n.TypeId.Id == (byte)BL.ORG.ORG_Type.Customer && n.EntityId.EntityId.CodeSub == account.EntityId.CodeSub);
                            break;

                        case false: company = uow.Query <XDB.ORG_Company>().SingleOrDefault(n => n.TypeId.Id == (byte)BL.ORG.ORG_Type.Supplier && n.EntityId.EntityId.CodeSub == account.EntityId.CodeSub);
                            break;
                        }

                        if (account.PrintStatement || account.EmailStatement)
                        {
                            dlg.Statements.Add(new CDS.Client.DataAccessLayer.Types.Statement()
                            {
                                EntityId    = account.EntityId.Id,
                                Code        = account.EntityId.CodeSub,
                                Name        = account.EntityId.Name,
                                Contact     = company.AccountsContactName,
                                Email       = company.AccountsContactEmail,
                                ShouldPrint = account.PrintStatement,
                                ShouldEmail = account.EmailStatement
                            });
                        }
                    }
                }
                dlg.ShowDialog();
            }

            if (StatementTask != null && StatementTask.Status != System.Threading.Tasks.TaskStatus.RanToCompletion)
            {
                Essential.BaseAlert.ShowAlert("Processing statements", "Statements will now be processed in the background.\nClick on \"View Active Processing\" to check progress.", Essential.BaseAlert.Buttons.Ok, Essential.BaseAlert.Icons.Information);
                btnViewActiveProcessing.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
                btnProcessStatements.Visibility    = DevExpress.XtraBars.BarItemVisibility.Never;
                UpdateTimer.Start();
            }
        }
        public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <SalesInvoice> collection = new XPCollection <SalesInvoice>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual),
                new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
示例#22
0
        public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <Organization> collection = new XPCollection <Organization>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            //Get CUSTOMER trading type
            TradingCategory customerTradingCategory =
                session.FindObject <TradingCategory>(new BinaryOperator("Code", "CUSTOMER"));

            CriteriaOperator criteria = CriteriaOperator.And(
                //row status is active
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    ),
                //find customer and supplier
                new ContainsOperator("OrganizationCategories",
                                     CriteriaOperator.And(
                                         new BinaryOperator("TradingCategoryId", customerTradingCategory),
                                         new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE)
                                         )
                                     )
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
示例#23
0
 public override Bill InitTemporary(DevExpress.Xpo.Session session, BillTypeEnum billType)
 {
     try
     {
         NAS.DAL.Invoice.SalesInvoice ret = null;
         ret = new DAL.Invoice.SalesInvoice(session)
         {
             BillId                   = Guid.NewGuid(),
             RowStatus                = Utility.Constant.ROWSTATUS_TEMP,
             CreateDate               = DateTime.Now,
             IssuedDate               = DateTime.Now,
             TaxClaimStatus           = Utility.Constant.VAT_NO_DECLARE,
             TaxCalculationType       = Utility.Constant.CALCULATION_TYPE_ON_ITEMS,
             PromotionCalculationType = Utility.Constant.CALCULATION_TYPE_ON_ITEMS,
             BillType                 = (byte)billType
         };
         ret.Save();
         return(ret);
     }
     catch (Exception)
     {
         throw;
     }
 }
        public override void ItemsRequestedByFilterCondition(DevExpress.Xpo.Session session, object source, DevExpress.Web.ASPxEditors.ListEditItemsRequestedByFilterConditionEventArgs e)
        {
            ASPxComboBox combo = source as ASPxComboBox;
            XPCollection <Organization> collection = new XPCollection <Organization>(session);

            collection.SkipReturnedObjects = e.BeginIndex;
            collection.TopReturnedObjects  = e.EndIndex - e.BeginIndex + 1;

            OrganizationType subOrgOrganizationType =
                Util.getXPCollection <OrganizationType>(session, "Name",
                                                        OrganizationTypeConstant.NAAN_CUSTOMER_SUB_ORGANIZATION.Value).FirstOrDefault();

            CriteriaOperator criteria = CriteriaOperator.And(
                CriteriaOperator.Or(
                    new BinaryOperator("OrganizationId", Utility.CurrentSession.Instance.AccessingOrganizationId),
                    //CriteriaOperator.And(
                    //new BinaryOperator("ParentOrganizationId!Key", Utility.CurrentSession.Instance.AccessingOrganizationId),
                    new BinaryOperator("OrganizationTypeId", subOrgOrganizationType)
                    //)
                    ),
                //row status is active
                new BinaryOperator("RowStatus", Utility.Constant.ROWSTATUS_ACTIVE),
                CriteriaOperator.Or(
                    //find code contains the filter
                    new BinaryOperator("Code", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like),
                    //find name contains the filter
                    new BinaryOperator("Name", String.Format("%{0}%", e.Filter), BinaryOperatorType.Like)
                    )
                );

            collection.Criteria = criteria;
            collection.Sorting.Add(new SortProperty("Code", DevExpress.Xpo.DB.SortingDirection.Ascending));

            combo.DataSource = collection;
            combo.DataBindItems();
        }
        protected XPDataView AtualizarGrid()
        {
            Control.UsuariosControle ctrlUsu = new Control.UsuariosControle();

            string usuarioDefault = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();

            Control.PerfilCtrl perfil = new Control.PerfilCtrl();

            bool perfilConsultaGeral = perfil.getPermissaoConsultaProcessos(usuarioDefault);

            perfil = null;

            string dataIni = string.Empty;
            string dataFim = string.Empty;
            string envolvido = string.Empty;
            string procNum = string.Empty;
            string undorca = string.Empty;

            string sqlTable = "select " +
                                "CTRCOD," +
                                "CTRNUMERO," +
                                "CTRPESSOA," +
                                "CTRCONTROLEPORUO," +
                                "PESNOME," +
                                "UO," +
                                "adcobjeto ," +
                                "adcinicio," +
                                "adcfinal," +
                                "licnumero," +
                                "liccod," +
                                "MODALIDADE," +
                                "IDMODALIDADE, " +
                                "VALORCONTRATO, " +
                                "SALDOCONTRATO, " +
                                "SITUACAOADITIVOS " +
                                "from VW_FLX_CONTRATOS ";

            if (dtCadastroIni.Value != null)
            {
                dataIni = "'" + DateTime.Parse(dtCadastroIni.Value.ToString()).ToShortDateString().Replace("/", ".") + "' ";
            }
            else
            {
                dataIni = "ADCINICIO";
            }

            if (dtCadastroFim.Value != null)
            {
                dataFim = "'" + DateTime.Parse(dtCadastroFim.Value.ToString()).ToShortDateString().Replace("/", ".") + "' ";
            }
            else
            {
                dataFim = "ADCFINAL";
            }

            if (cbbEnvolvido.Value != null)
            {
                envolvido = cbbEnvolvido.Value.ToString();
            }
            else
            {
                envolvido = "CTRPESSOA ";
            }

            if (txtNumProcesso.Value != null)
            {
                procNum = " like '" + txtNumProcesso.Value.ToString() + "%'";
            }
            else
            {
                procNum = " = CTRNUMERO ";
            }

            if (cbbUndOrc.Value != null)
            {
                undorca = "= '" + cbbUndOrc.Value.ToString() + "' ";
            }
            else
            {

                if (!perfilConsultaGeral)
                {
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(usuarioDefault).ToString();
                    string undOrcCad = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;

                    undorca = "in (    SELECT UO.undunificado " +
                        "    FROM unidadeorcamentaria UO " +
                        "    JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "    WHERE " +
                        "    uog.uogunidadegestora = " +
                        "    (SELECT UOG.uogunidadegestora " +
                        "        FROM unidadeorcamentaria UO " +
                        "        JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "        where uo.undunificado = '" + undOrcCad + "' " +
                        "    ) ) ";
                }
                else
                {
                    undorca = "= UO ";
                }
            }

            ////usuarioEnvio = "USUARIOENVIO";

            sqlTable += " WHERE ";
            sqlTable += " (";
            sqlTable += " (ADCFINAL >= " + dataFim + ") ";
            sqlTable += " AND ";
            sqlTable += " (ADCINICIO <= " + dataIni + ")";
            sqlTable += " ) ";
            sqlTable += " AND ";
            sqlTable += " CTRPESSOA = " + envolvido;
            sqlTable += " AND ";
            sqlTable += " CTRNUMERO " + procNum;
            sqlTable += " AND ";
            sqlTable += " UO " + undorca;

            DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
            XpoDataSource1.Session = xpoSession;

            XpoDataSource1.Session.Connection = Persist.GetConn.getConn();

            var resultSet = xpoSession.ExecuteQuery(sqlTable);
            var dv = new XPDataView();

            dv.AddProperty("CTRCOD", typeof(int));
            dv.AddProperty("CTRNUMERO", typeof(string));
            dv.AddProperty("CTRPESSOA", typeof(DateTime));
            dv.AddProperty("CTRCONTROLEPORUO", typeof(string));
            dv.AddProperty("PESNOME", typeof(string));
            dv.AddProperty("UO", typeof(int));
            dv.AddProperty("ADCOBJETO", typeof(string));
            dv.AddProperty("ADCINICIO", typeof(string));
            dv.AddProperty("ADCFINAL", typeof(string));
            dv.AddProperty("LICNUMERO", typeof(int));
            dv.AddProperty("LICCOD", typeof(int));
            dv.AddProperty("MODALIDADE", typeof(decimal));
            dv.AddProperty("IDMODALIDADE", typeof(decimal));
            dv.AddProperty("VALORCONTRATO", typeof(decimal));
            dv.AddProperty("SALDOCONTRATO", typeof(decimal));
            dv.AddProperty("SITUACAOADITIVOS", typeof(string));

            dv.LoadData(resultSet);

            ASPxGridView1.DataSource = dv;
            Session["DTable"] = dv;
            ASPxGridView1.DataBind();

            return dv;
        }
示例#26
0
 public Employee(DevExpress.Xpo.Session session) : base(session)
 {
 }
示例#27
0
 public Directorate(DevExpress.Xpo.Session session)
     : base(session)
 {
 }
 public override void LoadTransaction(DevExpress.Xpo.Session session)
 {
     base.LoadFinancialActualPriceDetail(session, this.fDetailAfterTransformData);
 }
示例#29
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmCourseBrw));
     this.persistentRepository1 = new DevExpress.XtraEditors.Repository.PersistentRepository(this.components);
     this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
     this.pnl_Find = new System.Windows.Forms.Panel();
     this.panel1 = new System.Windows.Forms.Panel();
     this.pictureBox1 = new System.Windows.Forms.PictureBox();
     this.txtSearch = new System.Windows.Forms.TextBox();
     this.chk_Anywhere = new System.Windows.Forms.CheckBox();
     this.btn_Clear = new System.Windows.Forms.Button();
     this.btn_Find = new System.Windows.Forms.Button();
     this.lbl_Find = new System.Windows.Forms.Label();
     this.chk_AdvanceSearch = new System.Windows.Forms.CheckBox();
     this.pnlBody = new System.Windows.Forms.Panel();
     this.pnl_SpeedSearch = new System.Windows.Forms.Panel();
     this.pnl_SpeedSearch1 = new System.Windows.Forms.Panel();
     this.txt_SpeedSearch = new System.Windows.Forms.TextBox();
     this.label1 = new System.Windows.Forms.Label();
     this.grdCourse = new DevExpress.XtraGrid.GridControl();
     this.xpServerCollectionSource1 = new DevExpress.Xpo.XPServerCollectionSource();
     this.session1 = new DevExpress.Xpo.Session();
     this.gvwCourse = new DevExpress.XtraGrid.Views.Grid.GridView();
     this.gcolCourseId = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gColName = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolPhonetic = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolNameRomaji = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolCourseType = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gColProgram = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolClient = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolDept = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolEventDateTime = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolEndDateTime = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolNumberStudents = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolHomeWorkMinutes = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolTestIniEventID = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gColTestMidEventID = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gColTestFinalEventID = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolTestIniForm = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gColTestMidForm = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolTestFinalForm = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolCurriculam = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolStatus = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolDescription = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolDateLastLogin = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolDateCreated = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolLastModified = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolLastModifiedByUser = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolEventId = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolOccurrenceCount = new DevExpress.XtraGrid.Columns.GridColumn();
     this.gcolScheduledInstructor = new DevExpress.XtraGrid.Columns.GridColumn();
     this.repositoryItemTimeEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit();
     this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
     this.repositoryItemTimeEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTimeEdit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
     this.pnl_Find.SuspendLayout();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     this.pnlBody.SuspendLayout();
     this.pnl_SpeedSearch.SuspendLayout();
     this.pnl_SpeedSearch1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.grdCourse)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.xpServerCollectionSource1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.session1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gvwCourse)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit2)).BeginInit();
     this.SuspendLayout();
     //
     // persistentRepository1
     //
     this.persistentRepository1.Items.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.repositoryItemTextEdit1});
     //
     // repositoryItemTextEdit1
     //
     this.repositoryItemTextEdit1.AllowFocused = false;
     this.repositoryItemTextEdit1.AutoHeight = false;
     this.repositoryItemTextEdit1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
     this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
     //
     // pnl_Find
     //
     this.pnl_Find.BackColor = System.Drawing.SystemColors.Window;
     this.pnl_Find.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
     this.pnl_Find.Controls.Add(this.panel1);
     this.pnl_Find.Controls.Add(this.txtSearch);
     this.pnl_Find.Controls.Add(this.chk_Anywhere);
     this.pnl_Find.Controls.Add(this.btn_Clear);
     this.pnl_Find.Controls.Add(this.btn_Find);
     this.pnl_Find.Controls.Add(this.lbl_Find);
     this.pnl_Find.Controls.Add(this.chk_AdvanceSearch);
     this.pnl_Find.Dock = System.Windows.Forms.DockStyle.Top;
     this.pnl_Find.Location = new System.Drawing.Point(0, 0);
     this.pnl_Find.Name = "pnl_Find";
     this.pnl_Find.Size = new System.Drawing.Size(672, 129);
     this.pnl_Find.TabIndex = 28;
     //
     // panel1
     //
     this.panel1.Controls.Add(this.pictureBox1);
     this.panel1.Dock = System.Windows.Forms.DockStyle.Right;
     this.panel1.Location = new System.Drawing.Point(386, 0);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(282, 125);
     this.panel1.TabIndex = 10;
     //
     // pictureBox1
     //
     this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
     this.pictureBox1.Location = new System.Drawing.Point(0, 0);
     this.pictureBox1.Name = "pictureBox1";
     this.pictureBox1.Size = new System.Drawing.Size(282, 125);
     this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex = 0;
     this.pictureBox1.TabStop = false;
     //
     // txtSearch
     //
     this.txtSearch.Location = new System.Drawing.Point(102, 24);
     this.txtSearch.Name = "txtSearch";
     this.txtSearch.Size = new System.Drawing.Size(474, 27);
     this.txtSearch.TabIndex = 9;
     this.txtSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSearch_KeyDown);
     //
     // chk_Anywhere
     //
     this.chk_Anywhere.BackColor = System.Drawing.SystemColors.Window;
     this.chk_Anywhere.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.chk_Anywhere.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.chk_Anywhere.Location = new System.Drawing.Point(336, 63);
     this.chk_Anywhere.Name = "chk_Anywhere";
     this.chk_Anywhere.RightToLeft = System.Windows.Forms.RightToLeft.No;
     this.chk_Anywhere.Size = new System.Drawing.Size(246, 34);
     this.chk_Anywhere.TabIndex = 7;
     this.chk_Anywhere.Text = "Search Anywhere in Fields";
     this.chk_Anywhere.UseVisualStyleBackColor = false;
     //
     // btn_Clear
     //
     this.btn_Clear.BackColor = System.Drawing.SystemColors.Control;
     this.btn_Clear.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btn_Clear.Location = new System.Drawing.Point(592, 63);
     this.btn_Clear.Name = "btn_Clear";
     this.btn_Clear.Size = new System.Drawing.Size(120, 33);
     this.btn_Clear.TabIndex = 6;
     this.btn_Clear.Text = "Clear";
     this.btn_Clear.UseVisualStyleBackColor = false;
     this.btn_Clear.Click += new System.EventHandler(this.btn_Clear_Click);
     //
     // btn_Find
     //
     this.btn_Find.BackColor = System.Drawing.SystemColors.Control;
     this.btn_Find.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btn_Find.Location = new System.Drawing.Point(592, 21);
     this.btn_Find.Name = "btn_Find";
     this.btn_Find.Size = new System.Drawing.Size(120, 33);
     this.btn_Find.TabIndex = 4;
     this.btn_Find.Text = "Find";
     this.btn_Find.UseVisualStyleBackColor = false;
     this.btn_Find.Click += new System.EventHandler(this.btn_Find_Click);
     //
     // lbl_Find
     //
     this.lbl_Find.AutoSize = true;
     this.lbl_Find.Location = new System.Drawing.Point(24, 27);
     this.lbl_Find.Name = "lbl_Find";
     this.lbl_Find.Size = new System.Drawing.Size(46, 21);
     this.lbl_Find.TabIndex = 0;
     this.lbl_Find.Text = " Find";
     //
     // chk_AdvanceSearch
     //
     this.chk_AdvanceSearch.BackColor = System.Drawing.SystemColors.Window;
     this.chk_AdvanceSearch.Checked = true;
     this.chk_AdvanceSearch.CheckState = System.Windows.Forms.CheckState.Checked;
     this.chk_AdvanceSearch.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.chk_AdvanceSearch.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.chk_AdvanceSearch.Location = new System.Drawing.Point(102, 63);
     this.chk_AdvanceSearch.Name = "chk_AdvanceSearch";
     this.chk_AdvanceSearch.RightToLeft = System.Windows.Forms.RightToLeft.No;
     this.chk_AdvanceSearch.Size = new System.Drawing.Size(180, 34);
     this.chk_AdvanceSearch.TabIndex = 8;
     this.chk_AdvanceSearch.Text = "Search All Fields";
     this.chk_AdvanceSearch.UseVisualStyleBackColor = false;
     //
     // pnlBody
     //
     this.pnlBody.Controls.Add(this.pnl_SpeedSearch);
     this.pnlBody.Controls.Add(this.grdCourse);
     this.pnlBody.Controls.Add(this.pnl_Find);
     this.pnlBody.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pnlBody.Location = new System.Drawing.Point(0, 0);
     this.pnlBody.Name = "pnlBody";
     this.pnlBody.Size = new System.Drawing.Size(672, 357);
     this.pnlBody.TabIndex = 29;
     this.pnlBody.Resize += new System.EventHandler(this.pnlBody_Resize);
     //
     // pnl_SpeedSearch
     //
     this.pnl_SpeedSearch.BackColor = System.Drawing.Color.Black;
     this.pnl_SpeedSearch.Controls.Add(this.pnl_SpeedSearch1);
     this.pnl_SpeedSearch.Location = new System.Drawing.Point(64, 309);
     this.pnl_SpeedSearch.Name = "pnl_SpeedSearch";
     this.pnl_SpeedSearch.Size = new System.Drawing.Size(307, 102);
     this.pnl_SpeedSearch.TabIndex = 42;
     this.pnl_SpeedSearch.Visible = false;
     //
     // pnl_SpeedSearch1
     //
     this.pnl_SpeedSearch1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(38)))), ((int)(((byte)(143)))), ((int)(((byte)(230)))));
     this.pnl_SpeedSearch1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.pnl_SpeedSearch1.Controls.Add(this.txt_SpeedSearch);
     this.pnl_SpeedSearch1.Controls.Add(this.label1);
     this.pnl_SpeedSearch1.Location = new System.Drawing.Point(6, 6);
     this.pnl_SpeedSearch1.Name = "pnl_SpeedSearch1";
     this.pnl_SpeedSearch1.Size = new System.Drawing.Size(295, 91);
     this.pnl_SpeedSearch1.TabIndex = 39;
     //
     // txt_SpeedSearch
     //
     this.txt_SpeedSearch.Location = new System.Drawing.Point(18, 41);
     this.txt_SpeedSearch.Name = "txt_SpeedSearch";
     this.txt_SpeedSearch.Size = new System.Drawing.Size(251, 27);
     this.txt_SpeedSearch.TabIndex = 10;
     this.txt_SpeedSearch.TextChanged += new System.EventHandler(this.txt_SpeedSearch_TextChanged);
     this.txt_SpeedSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txt_SpeedSearch_KeyDown);
     this.txt_SpeedSearch.Leave += new System.EventHandler(this.txt_SpeedSearch_Leave);
     this.txt_SpeedSearch.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txt_SpeedSearch_KeyUp);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.White;
     this.label1.Location = new System.Drawing.Point(90, 6);
     this.label1.Name = "label1";
     this.label1.Size = new System.Drawing.Size(103, 19);
     this.label1.TabIndex = 0;
     this.label1.Text = "Fast Search";
     //
     // grdCourse
     //
     this.grdCourse.DataSource = this.xpServerCollectionSource1;
     this.grdCourse.Dock = System.Windows.Forms.DockStyle.Fill;
     this.grdCourse.ExternalRepository = this.persistentRepository1;
     this.grdCourse.Location = new System.Drawing.Point(0, 129);
     this.grdCourse.MainView = this.gvwCourse;
     this.grdCourse.Name = "grdCourse";
     this.grdCourse.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
     this.repositoryItemTimeEdit1,
     this.repositoryItemButtonEdit1,
     this.repositoryItemTimeEdit2});
     this.grdCourse.ServerMode = true;
     this.grdCourse.Size = new System.Drawing.Size(672, 228);
     this.grdCourse.TabIndex = 26;
     this.grdCourse.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
     this.gvwCourse});
     this.grdCourse.DoubleClick += new System.EventHandler(this.grdCourse_DoubleClick);
     this.grdCourse.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.grdCourse_KeyPress);
     //
     // xpServerCollectionSource1
     //
     this.xpServerCollectionSource1.ObjectType = typeof(Scheduler.BusinessLayer.CoursePO);
     this.xpServerCollectionSource1.Session = this.session1;
     //
     // gvwCourse
     //
     this.gvwCourse.ActiveFilterString = "[CourseStatus] = \'Active\'";
     this.gvwCourse.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Style3D;
     this.gvwCourse.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
     this.gcolCourseId,
     this.gColName,
     this.gcolPhonetic,
     this.gcolNameRomaji,
     this.gcolCourseType,
     this.gColProgram,
     this.gcolClient,
     this.gcolDept,
     this.gcolEventDateTime,
     this.gcolEndDateTime,
     this.gcolNumberStudents,
     this.gcolHomeWorkMinutes,
     this.gcolTestIniEventID,
     this.gColTestMidEventID,
     this.gColTestFinalEventID,
     this.gcolTestIniForm,
     this.gColTestMidForm,
     this.gcolTestFinalForm,
     this.gcolCurriculam,
     this.gcolStatus,
     this.gcolDescription,
     this.gcolDateLastLogin,
     this.gcolDateCreated,
     this.gcolLastModified,
     this.gcolLastModifiedByUser,
     this.gcolEventId,
     this.gcolOccurrenceCount,
     this.gcolScheduledInstructor});
     this.gvwCourse.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
     this.gvwCourse.GridControl = this.grdCourse;
     this.gvwCourse.Name = "gvwCourse";
     this.gvwCourse.OptionsBehavior.Editable = false;
     this.gvwCourse.OptionsBehavior.KeepGroupExpandedOnSorting = false;
     this.gvwCourse.OptionsNavigation.AutoMoveRowFocus = false;
     this.gvwCourse.OptionsView.ShowDetailButtons = false;
     this.gvwCourse.OptionsView.ShowGroupPanel = false;
     this.gvwCourse.OptionsView.ShowHorzLines = false;
     this.gvwCourse.OptionsView.ShowIndicator = false;
     this.gvwCourse.SortInfo.AddRange(new DevExpress.XtraGrid.Columns.GridColumnSortInfo[] {
     new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gcolClient, DevExpress.Data.ColumnSortOrder.Ascending),
     new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gColName, DevExpress.Data.ColumnSortOrder.Ascending),
     new DevExpress.XtraGrid.Columns.GridColumnSortInfo(this.gcolEventDateTime, DevExpress.Data.ColumnSortOrder.Ascending)});
     //
     // gcolCourseId
     //
     this.gcolCourseId.Caption = "Course Id";
     this.gcolCourseId.FieldName = "CourseId";
     this.gcolCourseId.Name = "gcolCourseId";
     //
     // gColName
     //
     this.gColName.Caption = "Class Name";
     this.gColName.FieldName = "BrowseName";
     this.gColName.Name = "gColName";
     this.gColName.Visible = true;
     this.gColName.VisibleIndex = 3;
     this.gColName.Width = 203;
     //
     // gcolPhonetic
     //
     this.gcolPhonetic.Caption = "Name Phonetic";
     this.gcolPhonetic.FieldName = "NamePhonetic";
     this.gcolPhonetic.Name = "gcolPhonetic";
     this.gcolPhonetic.Width = 78;
     //
     // gcolNameRomaji
     //
     this.gcolNameRomaji.Caption = "Name Romaji";
     this.gcolNameRomaji.FieldName = "NameRomaji";
     this.gcolNameRomaji.Name = "gcolNameRomaji";
     this.gcolNameRomaji.Width = 78;
     //
     // gcolCourseType
     //
     this.gcolCourseType.Caption = "Type";
     this.gcolCourseType.FieldName = "CourseType";
     this.gcolCourseType.Name = "gcolCourseType";
     this.gcolCourseType.Width = 60;
     //
     // gColProgram
     //
     this.gColProgram.Caption = "Program Name";
     this.gColProgram.FieldName = "Program";
     this.gColProgram.Name = "gColProgram";
     this.gColProgram.Visible = true;
     this.gColProgram.VisibleIndex = 2;
     this.gColProgram.Width = 203;
     //
     // gcolClient
     //
     this.gcolClient.Caption = "Client Name";
     this.gcolClient.FieldName = "Client";
     this.gcolClient.Name = "gcolClient";
     this.gcolClient.Visible = true;
     this.gcolClient.VisibleIndex = 0;
     this.gcolClient.Width = 223;
     //
     // gcolDept
     //
     this.gcolDept.Caption = "Department Name";
     this.gcolDept.FieldName = "Department";
     this.gcolDept.Name = "gcolDept";
     this.gcolDept.Visible = true;
     this.gcolDept.VisibleIndex = 1;
     this.gcolDept.Width = 208;
     //
     // gcolEventDateTime
     //
     this.gcolEventDateTime.Caption = "Event Start Date";
     this.gcolEventDateTime.DisplayFormat.FormatString = "MM/dd/yyyy HH:mm";
     this.gcolEventDateTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.gcolEventDateTime.FieldName = "EventStartDateTime";
     this.gcolEventDateTime.Name = "gcolEventDateTime";
     this.gcolEventDateTime.Visible = true;
     this.gcolEventDateTime.VisibleIndex = 4;
     this.gcolEventDateTime.Width = 160;
     //
     // gcolEndDateTime
     //
     this.gcolEndDateTime.Caption = "Event End Date";
     this.gcolEndDateTime.DisplayFormat.FormatString = "MM/dd/yyyy HH:mm";
     this.gcolEndDateTime.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.gcolEndDateTime.FieldName = "EventEndDateTime";
     this.gcolEndDateTime.Name = "gcolEndDateTime";
     this.gcolEndDateTime.Visible = true;
     this.gcolEndDateTime.VisibleIndex = 5;
     this.gcolEndDateTime.Width = 160;
     //
     // gcolNumberStudents
     //
     this.gcolNumberStudents.Caption = "No. Students";
     this.gcolNumberStudents.FieldName = "NumberStudents";
     this.gcolNumberStudents.Name = "gcolNumberStudents";
     //
     // gcolHomeWorkMinutes
     //
     this.gcolHomeWorkMinutes.Caption = "Homework Mints.";
     this.gcolHomeWorkMinutes.FieldName = "HomeWorkMinutes";
     this.gcolHomeWorkMinutes.Name = "gcolHomeWorkMinutes";
     this.gcolHomeWorkMinutes.Width = 76;
     //
     // gcolTestIniEventID
     //
     this.gcolTestIniEventID.Caption = "Initial EventID";
     this.gcolTestIniEventID.FieldName = "TestInitialEventID";
     this.gcolTestIniEventID.Name = "gcolTestIniEventID";
     //
     // gColTestMidEventID
     //
     this.gColTestMidEventID.Caption = "Mid-term EventID";
     this.gColTestMidEventID.FieldName = "TestMidTermEventID";
     this.gColTestMidEventID.Name = "gColTestMidEventID";
     //
     // gColTestFinalEventID
     //
     this.gColTestFinalEventID.Caption = "Final EventID";
     this.gColTestFinalEventID.FieldName = "TestFinalEventID";
     this.gColTestFinalEventID.Name = "gColTestFinalEventID";
     //
     // gcolTestIniForm
     //
     this.gcolTestIniForm.Caption = "Initial Form";
     this.gcolTestIniForm.FieldName = "TestInitialForm";
     this.gcolTestIniForm.Name = "gcolTestIniForm";
     //
     // gColTestMidForm
     //
     this.gColTestMidForm.Caption = "Mid-term Form";
     this.gColTestMidForm.FieldName = "TestMidTermForm";
     this.gColTestMidForm.Name = "gColTestMidForm";
     //
     // gcolTestFinalForm
     //
     this.gcolTestFinalForm.Caption = "Final Form";
     this.gcolTestFinalForm.FieldName = "TestFinalForm";
     this.gcolTestFinalForm.Name = "gcolTestFinalForm";
     //
     // gcolCurriculam
     //
     this.gcolCurriculam.Caption = "Curriculam";
     this.gcolCurriculam.FieldName = "Curriculam";
     this.gcolCurriculam.Name = "gcolCurriculam";
     this.gcolCurriculam.Width = 44;
     //
     // gcolStatus
     //
     this.gcolStatus.Caption = "Status";
     this.gcolStatus.FieldName = "CourseStatus";
     this.gcolStatus.Name = "gcolStatus";
     this.gcolStatus.Visible = true;
     this.gcolStatus.VisibleIndex = 7;
     this.gcolStatus.Width = 183;
     //
     // gcolDescription
     //
     this.gcolDescription.Caption = "Description";
     this.gcolDescription.FieldName = "Description";
     this.gcolDescription.Name = "gcolDescription";
     this.gcolDescription.Width = 102;
     //
     // gcolDateLastLogin
     //
     this.gcolDateLastLogin.Caption = "Date Last Login";
     this.gcolDateLastLogin.FieldName = "DatelastLogin";
     this.gcolDateLastLogin.Name = "gcolDateLastLogin";
     //
     // gcolDateCreated
     //
     this.gcolDateCreated.Caption = "Date Created";
     this.gcolDateCreated.FieldName = "DateCreated";
     this.gcolDateCreated.Name = "gcolDateCreated";
     //
     // gcolLastModified
     //
     this.gcolLastModified.Caption = "Date Last Modified";
     this.gcolLastModified.FieldName = "DateLastModified";
     this.gcolLastModified.Name = "gcolLastModified";
     //
     // gcolLastModifiedByUser
     //
     this.gcolLastModifiedByUser.Caption = "Last Modified User ID";
     this.gcolLastModifiedByUser.FieldName = "LastModifiedByUserID";
     this.gcolLastModifiedByUser.Name = "gcolLastModifiedByUser";
     //
     // gcolEventId
     //
     this.gcolEventId.Caption = "EventId";
     this.gcolEventId.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
     this.gcolEventId.FieldName = "EventID";
     this.gcolEventId.Name = "gcolEventId";
     //
     // gcolOccurrenceCount
     //
     this.gcolOccurrenceCount.Caption = "Occured / Total";
     this.gcolOccurrenceCount.FieldName = "OccurrenceCount";
     this.gcolOccurrenceCount.Name = "gcolOccurrenceCount";
     this.gcolOccurrenceCount.Visible = true;
     this.gcolOccurrenceCount.VisibleIndex = 8;
     this.gcolOccurrenceCount.Width = 224;
     //
     // gcolScheduledInstructor
     //
     this.gcolScheduledInstructor.Caption = "Scheduled Instructor";
     this.gcolScheduledInstructor.FieldName = "ScheduledInstructor";
     this.gcolScheduledInstructor.Name = "gcolScheduledInstructor";
     this.gcolScheduledInstructor.Visible = true;
     this.gcolScheduledInstructor.VisibleIndex = 6;
     this.gcolScheduledInstructor.Width = 183;
     //
     // repositoryItemTimeEdit1
     //
     this.repositoryItemTimeEdit1.AutoHeight = false;
     this.repositoryItemTimeEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton()});
     this.repositoryItemTimeEdit1.DisplayFormat.FormatString = "hh:mm:ss tt";
     this.repositoryItemTimeEdit1.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.repositoryItemTimeEdit1.Mask.EditMask = "hh:mm:ss tt";
     this.repositoryItemTimeEdit1.Name = "repositoryItemTimeEdit1";
     //
     // repositoryItemButtonEdit1
     //
     this.repositoryItemButtonEdit1.AutoHeight = false;
     this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton()});
     this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1";
     //
     // repositoryItemTimeEdit2
     //
     this.repositoryItemTimeEdit2.AutoHeight = false;
     this.repositoryItemTimeEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
     new DevExpress.XtraEditors.Controls.EditorButton()});
     this.repositoryItemTimeEdit2.DisplayFormat.FormatString = "MM/dd/yyyy HH:mm";
     this.repositoryItemTimeEdit2.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
     this.repositoryItemTimeEdit2.Mask.EditMask = "MM/dd/yyyy HH:mm";
     this.repositoryItemTimeEdit2.Name = "repositoryItemTimeEdit2";
     //
     // frmCourseBrw
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(8, 20);
     this.ClientSize = new System.Drawing.Size(672, 357);
     this.Controls.Add(this.pnlBody);
     this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Name = "frmCourseBrw";
     this.ShowInTaskbar = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "`";
     this.Load += new System.EventHandler(this.frmCourseBrw_Load);
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
     this.pnl_Find.ResumeLayout(false);
     this.pnl_Find.PerformLayout();
     this.panel1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     this.pnlBody.ResumeLayout(false);
     this.pnl_SpeedSearch.ResumeLayout(false);
     this.pnl_SpeedSearch1.ResumeLayout(false);
     this.pnl_SpeedSearch1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.grdCourse)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.xpServerCollectionSource1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.session1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gvwCourse)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTimeEdit2)).EndInit();
     this.ResumeLayout(false);
 }
示例#30
0
 protected void Page_Init(object sender, EventArgs e)
 {
     XpoSession             = XpoHelper.GetNewSessionINTF();
     XpoDataSource1.Session = XpoSession;
 }
示例#31
0
        protected XPDataView AtualizarGrid()
        {
            Control.UsuariosControle ctrlUsu = new Control.UsuariosControle();
            string dataCadINI = "";
            string dataCadFIM = "";
            string envolvido = "";
            string procNum = "";
            string undorca = "";
            string situacao = "";
            string usuarioEnvio = "";
            string assunto = "";
            string usuarioDefault = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();

            Control.PerfilCtrl perfil = new Control.PerfilCtrl();

            bool perfilConsultaGeral = perfil.getPermissaoConsultaProcessos(usuarioDefault);

            perfil = null;

            string sqlTable = "select " +
                                "id," +
                                "NUMERO," +
                                "datahoracadastro," +
                                "responsavel," +
                                "nome," +
                                "ENVID," +
                                "descricao," +
                                "UNDABREV ," +
                                "unidfuncnome," +
                                "undunificado," +
                                "usuarioenvio," +
                                "Cast(valor as numeric(15,2)) valor," +
                                "cast(VAL_LIQUIDADO as numeric(15,2)) VAL_LIQUIDADO," +
                                "CENNOME," +
                                "SITUACAO_ATUAL " +
                                "from CONSULTA_PROCESSOS ";

            if (dtCadastroIni.Value != null)
            {
                dataCadINI = "'" + DateTime.Parse(dtCadastroIni.Value.ToString()).ToShortDateString().Replace("/", ".") + "' ";
            }
            else
            {
                dataCadINI = "DATAHORACADASTRO";
            }

            if (dtCadastroFim.Value != null)
            {
                dataCadFIM = "'" + DateTime.Parse(dtCadastroFim.Value.ToString()).ToShortDateString().Replace("/", ".") + "' ";
            }
            else
            {
                dataCadFIM = "DATAHORACADASTRO";
            }

            if (cbbEnvolvido.Value != null)
            {
                envolvido = cbbEnvolvido.Value.ToString();
            }
            else
            {
                envolvido = "ENVID ";
            }

            if (txtNumProcesso.Value != null)
            {
                procNum = " like '" + txtNumProcesso.Value.ToString() + "%'";
            }
            else
            {
                procNum = " = NUMERO ";
            }

            if (cbbUndOrc.Value != null)
            {
                undorca = "= '" + cbbUndOrc.Value.ToString() + "' ";
            }
            else
            {

                if (!perfilConsultaGeral)
                {
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(usuarioDefault).ToString();
                    string undOrcCad = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;

                    undorca = "in (    SELECT UO.undunificado " +
                        "    FROM unidadeorcamentaria UO " +
                        "    JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "    WHERE " +
                        "    uog.uogunidadegestora = " +
                        "    (SELECT UOG.uogunidadegestora " +
                        "        FROM unidadeorcamentaria UO " +
                        "        JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "        where uo.undunificado = '" + undOrcCad + "' " +
                        "    ) ) ";
                }
                else {
                    undorca = "= UNDUNIFICADO ";
                }
            }

            if (cbbAssunto.Value != null)
            {
                assunto =  cbbAssunto.Value.ToString() ;
            }
            else
            {
                assunto = "ASSID ";
            }

            string idSituacao = string.Empty;

            if (cbbSituacao.Value != null)
            {
                situacao = cbbSituacao.Value.ToString();
            }

            //usuarioEnvio = "USUARIOENVIO";

            sqlTable += " WHERE ";
            sqlTable += " (";
            sqlTable += " (DATAHORACADASTRO >= " + dataCadINI + ") ";
            sqlTable += " AND ";
            sqlTable += " (DATAHORACADASTRO <= " + dataCadFIM + ")";
            sqlTable += " ) ";
            sqlTable += " AND ";
            sqlTable += " ENVID = " + envolvido;
            sqlTable += " AND ";
            sqlTable += " NUMERO " + procNum;
            sqlTable += " AND ";
            //sqlTable += " UNDUNIFICADO = " + undorca;
            sqlTable += " UNDUNIFICADO " + undorca;
            if(cbbSituacao.Value != null){
                //sqlTable += "and (" + situacao + " in (Select idSituacaoProjeto from webtramite where idProcesso = proc.ID)) ";
                sqlTable += "and SITID in (Select sit.id from webgruposituacoes gsit join websituacaoprocesso sit on sit.id_gruposituacao = gsit.id where gsit.id = " + cbbSituacao.Value + ")";
            }
            //sqlTable += " AND ";
            //sqlTable += "USUARIOENVIO = " + usuarioEnvio;
            sqlTable += " AND ASSID = "+ assunto;
            sqlTable += "AND ((EXCLUIR IS NULL AND EXERCICIO <> (SELECT FIRST 1 ENTEXERCICIO FROM ENTIDADE)) ";
            sqlTable += "OR ";
            sqlTable += "(EXERCICIO = (SELECT FIRST 1 ENTEXERCICIO FROM ENTIDADE)))";

            DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
            XpoDataSource1.Session = xpoSession;

            //string connTeste = AcessoDados.AcessoDados.GetConnectionStringXPO();
            XpoDataSource1.Session.Connection = Persist.GetConn.getConn();

            SelectedData resultSet = xpoSession.ExecuteQuery(sqlTable);
            XPDataView dv = new XPDataView();

            dv.AddProperty("ID", typeof(int));
            dv.AddProperty("NUMERO", typeof(string));
            dv.AddProperty("DATAHORACADASTRO", typeof(DateTime));
            dv.AddProperty("RESPONSAVEL", typeof(string));
            dv.AddProperty("NOME", typeof(string));
            dv.AddProperty("ENVID", typeof(int));
            dv.AddProperty("DESCRICAO", typeof(string));
            dv.AddProperty("UNDABREV", typeof(string));
            dv.AddProperty("UNIDFUNCNOME", typeof(string));
            dv.AddProperty("UNDUNIFICADO", typeof(int));
            dv.AddProperty("USUARIOENVIO", typeof(int));
            dv.AddProperty("VALOR", typeof(decimal));
            dv.AddProperty("VAL_LIQUIDADO", typeof(decimal));
            dv.AddProperty("CENNOME", typeof(string));
            dv.AddProperty("SITUACAO_ATUAL", typeof(string));

            dv.LoadData(resultSet);

            ASPxGridView1.DataSource = dv;
            Session["DTable"] = dv;
            ASPxGridView1.DataBind();

            return dv;
        }
示例#32
0
 public MockLookupObject2(DevExpress.Xpo.Session session)
     : base(session)
 {
 }
        protected XPDataView AtualizarGrid()
        {
            UsuariosControle ctrlUsu = new Control.UsuariosControle();

            string usuarioDefault = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();

            PerfilCtrl perfil = new Control.PerfilCtrl();

            bool perfilConsultaGeral = perfil.getPermissaoConsultaProcessos(usuarioDefault);

            perfil = null;

            string centrocusto = string.Empty;
            string undorca = string.Empty;

            string sqlTable = "select distinct " +
                                "CENCOD,"+
                                "CENNOME,"+
                                "FONCOD,"+
                                "FONNOME,"+
                                "UNDUNIFICADO,"+
                                "UNDNOME,"+
                                "CCCMESES,"+
                                "DESPJAN,"+
                                "DESPFEV,"+
                                "DESPMAR,"+
                                "DESPABR,"+
                                "DESPMAI,"+
                                "DESPJUN,"+
                                "DESPJUL,"+
                                "DESPAGO,"+
                                "DESPSET,"+
                                "DESPOUT,"+
                                "DESPNOV,"+
                                "DESPDEZ,"+
                                "DIDJAN,"+
                                "DIDFEV,"+
                                "DIDMAR,"+
                                "DIDABR,"+
                                "DIDMAI,"+
                                "DIDJUN,"+
                                "DIDJUL,"+
                                "DIDAGO,"+
                                "DIDSET,"+
                                "DIDOUT,"+
                                "DIDNOV,"+
                                "DIDDEZ,"+
                                "SALDOJAN,"+
                                "SALDOFEV,"+
                                "SALDOMAR,"+
                                "SALDOABR,"+
                                "SALDOMAI,"+
                                "SALDOJUN,"+
                                "SALDOJUL,"+
                                "SALDOAGO,"+
                                "SALDOSET,"+
                                "SALDOOUT,"+
                                "SALDONOV,"+
                                "SALDODEZ " +
                                "from VW_FLX_REL_EXT_CENCUSTO_GRID ";

            if (cbbCentroCusto.Value != null)
            {
                centrocusto = cbbCentroCusto.Value.ToString();
            }
            else
            {
                centrocusto = "CENCOD ";
            }

            if (cbbUndOrc.Value != null)
            {
                undorca = "= '" + cbbUndOrc.Value.ToString() + "' ";
            }
            else
            {

                if (!perfilConsultaGeral)
                {
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(usuarioDefault).ToString();
                    string undOrcCad = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;

                    undorca = "in (    SELECT UO.undunificado " +
                        "    FROM unidadeorcamentaria UO " +
                        "    JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "    WHERE " +
                        "    uog.uogunidadegestora = " +
                        "    (SELECT UOG.uogunidadegestora " +
                        "        FROM unidadeorcamentaria UO " +
                        "        JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                        "        where uo.undunificado = '" + undOrcCad + "' " +
                        "    ) ) ";
                }
                else
                {
                    undorca = "= UNDUNIFICADO ";
                }
            }

            ////usuarioEnvio = "USUARIOENVIO";

            sqlTable += " WHERE ";
            sqlTable += " CENCOD = " + centrocusto;
            sqlTable += " AND ";
            sqlTable += " UNDUNIFICADO " + undorca;

            DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
            XpoDataSource1.Session = xpoSession;

            XpoDataSource1.Session.Connection = Persist.GetConn.getConn();

            SelectedData resultSet = xpoSession.ExecuteQuery(sqlTable);
            XPDataView dv = new XPDataView();

            dv.AddProperty("CENCOD", typeof(int));
            dv.AddProperty("CENNOME", typeof(string));
            dv.AddProperty("FONCOD", typeof(int));
            dv.AddProperty("FONNOME", typeof(string));
            dv.AddProperty("UNDUNIFICADO", typeof(string));
            dv.AddProperty("UNDNOME", typeof(string));
            dv.AddProperty("CCCMESES", typeof(decimal));
            dv.AddProperty("DESPJAN", typeof(decimal));
            dv.AddProperty("DESPFEV", typeof(decimal));
            dv.AddProperty("DESPMAR", typeof(decimal));
            dv.AddProperty("DESPABR", typeof(decimal));
            dv.AddProperty("DESPMAI", typeof(decimal));
            dv.AddProperty("DESPJUN", typeof(decimal));
            dv.AddProperty("DESPJUL", typeof(decimal));
            dv.AddProperty("DESPAGO", typeof(decimal));
            dv.AddProperty("DESPSET", typeof(decimal));
            dv.AddProperty("DESPOUT", typeof(decimal));
            dv.AddProperty("DESPNOV", typeof(decimal));
            dv.AddProperty("DESPDEZ", typeof(decimal));
            dv.AddProperty("DIDJAN", typeof(decimal));
            dv.AddProperty("DIDFEV", typeof(decimal));
            dv.AddProperty("DIDMAR", typeof(decimal));
            dv.AddProperty("DIDABR", typeof(decimal));
            dv.AddProperty("DIDMAI", typeof(decimal));
            dv.AddProperty("DIDJUN", typeof(decimal));
            dv.AddProperty("DIDJUL", typeof(decimal));
            dv.AddProperty("DIDAGO", typeof(decimal));
            dv.AddProperty("DIDSET", typeof(decimal));
            dv.AddProperty("DIDOUT", typeof(decimal));
            dv.AddProperty("DIDNOV", typeof(decimal));
            dv.AddProperty("DIDDEZ", typeof(decimal));
            dv.AddProperty("SALDOJAN", typeof(decimal));
            dv.AddProperty("SALDOFEV", typeof(decimal));
            dv.AddProperty("SALDOMAR", typeof(decimal));
            dv.AddProperty("SALDOABR", typeof(decimal));
            dv.AddProperty("SALDOMAI", typeof(decimal));
            dv.AddProperty("SALDOJUN", typeof(decimal));
            dv.AddProperty("SALDOJUL", typeof(decimal));
            dv.AddProperty("SALDOAGO", typeof(decimal));
            dv.AddProperty("SALDOSET", typeof(decimal));
            dv.AddProperty("SALDOOUT", typeof(decimal));
            dv.AddProperty("SALDONOV", typeof(decimal));
            dv.AddProperty("SALDODEZ", typeof(decimal));

            dv.LoadData(resultSet);

            ASPxGridView1.DataSource = dv;
            Session["DTable"] = dv;
            ASPxGridView1.DataBind();

            return dv;
        }
示例#34
0
        public void atualizaGridEmpenhos(string tipo)
        {
            string unidOrc = "";
            string empenhoNum = "";
            string dataIni = "";
            string dataFim = "";
            string credor = "";
            string processo = "";

            if (!tipo.Equals("Limpar"))
            {
                bool parametro = Control.Configuracoes.Dados.getParametroGradeDIDComplementar();

                if (cbbUndOrc.Value != null)
                {
                    unidOrc = "'" + cbbUndOrc.Value.ToString() + "'";
                }
                else
                {
                    Control.UsuariosControle ctrlUsu = new Control.UsuariosControle();

                    string idUsu = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(idUsu).ToString();

                    string undOrcCad = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;
                    if (parametro == false)
                    {
                        unidOrc = "    SELECT UO.undunificado " +
                                "    FROM unidadeorcamentaria UO " +
                                "    JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                                "    WHERE " +
                                "    uog.uogunidadegestora = " +
                                "    (SELECT UOG.uogunidadegestora " +
                                "        FROM unidadeorcamentaria UO " +
                                "        JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                                "        where uo.undunificado = '" + undOrcCad + "' " +
                                "    ) ";
                    }
                    else {
                        unidOrc = " select UNDUNIFICADO from SCI_USUARIOS_UNDORC where usu_codigo = " + idUsu + " ";
                    }
                }

                if (txtNumEmpenho.Value != null)
                {
                    empenhoNum = "'" + txtNumEmpenho.Value.ToString() + "'";
                }
                else
                {
                    empenhoNum = "emp.empnumero";
                }

                if (dtCadastroIni.Value != null)
                {
                    dataIni = "'" + dtCadastroIni.Value.ToString().Substring(0, 10) + "'";
                }
                else
                {
                    dataIni = "emp.empdata";
                }

                if (dtCadastroFim.Value != null)
                {
                    dataFim = "'" + dtCadastroFim.Value.ToString().Substring(0, 10) + "'";
                }
                else
                {
                    dataFim = "emp.empdata";
                }

                if (cbbCredor.Value != null)
                {
                    credor = "'" + cbbCredor.Value.ToString() + "'";
                }
                else
                {
                    credor = "emp.emppessoa";
                }

                if ( txtNumProcesso.Value != null)
                {
                    processo = "AND PROC.NUMERO = '" + txtNumProcesso.Value.ToString() + "'";
                }
                else
                {
                    processo = "";
                }

                string sqlTable = "select uo.undunificado, uo.undabrev, emp.empdata, emp.empnumero, emp.emppessoa, " +
                                    "emp.empnomepessoa, emp.empnatureza, (emp.empvalor - coalesce(ema.emavalor, 0)) empvalor, lic.licnumero, lic.licdata,"+
                                    "coalesce(proc.NUMERO,(select numero from webprocesso where id = emp.empsemdid)) NUMERO, " +
                                    "case when emp.empstatus = 'T' then 'NORMAL' else 'Erro' end " +
                                    "empstatus, " +
                                    "case " +
                                    "    when emp.empfundeb = 1 then '1 - Magistério 60%' " +
                                    "    when emp.empfundeb = 2 then '2 - Administrativo 40%' " +
                                    "    when emp.empfundeb = 3 then '3 - MDE - Outros' " +
                                    "    else null " +
                                    "end " +
                                    "empfundeb, EMP.empcod, " +
                                    "CTR.CTRNUMERO, CTR.CTRDATA " +
                                    "from empenho emp " +
                                    "join unidadeorcamentaria uo on uo.undcodorgao = emp.emporgao and uo.undcodigo = emp.empunidade " +
                                    "left join licitacao lic on lic.liccod = emp.emplicitacao " +
                                    "LEFT JOIN CONTRATOS CTR ON CTR.ctrcod = EMP.empcontrato " +
                                    "LEFT JOIN WEBPROCESSO PROC ON PROC.ID = EMP.EMPDID "+
                                    "Left join empenhoanulacao ema on ema.emaempenho = emp.empcod " +
                                    "where uo.undunificado IN (" + unidOrc + ") "+
                                    " and emp.empnumero = " + empenhoNum + " and emp.emppessoa = " + credor +
                                    " and (emp.empdata >= " + dataIni.Replace("/", ".") + " and emp.empdata <= " + dataFim.Replace("/", ".") + ") " +  processo +
                                    " order by emp.empdata desc";

                DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
                XpoDataSource1.Session = xpoSession;

                //string connTeste = AcessoDados.AcessoDados.GetConnectionStringXPO();
                XpoDataSource1.Session.Connection = Persist.GetConn.getConn();
                //XpoDataSource1.Session.ConnectionString = connTeste;

                SelectedData resultSet = xpoSession.ExecuteQuery(sqlTable);
                XPDataView dv = new XPDataView();

                dv.AddProperty("UNDUNIFICADO", typeof(string));
                dv.AddProperty("UNDABREV", typeof(string));
                dv.AddProperty("EMPDATA", typeof(DateTime));
                dv.AddProperty("EMPNUMERO", typeof(string));
                dv.AddProperty("EMPPESSOA", typeof(string));
                dv.AddProperty("EMPNOMEPESSOA", typeof(string));
                dv.AddProperty("EMPNATUREZA", typeof(string));
                dv.AddProperty("EMPVALOR", typeof(double));
                dv.AddProperty("LICNUMERO", typeof(string));
                dv.AddProperty("LICDATA", typeof(DateTime));
                dv.AddProperty("NUMERO", typeof(string));
                dv.AddProperty("EMPSTATUS", typeof(string));
                dv.AddProperty("EMPFUNDEB", typeof(double));
                dv.AddProperty("EMPCOD", typeof(int));
                dv.AddProperty("CTRNUMERO", typeof(string));
                dv.AddProperty("CTRDATA", typeof(DateTime));

                dv.LoadData(resultSet);

                ASPxGridView1.DataSource = dv;
                Session["DTable"] = dv;
                ASPxGridView1.DataBind();

            }
            else {
                ASPxGridView1.DataSourceID = string.Empty;
                ASPxGridView1.DataBind();
            }
        }
        public XPDataView atualizaGridEmpenhos(string tipo)
        {
            string unidOrc = "";
            string unidOrcDefault = "";
            string empenhoNum = "";
            string dataIni = "";
            string dataFim = "";
            string credor = "";
            string sql = string.Empty;

            XPDataView dv = new XPDataView();

            if (!tipo.Equals("Limpar"))
            {
                if (!chkRestosPagar.Checked)
                {
                    Control.UsuariosControle ctrlUsu = new Control.UsuariosControle();

                    bool parametro = Control.Configuracoes.Dados.getParametroGradeDIDComplementar();

                    string idUsu = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(idUsu).ToString();

                    unidOrcDefault = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;

                    if (cbbUndOrc.Value != null)
                    {
                        unidOrc = "'" + cbbUndOrc.Value.ToString() + "'";
                    }
                    else
                    {
                        unidOrc = "uo.undunificado";
                    }

                    if (txtNumEmpenho.Value != null)
                    {
                        empenhoNum = "'" + txtNumEmpenho.Value.ToString() + "'";
                    }
                    else
                    {
                        empenhoNum = "emp.empnumero";
                    }

                    if (dtCadastroIni.Value != null)
                    {
                        dataIni = "'" + dtCadastroIni.Value.ToString().Substring(0, 10) + "'";
                    }
                    else
                    {
                        dataIni = "emp.empdata";
                    }

                    if (dtCadastroFim.Value != null)
                    {
                        dataFim = "'" + dtCadastroFim.Value.ToString().Substring(0, 10) + "'";
                    }
                    else
                    {
                        dataFim = "emp.empdata";
                    }

                    if (cbbCredor.Value != null)
                    {
                        credor = "'" + cbbCredor.Value.ToString() + "'";
                    }
                    else
                    {
                        credor = "emp.emppessoa";
                    }

                    sql = "select uo.undunificado, uo.undabrev, emp.empdata, emp.empnumero, emp.emppessoa, " +
                    "emp.empnomepessoa, emp.empnatureza, (emp.empvalor - coalesce(ema.emavalor,0)) empvalor, lic.licnumero, lic.licdata,proc.numero PROCNUMERO,  did.id DIDID," +
                    "case when emp.empstatus = 'T' then 'NORMAL' else 'Erro' end " +
                    "empstatus, " +
                    "(select * from SP_FLUXUS_SALDOLIQUIDACAO(proc.id)) SALDOLIQUIDACAO," +
                    "(select * from SP_FLUXUS_SALDOPAGAMENTO(proc.id)) SALDOPAGAMENTO," +
                    "case " +
                    "    when emp.empfundeb = 1 then '1 - Magistério 60%' " +
                    "    when emp.empfundeb = 2 then '2 - Administrativo 40%' " +
                    "    when emp.empfundeb = 3 then '3 - MDE - Outros' " +
                    "    else null " +
                    "end " +
                    "empfundeb, EMP.empcod, " +
                    "CTR.CTRNUMERO, CTR.CTRDATA " +
                    "from empenho emp " +
                    "join unidadeorcamentaria uo on uo.undcodorgao = emp.emporgao and uo.undcodigo = emp.empunidade " +
                    "left join licitacao lic on lic.liccod = emp.emplicitacao " +
                    "LEFT JOIN CONTRATOS CTR ON CTR.ctrcod = EMP.empcontrato " +
                    "join webprocesso proc on emp.empdid = proc.id " +
                    "join webDID did on did.numero = proc.numero " +
                    "Left join empenhoanulacao ema on ema.emaempenho = emp.empcod " +
                    "where ";

                    //if (parametro == false)
                    //{
                    //    sql += "uo.undunificado in (SELECT UO.undunificado " +
                    //    "    FROM unidadeorcamentaria UO " +
                    //    "    JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                    //    "    WHERE " +
                    //    "    uog.uogunidadegestora = " +
                    //    "    (SELECT UOG.uogunidadegestora " +
                    //    "        FROM unidadeorcamentaria UO " +
                    //    "        JOIN und_orc_und_ges UOG ON UOG.uogorgao = UO.undcodorgao AND UOG.uogunidade = UO.undcodigo " +
                    //    "        where uo.undunificado = '" + unidOrcDefault + "' " +
                    //    "    ) " +
                    //    ")";
                    //}
                    //else
                    //{
                        sql += "uo.undunificado in (select UNDUNIFICADO from SCI_USUARIOS_UNDORC where usu_codigo = " + idUsu;
                        sql += " union " +
                            "SELECT UNDUNIFICADO FROM unidadeorcamentaria UN " +
                            "JOIN webunidadefuncional UF ON UF.unidorccod = UN.undcodigo AND UF.unidorcorg = UN.undcodorgao " +
                            "JOIN sci_usuarios USU ON USU.usu_idundfuncional = UF.unidfuncid " +
                            "WHERE USU.usu_codigo = " + idUsu;
                        sql += " )";
                    //}

                    if (txtNumEmpenho.Value == null && dtCadastroIni.Value == null && dtCadastroFim.Value == null && cbbCredor.Value == null)
                    {
                        sql += " and (((select * from SP_FLUXUS_SALDOLIQUIDACAO(proc.id)) + (select * from SP_FLUXUS_SALDOPAGAMENTO(proc.id))) <> 0) ";
                    }

                    sql += " and emp.empnumero = " + empenhoNum + " and emp.emppessoa = " + credor + " and uo.undunificado =" + unidOrc +
                                    " and (emp.empdata >= " + dataIni.Replace("/", ".") + " and emp.empdata <= " + dataFim.Replace("/", ".") + ") " +
                                    "order by emp.empdata desc";
                }
                else
                {
                    Control.UsuariosControle ctrlUsu = new Control.UsuariosControle();

                    bool parametro = Control.Configuracoes.Dados.getParametroGradeDIDComplementar();

                    string idUsu = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();
                    string idUndFunc = Control.UndFuncionalCtrl.getUndFuncByUsuID(idUsu).ToString();

                    unidOrcDefault = Control.UnidadeOrcamentariaCtrl.GetUnidadeOrcamentriaByUnidadeFuncional(idUndFunc).undUnificado;

                    if (cbbUndOrc.Value != null)
                    {
                        unidOrc = "'" + cbbUndOrc.Value.ToString() + "'";
                    }
                    else
                    {
                        unidOrc = "uo.undunificado";
                    }

                    if (txtNumEmpenho.Value != null)
                    {
                        empenhoNum = "'" + txtNumEmpenho.Value.ToString() + "'";
                    }
                    else
                    {
                        empenhoNum = "rpemp.rpenumero";
                    }

                    if (dtCadastroIni.Value != null)
                    {
                        dataIni = "'" + dtCadastroIni.Value.ToString().Substring(0, 10) + "'";
                    }
                    else
                    {
                        dataIni = "rpemp.rpedata";
                    }

                    if (dtCadastroFim.Value != null)
                    {
                        dataFim = "'" + dtCadastroFim.Value.ToString().Substring(0, 10) + "'";
                    }
                    else
                    {
                        dataFim = "rpemp.rpedata";
                    }

                    if (cbbCredor.Value != null)
                    {
                        credor = "'" + cbbCredor.Value.ToString() + "'";
                    }
                    else
                    {
                        credor = "rpemp.rpepessoa";
                    }

                    sql = "select uo.undunificado, uo.undabrev, rpemp.rpedata, rpemp.rpenumero, rpemp.rpepessoa, pes.pesnome as empnomepessoa, " +
                    "rpemp.rpenatureza, (rpemp.rpevalor - coalesce(rpema.rpavalor,0)) rpempvalor, lic.licnumero, lic.licdata, " +
                    "proc.numero PROCNUMERO,  did.id DIDID, " +
                    "case when rpemp.rpestatus = 'T' then 'NORMAL' else 'Erro' end rpempstatus, " +
                    "(select VALORLIQ from SP_FLUXUS_SALDORP_NPROC(rpemp.rpenumero)) SALDOLIQUIDACAO, " +
                    "(select VALORLIQ from SP_FLUXUS_SALDORP_PROC(rpemp.rpenumero)) SALDOPAGAMENTO, " +
                    "case " +
                    "when rpemp.rpefundeb = 1 then '1 - Magistério 60%' " +
                    "when rpemp.rpefundeb = 2 then '2 - Administrativo 40%' " +
                    "when rpemp.rpefundeb = 3 then '3 - MDE - Outros' " +
                    "else null end rpefundeb, rpEMP.rpecod, CTR.CTRNUMERO, CTR.CTRDATA " +
                    "from rpempenho rpemp " +
                    "join unidadeorcamentaria uo on uo.undcodorgao = rpemp.rpeorgao and uo.undcodigo = rpemp.rpeunidade " +
                    "left join licitacao lic on lic.liccod = rpemp.rpelicitacao " +
                    "LEFT JOIN CONTRATOS CTR ON CTR.ctrcod = rpEMP.rpecontrato " +
                    "join webprocesso proc on rpemp.rpedid = proc.id " +
                    "join webDID did on did.numero = proc.numero " +
                    "Left join rpempenhoanulacao rpema on rpema.rparpempenho = rpemp.rpecod " +
                    "join pessoa pes on pes.pescod = rpemp.rpepessoa where ";

                    sql += "uo.undunificado in (select UNDUNIFICADO from SCI_USUARIOS_UNDORC where usu_codigo = " + idUsu ;
                    sql += " union "+
                        "SELECT UNDUNIFICADO FROM unidadeorcamentaria UN "+
                        "JOIN webunidadefuncional UF ON UF.unidorccod = UN.undcodigo AND UF.unidorcorg = UN.undcodorgao "+
                        "JOIN sci_usuarios USU ON USU.usu_idundfuncional = UF.unidfuncid "+
                        "WHERE USU.usu_codigo = " + idUsu;
                    sql += " )";

                    sql += " and rpemp.rpenumero = " + empenhoNum + " and rpemp.rpepessoa = " + credor + " and uo.undunificado =" + unidOrc +
                            " and (rpemp.rpedata >= " + dataIni.Replace("/", ".") + " and rpemp.rpedata <= " + dataFim.Replace("/", ".") + ") " +
                            "order by rpemp.rpedata desc";
                }

                DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
                XpoDataSource1.Session = xpoSession;

                //string connTeste = AcessoDados.AcessoDados.GetConnectionStringXPO();
                XpoDataSource1.Session.Connection = Persist.GetConn.getConn();
                //XpoDataSource1.Session.ConnectionString = connTeste;

                SelectedData resultSet = xpoSession.ExecuteQuery(sql);

                dv.AddProperty("UNDUNIFICADO", typeof(string));
                dv.AddProperty("UNDABREV", typeof(string));
                dv.AddProperty("EMPDATA", typeof(DateTime));
                dv.AddProperty("EMPNUMERO", typeof(string));
                dv.AddProperty("EMPPESSOA", typeof(string));
                dv.AddProperty("EMPNOMEPESSOA", typeof(string));
                dv.AddProperty("EMPNATUREZA", typeof(string));
                dv.AddProperty("EMPVALOR", typeof(double));
                dv.AddProperty("LICNUMERO", typeof(string));
                dv.AddProperty("LICDATA", typeof(DateTime));
                dv.AddProperty("PROCNUMERO", typeof(string));
                dv.AddProperty("DIDID", typeof(int));
                dv.AddProperty("EMPSTATUS", typeof(string));
                dv.AddProperty("SALDOLIQUIDACAO", typeof(double));
                dv.AddProperty("SALDOPAGAMENTO", typeof(double));
                dv.AddProperty("EMPFUNDEB", typeof(string));
                dv.AddProperty("EMPCOD", typeof(int));
                dv.AddProperty("CTRNUMERO", typeof(string));
                dv.AddProperty("CTRDATA", typeof(DateTime));

                dv.LoadData(resultSet);

                ASPxGridView1.DataSource = dv;
                ASPxGridView1.DataBind();

            }
            else
            {
                ASPxGridView1.DataSourceID = string.Empty;
                ASPxGridView1.DataBind();
            }

            Session["DTGRIDEMPENHO"] = dv;
            return dv;
        }
示例#36
0
 public CustomerBase(DevExpress.Xpo.Session session)
     : base(session)
 {
 }
        public void AtualizarGridLiqPag(string LiqPag)
        {
            string sql = string.Empty;
            if (!chkRestosPagar.Checked)
            {
                if (LiqPag == "L")
                {
                    sql = "select * " +
                            "from (select PROC.ID, PROC.NUMERO PROCNUMERO, EMP.EMPNUMERO, EMP.EMPCOD, " +
                            "             (" +
                            "             case " +
                            "               when PROC.IDPROCESSOPAI is null then TRA.VAL_LIQUIDADO " +
                            "               else DID.VALOR " +
                            "             end) VALOR, " +
                            "             PROC.DATAHORACADASTRO, PROC.RESPONSAVEL, PES.PESNOME as EMPNOMEPESSOA, TRA.NF_LIQUIDACAO NOTAFISCAL, " +
                            "             'X' as PRINT, SP.descricao " +
                            "      from WEBPROCESSO PROC " +
                            "      join WEBDID DID on DID.NUMERO = PROC.NUMERO " +
                            "      join PESSOA PES on PES.PESCOD = DID.IDFORNECEDOR " +
                            "      join WEBTRAMITE TRA on TRA.IDPROCESSO = PROC.ID " +
                            "      join EMPENHO EMP on EMP.EMPDID = PROC.IDPROCESSOPAI " +
                            "      JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "      where (PROC.IDPROCESSOPAI = (select ID " +
                            "                                   from WEBPROCESSO " +
                            "                                   where NUMERO = " + txtProcNumero.Text + ") and " +
                            "            TRA.VAL_LIQUIDADO is not null and " +
                            "            TRA.VAL_LIQUIDADO <> 0 AND TRA.nf_liquidacao IS NOT NULL and " +
                            "            TRA.ID = (select first 1 ID " +
                            "                      from WEBTRAMITE TRA3 " +
                            "                      where TRA3.IDPROCESSO = PROC.ID and " +
                            "                            TRA3.VAL_LIQUIDADO is not null and " +
                            "                            TRA3.VAL_LIQUIDADO <> 0 AND TRA3.nf_liquidacao IS NOT NULL " +
                            "                      order by TRA3.ID desc) " +
                            "            ) " +
                            "      union all " +
                            "      select PROC.ID, PROC.NUMERO PROCNUMERO, EMP.EMPNUMERO, EMP.EMPCOD, " +
                            "             ( " +
                            "             case " +
                            "               when PROC.IDPROCESSOPAI is null then TRA.VAL_LIQUIDADO " +
                            "               else DID.VALOR " +
                            "             end) VALOR, " +
                            "             PROC.DATAHORACADASTRO, PROC.RESPONSAVEL, PES.PESNOME as EMPNOMEPESSOA, TRA.NF_LIQUIDACAO NOTAFISCAL, " +
                            "             'X' as PRINT, SP.descricao " +
                            "      from WEBPROCESSO PROC " +
                            "      join WEBDID DID on DID.NUMERO = PROC.NUMERO " +
                            "      join PESSOA PES on PES.PESCOD = DID.IDFORNECEDOR " +
                            "      join WEBTRAMITE TRA on TRA.IDPROCESSO = PROC.ID " +
                            "      join EMPENHO EMP on EMP.EMPDID = PROC.ID " +
                            "      JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "      where PROC.NUMERO = " + txtProcNumero.Text + " and " +
                            "            TRA.ID = (select first 1 TRA.ID " +
                            "                      from WEBTRAMITE TRA " +
                            "                      join WEBPROCESSO PRO on PRO.ID = TRA.IDPROCESSO " +
                            "                      where PRO.NUMERO = " + txtProcNumero.Text + " and " +
                            "                            TRA.VAL_LIQUIDADO is not null  AND TRA.VAL_LIQUIDADO <> 0 " +
                            "                      order by TRA.ID desc)) " +
                            "order by ID  ";
                }
                else
                {
                    sql = "Select * from (SELECT proc.id, proc.numero PROCNUMERO,  emp.empnumero, emp.empcod," +
                            "(case when proc.idprocessopai is null then tra.val_pago else did.valor end) valor," +
                            "proc.datahoracadastro," +
                            "PROC.responsavel, pes.pesnome as  empnomepessoa, 'X' NOTAFISCAL, '' as Print, SP.descricao " +
                            "from webprocesso proc " +
                            "join webdid did on did.numero = proc.numero " +
                            "join pessoa pes on pes.pescod = did.idfornecedor " +
                            "join webtramite tra on tra.idprocesso = proc.id " +
                            "join empenho emp on emp.empdid = proc.idprocessopai " +
                            "JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "where (proc.idprocessopai = (select id from webprocesso where numero = " + txtProcNumero.Text + ") and (tra.val_pago is not null and tra.val_pago <> 0)) " +
                            "union ALL " +
                            "SELECT proc.id, proc.numero PROCNUMERO,  emp.empnumero, emp.empcod, " +
                            "(case when proc.idprocessopai is null then tra.val_pago else did.valor end) valor,proc.datahoracadastro, " +
                            "PROC.responsavel, pes.pesnome as  empnomepessoa, 'X' NOTAFISCAL, '' as Print, SP.descricao " +
                            "from webprocesso proc " +
                            "join webdid did on did.numero = proc.numero " +
                            "join pessoa pes on pes.pescod = did.idfornecedor " +
                            "join webtramite tra on tra.idprocesso = proc.id " +
                            "join empenho emp on emp.empdid = proc.id " +
                            "JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "WHERE PROC.numero = " + txtProcNumero.Text + " AND TRA.id = (select first 1 tra.id from webtramite tra join webprocesso pro on pro.id " +
                            "= tra.idprocesso where pro.numero = " + txtProcNumero.Text + " and (tra.val_pago is not null and tra.val_pago <>0) order by tra.id desc)) order by id";

                }
            }
            else {
                if (LiqPag == "L")
                {
                    sql = "select * " +
                            "from (select PROC.ID, PROC.NUMERO PROCNUMERO, RPEMP.RPENUMERO EMPNUMERO, RPEMP.RPECOD EMPCOD, " +
                            "             (" +
                            "             case " +
                            "               when PROC.IDPROCESSOPAI is null then TRA.VAL_LIQUIDADO " +
                            "               else DID.VALOR " +
                            "             end) VALOR, " +
                            "             PROC.DATAHORACADASTRO, PROC.RESPONSAVEL, PES.PESNOME as EMPNOMEPESSOA, TRA.NF_LIQUIDACAO NOTAFISCAL, " +
                            "             'X' as PRINT, SP.descricao " +
                            "      from WEBPROCESSO PROC " +
                            "      join WEBDID DID on DID.NUMERO = PROC.NUMERO " +
                            "      join PESSOA PES on PES.PESCOD = DID.IDFORNECEDOR " +
                            "      join WEBTRAMITE TRA on TRA.IDPROCESSO = PROC.ID " +
                            "      join RPEMPENHO RPEMP on RPEMP.RPEDID = PROC.IDPROCESSOPAI " +
                            "      JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "      where (PROC.IDPROCESSOPAI = (select ID " +
                            "                                   from WEBPROCESSO " +
                            "                                   where NUMERO = " + txtProcNumero.Text + ") and " +
                            "            TRA.VAL_LIQUIDADO is not null and " +
                            "            TRA.VAL_LIQUIDADO <> 0 AND TRA.nf_liquidacao IS NOT NULL and " +
                            "            TRA.ID = (select first 1 ID " +
                            "                      from WEBTRAMITE TRA3 " +
                            "                      where TRA3.IDPROCESSO = PROC.ID and " +
                            "                            TRA3.VAL_LIQUIDADO is not null and " +
                            "                            TRA3.VAL_LIQUIDADO <> 0 AND TRA3.nf_liquidacao IS NOT NULL " +
                            "                      order by TRA3.ID desc) " +
                            "            ) AND PROC.EXERCICIO = (SELECT FIRST 1 ENTEXERCICIO FROM ENTIDADE)" +
                            "      union all " +
                            "      select PROC.ID, PROC.NUMERO PROCNUMERO, RPEMP.RPENUMERO EMPNUMERO, RPEMP.RPECOD EMPCOD, " +
                            "             ( " +
                            "             case " +
                            "               when PROC.IDPROCESSOPAI is null then TRA.VAL_LIQUIDADO " +
                            "               else DID.VALOR " +
                            "             end) VALOR, " +
                            "             PROC.DATAHORACADASTRO, PROC.RESPONSAVEL, PES.PESNOME as EMPNOMEPESSOA, TRA.NF_LIQUIDACAO NOTAFISCAL, " +
                            "             'X' as PRINT, SP.descricao " +
                            "      from WEBPROCESSO PROC " +
                            "      join WEBDID DID on DID.NUMERO = PROC.NUMERO " +
                            "      join PESSOA PES on PES.PESCOD = DID.IDFORNECEDOR " +
                            "      join WEBTRAMITE TRA on TRA.IDPROCESSO = PROC.ID " +
                            "      join RPEMPENHO RPEMP on RPEMP.RPEDID = PROC.ID " +
                            "      JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "      where PROC.NUMERO = " + txtProcNumero.Text + " and " +
                            "            TRA.ID = (select first 1 TRA.ID " +
                            "                      from WEBTRAMITE TRA " +
                            "                      join WEBPROCESSO PRO on PRO.ID = TRA.IDPROCESSO " +
                            "                      where PRO.NUMERO = " + txtProcNumero.Text + " and " +
                            "                            TRA.VAL_LIQUIDADO is not null  AND TRA.VAL_LIQUIDADO <> 0 " +
                            "                      order by TRA.ID desc) AND PROC.EXERCICIO = (SELECT FIRST 1 ENTEXERCICIO FROM ENTIDADE)) " +
                            "order by ID  ";
                }
                else
                {
                    sql = "Select * from (SELECT proc.id, proc.numero PROCNUMERO,  RPEMP.RPENUMERO EMPNUMERO, RPEMP.RPECOD EMPCOD," +
                            "(case when proc.idprocessopai is null then tra.val_pago else did.valor end) valor," +
                            "proc.datahoracadastro," +
                            "PROC.responsavel, pes.pesnome as  empnomepessoa, 'X' NOTAFISCAL, '' as Print, SP.descricao " +
                            "from webprocesso proc " +
                            "join webdid did on did.numero = proc.numero " +
                            "join pessoa pes on pes.pescod = did.idfornecedor " +
                            "join webtramite tra on tra.idprocesso = proc.id " +
                            "join rpempenho rpemp on rpemp.rpedid = proc.idprocessopai " +
                            "JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "where (proc.idprocessopai = (select id from webprocesso where numero = " + txtProcNumero.Text + ") and (tra.val_pago is not null and tra.val_pago <> 0)) " +
                            "union ALL " +
                            "SELECT proc.id, proc.numero PROCNUMERO,  RPEMP.RPENUMERO EMPNUMERO, RPEMP.RPECOD EMPCOD, " +
                            "(case when proc.idprocessopai is null then tra.val_pago else did.valor end) valor,proc.datahoracadastro, " +
                            "PROC.responsavel, pes.pesnome as  empnomepessoa, 'X' NOTAFISCAL, '' as Print, SP.descricao " +
                            "from webprocesso proc " +
                            "join webdid did on did.numero = proc.numero " +
                            "join pessoa pes on pes.pescod = did.idfornecedor " +
                            "join webtramite tra on tra.idprocesso = proc.id " +
                            "join rpempenho rpemp on rpemp.rpedid = proc.id " +
                            "JOIN websituacaoprocesso SP ON SP.id = (select first 1 idsituacaoprojeto from webtramite t where idprocesso = proc.id order by id desc) " +
                            "WHERE PROC.numero = " + txtProcNumero.Text + " AND TRA.id = (select first 1 tra.id from webtramite tra join webprocesso pro on pro.id " +
                            "= tra.idprocesso where pro.numero = " + txtProcNumero.Text + " and (tra.val_pago is not null and tra.val_pago <> 0) order by tra.id desc)) order by id";

                }
            }
            //ASPxGridView2.DataSource = AcessoDados.AcessoDados.dtable(sql);
            //ASPxGridView2.DataBind();

            DevExpress.Xpo.Session xpoSession = new DevExpress.Xpo.Session();
            XpoDataSource2.Session = xpoSession;

            //string connTeste = AcessoDados.AcessoDados.GetConnectionStringXPO();
            XpoDataSource2.Session.Connection = Persist.GetConn.getConn();
            //XpoDataSource2.Session.ConnectionString = connTeste;

            SelectedData resultSet = xpoSession.ExecuteQuery(sql);
            XPDataView dv = new XPDataView();

            dv.AddProperty("ID", typeof(int));
            dv.AddProperty("PROCNUMERO", typeof(string));
            dv.AddProperty("EMPNUMERO", typeof(string));
            dv.AddProperty("EMPCOD", typeof(int));
            dv.AddProperty("VALOR", typeof(double));
            dv.AddProperty("DATAHORACADASTRO", typeof(DateTime));
            dv.AddProperty("RESPONSAVEL", typeof(string));
            dv.AddProperty("EMPNOMEPESSOA", typeof(string));
            dv.AddProperty("NOTAFISCAL", typeof(string));
            dv.AddProperty("PRINT", typeof(string));
            dv.AddProperty("DESCRICAO", typeof(string));

            dv.LoadData(resultSet);

            ASPxGridView2.DataSource = dv;
            ASPxGridView2.DataBind();
        }