void dGrid_ToolBarItemClick(object sender, ToolBarItemClickEventArgs e) { if (e.Action != Actions.Add) { return; } e.Action = Actions.Cancel; FBEntityService service = new FBEntityService(); QueryExpression qeOwner = this.OrderEntity.GetQueryExpression(FieldName.OwnerID); QueryExpression qeDept = this.OrderEntity.GetQueryExpression(FieldName.OwnerDepartmentID); QueryExpression qePost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID); qeDept.RelatedExpression = qeOwner; qeOwner.RelatedExpression = qePost; qeDept.QueryType = typeof(T_FB_TRAVELEXPAPPLYDETAIL).Name; service.QueryFBEntitiesCompleted += (o, ea) => { ObservableCollection <FBEntity> listDetail = this.OrderEntity.GetRelationFBEntities(typeof(T_FB_TRAVELEXPAPPLYDETAIL).Name); ObservableCollection <FBEntity> listDetailItem = ea.Result; listDetailItem.ToList().ForEach(item => { T_FB_TRAVELEXPAPPLYDETAIL t = item.Entity as T_FB_TRAVELEXPAPPLYDETAIL; t.T_FB_TRAVELEXPAPPLYMASTER = this.OrderEntity.Entity as T_FB_TRAVELEXPAPPLYMASTER; t.SERIALNUMBER = listDetail.Count + 1; ps.ForEach(p => { t.SetObjValue(p, decimal.Parse("0")); }); t.TOTALCHARGE = decimal.Parse("0"); listDetail.Add(item); }); }; service.QueryFBEntities(qeDept); }
private void GetOrderDetail() { QueryExpression qePost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID); qePost.QueryType = typeof(T_FB_PERSONBUDGETAPPLYDETAIL).Name; fbService.QueryFBEntities(qePost); }
void SystemSetting_FBBasePageLoaded(object sender, EventArgs e) { InitToolBar(); FBEntityService fbService = new FBEntityService(); QueryExpression qe = new QueryExpression(); qe.QueryType = typeof(T_FB_SYSTEMSETTINGS).Name; fbService.QueryFBEntitiesCompleted += new EventHandler <QueryFBEntitiesCompletedEventArgs>(fbService_QueryFBEntitiesCompleted); fbService.QueryFBEntities(qe); }
protected void GetOrderDetail() { this.ShowProcess(true); // 获取部门ID string deptID = Convert.ToString(OrderEntity.GetObjValue(EntityFieldName.OwnerDepartmentID)); string companyID = Convert.ToString(OrderEntity.GetObjValue(EntityFieldName.OwnerCompanyID)); curCompany = DataCore.CompanyList.FirstOrDefault(company => { return(company.ID == companyID); }); QueryExpression qe = QueryExpressionHelper.Equal(FieldName.OwnerDepartmentID, deptID); qe.QueryType = typeof(T_FB_COMPANYBUDGETMODDETAIL).Name; fbService.QueryFBEntities(qe); }
private void GetOrderDetail() { QueryExpression qePost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID); QueryExpression qeDepartment = this.OrderEntity.GetQueryExpression(FieldName.OwnerDepartmentID); QueryExpression qeCompany = this.OrderEntity.GetQueryExpression(FieldName.OwnerCompanyID); QueryExpression qeOwner = this.OrderEntity.GetQueryExpression(FieldName.OwnerID); qeDepartment.RelatedExpression = qeCompany; qeCompany.RelatedExpression = qeOwner; qePost.QueryType = typeof(T_FB_PERSONBUDGETADDDETAIL).Name; qePost.RelatedExpression = qeDepartment; fbService.QueryFBEntities(qePost); }
/// <summary> /// 查询数据 /// </summary> private void GetOrderDetail() { QueryExpression qe = QueryExpressionHelper.Equal(FieldName.OwnerID, DataCore.CurrentUser.Value.ToString()); qe.QueryType = typeof(T_FB_PERSONMONEYASSIGNMASTER).Name + "FormHR";//Latest QueryExpression qeAssign = QueryExpressionHelper.Equal("ASSIGNCOMPANYID", this.OrderEntity.GetObjValue("Entity.ASSIGNCOMPANYID").ToString()); qeAssign.QueryType = typeof(T_FB_PERSONMONEYASSIGNMASTER).Name + "FormHR";//Latest qeAssign.IsUnCheckRight = true; qeAssign.RelatedExpression = qe; qeAssign.IsNoTracking = false; this.ShowProcess(true); fbService.QueryFBEntities(qeAssign); }
private void GetOrderDetail() { this.ShowProcess(true); T_FB_COMPANYBUDGETAPPLYMASTER master = this.OrderEntity.Entity as T_FB_COMPANYBUDGETAPPLYMASTER; QueryExpression qeYear = QueryExpressionHelper.Equal("BUDGETYEAR", master.BUDGETYEAR.Add(-1).ToString()); qeYear.QueryType = typeof(T_FB_COMPANYBUDGETAPPLYDETAIL).Name; // 预算部门 QueryExpression qeDept = QueryExpressionHelper.Equal("OWNERDEPARTMENTID", this.OrderEntity.GetObjValue("Entity.OWNERDEPARTMENTID").ToString()); qeDept.QueryType = typeof(T_FB_COMPANYBUDGETAPPLYDETAIL).Name; qeDept.RelatedExpression = qeYear; fbService.QueryFBEntities(qeDept); }
private void GetOrderDetail() { // 预算月份 DateTime dtBudgetDate = (DateTime)this.OrderEntity.GetObjValue("Entity.BUDGETARYMONTH"); string dataValue = dtBudgetDate.ToString("yyyy-MM-dd"); QueryExpression qeMonth = QueryExpressionHelper.Equal("BUDGETARYMONTH", dataValue); qeMonth.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; // 预算部门 QueryExpression qeDept = QueryExpressionHelper.Equal("OWNERDEPARTMENTID", this.OrderEntity.GetObjValue("Entity.OWNERDEPARTMENTID").ToString()); qeDept.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; qeDept.RelatedExpression = qeMonth; fbService.QueryFBEntities(qeDept); }
private void GetOrderDetail() { this.ShowProcess(); // 预算月份 DateTime dtBudgetDate = (DateTime)this.OrderEntity.GetObjValue("Entity.BUDGETARYMONTH"); string dataValue = dtBudgetDate.AddMonths(-1).ToString("yyyy-MM-dd"); QueryExpression qeMonth = QueryExpressionHelper.Equal("BUDGETCHECKDATE", dataValue); qeMonth.QueryType = typeof(T_FB_DEPTBUDGETADDDETAIL).Name; // 预算部门 QueryExpression qeDept = this.OrderEntity.GetQueryExpression(FieldName.OwnerDepartmentID); qeDept.QueryType = typeof(T_FB_DEPTBUDGETADDDETAIL).Name; qeDept.RelatedExpression = qeMonth; fbService.QueryFBEntities(qeDept); }
public void QueryEntity() { QueryExpression qeBudget = new QueryExpression(); QueryExpression qe = qeBudget; qe.PropertyName = "USABLEMONEY"; qe.PropertyValue = "0"; qe.Operation = QueryExpression.Operations.GreaterThan; qe.QueryType = "QueryBudgetAccount"; ComboBox cbbBudgetType = this.expander.FindChildControl <ComboBox>("cbbBudgetType"); ITextValueItem vitem = cbbBudgetType.SelectedItem as ITextValueItem; if (vitem != null && !string.IsNullOrEmpty(vitem.Value.ToString())) { QueryExpression qeType = QueryExpressionHelper.Equal("AccountObjectType", vitem.Value.ToString()); qe.RelatedExpression = qeType; qe = qeType; } LookUp lkObject = this.expander.FindChildControl <LookUp>("lkObject"); MultiValuesItem <ExtOrgObj> mutilValues = lkObject.SelectItem as MultiValuesItem <ExtOrgObj>; if (mutilValues != null) { Dictionary <OrgTreeItemTypes, string> dictTypes = new Dictionary <OrgTreeItemTypes, string>(); dictTypes.Add(OrgTreeItemTypes.Company, FieldName.OwnerCompanyID); dictTypes.Add(OrgTreeItemTypes.Department, FieldName.OwnerDepartmentID); dictTypes.Add(OrgTreeItemTypes.Personnel, FieldName.OwnerID); dictTypes.Add(OrgTreeItemTypes.Post, FieldName.OwnerPostID); mutilValues.Values.ForEach(item => { string propertyName = dictTypes[item.ObjectType]; QueryExpression qeItem = QueryExpressionHelper.Equal(propertyName, item.ObjectID); qeItem.RelatedType = QueryExpression.RelationType.Or; qe.RelatedExpression = qeItem; qe = qeItem; }); } fbEntityService.QueryFBEntities(qeBudget); }
private void OnBorrowIDChanged <TEntity>() where TEntity : EntityObject { DetailGrid dgrid = this.EditForm.FindControl("OrderGrid") as DetailGrid; if (dgrid != null) { dgrid.ShowToolBar = false; } ObservableCollection <FBEntity> details = this.OrderEntity.GetRelationFBEntities(typeof(TEntity).Name); details.Clear(); T_FB_BORROWAPPLYMASTER borrowMaster = this.OrderEntity.GetObjValue(typeof(T_FB_BORROWAPPLYMASTER).Name.ToEntityString()) as T_FB_BORROWAPPLYMASTER; if (borrowMaster == null) { return; } QueryExpression qeBorrow = QueryExpressionHelper.Equal("T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERID", borrowMaster.BORROWAPPLYMASTERID); QueryExpression qeOwner = this.OrderEntity.GetQueryExpression(FieldName.OwnerID); QueryExpression qeOwnerPost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID); qeBorrow.QueryType = typeof(TEntity).Name; qeBorrow.RelatedExpression = qeOwner; qeOwner.RelatedExpression = qeOwnerPost; FBEntityService service = new FBEntityService(); service.QueryFBEntitiesCompleted += (o, ea) => { ea.Result.ToList().ForEach(item => { details.Add(item); item.FBEntityState = FBEntityState.Added; }); }; service.QueryFBEntities(qeBorrow); }
private void GetOrderDetail() { // 预算年份 QueryExpression qeYear = this.OrderEntity.GetQueryExpression("BUDGETYEAR"); qeYear.QueryType = typeof(T_FB_COMPANYTRANSFERDETAIL).Name; // 预算部门 QueryExpression qeDepartment = this.OrderEntity.GetQueryExpression(FIELDNAME_TRANSFERFROM); qeDepartment.PropertyName = FieldName.OwnerDepartmentID; qeDepartment.RelatedExpression = qeYear; // 公司 QueryExpression qeCompany = this.OrderEntity.GetQueryExpression(FieldName.OwnerCompanyID); qeCompany.QueryType = typeof(T_FB_COMPANYTRANSFERDETAIL).Name; qeCompany.RelatedExpression = qeDepartment; fbService.QueryFBEntities(qeCompany); }
private void GetOrderDetail() { T_FB_DEPTTRANSFERMASTER master = this.OrderEntity.Entity as T_FB_DEPTTRANSFERMASTER; // 调出单位类型 QueryExpression qeTransferType = this.OrderEntity.GetQueryExpression("TRANSFERFROMTYPE"); qeTransferType.PropertyName = "ACCOUNTOBJECTTYPE"; // 预算单位 QueryExpression qeFrom = this.OrderEntity.GetQueryExpression("TRANSFERFROM"); qeFrom.RelatedExpression = qeTransferType; if (master.TRANSFERFROMTYPE.Equal(3)) // 个人 { qeFrom.PropertyName = FieldName.OwnerID; // 岗位 QueryExpression qePost = QueryExpressionHelper.Equal(FieldName.OwnerPostID, master.TRANSFERFROMPOSTID); qeFrom.RelatedExpression = qePost; } else { qeFrom.PropertyName = FieldName.OwnerDepartmentID; } // 预算年份 QueryExpression qeYear = QueryExpressionHelper.Equal("BUDGETYEAR", master.BUDGETARYMONTH.Year.ToString()); qeYear.RelatedExpression = qeFrom; // 预算月份 QueryExpression qeMonth = QueryExpressionHelper.Equal("BUDGETMONTH", master.BUDGETARYMONTH.Month.ToString()); qeMonth.RelatedExpression = qeYear; qeMonth.QueryType = typeof(T_FB_DEPTTRANSFERDETAIL).Name; fbService.QueryFBEntities(qeMonth); }
public void QueryEntity() { QueryExpression qeBudget = new QueryExpression(); QueryExpression qe = qeBudget; qe.PropertyName = "USABLEMONEY"; qe.PropertyValue = "0"; qe.Operation = QueryExpression.Operations.GreaterThan; qe.QueryType = "QueryBudgetAccount"; qe.RightType = "QueryBudgetAccount"; // 开始日期 QueryExpression qeStartYear = new QueryExpression { PropertyName = "BUDGETYEAR", PropertyValue = DateTime.Now.Year.ToString(), Operation = QueryExpression.Operations.GreaterThanOrEqual }; QueryExpression qeStartMonth = new QueryExpression { PropertyName = "BUDGETMONTH", PropertyValue = DateTime.Now.Month.ToString(), Operation = QueryExpression.Operations.GreaterThanOrEqual }; qe.RelatedExpression = qeStartYear; qeStartYear.RelatedExpression = qeStartMonth; qe = qeStartMonth; // 结束日期 QueryExpression qeEndYear = new QueryExpression { PropertyName = "BUDGETYEAR", PropertyValue = DateTime.Now.Year.ToString(), Operation = QueryExpression.Operations.LessThanOrEqual }; QueryExpression qeEndMonth = new QueryExpression { PropertyName = "BUDGETMONTH", PropertyValue = DateTime.Now.Month.ToString(), Operation = QueryExpression.Operations.LessThanOrEqual }; qe.RelatedExpression = qeEndYear; qeEndYear.RelatedExpression = qeEndMonth; qe = qeEndMonth; // 结束日期 QueryExpression qeAccountType = new QueryExpression { PropertyName = "ACCOUNTOBJECTTYPE", PropertyValue = "1", Operation = QueryExpression.Operations.NotEqual }; qe.RelatedExpression = qeEndMonth; qeEndYear.RelatedExpression = qeAccountType; qe = qeAccountType; QueryExpression qeTemp = null; // 选择范围 MultiValuesItem <ExtOrgObj> mutilValues = lkObject.SelectItem as MultiValuesItem <ExtOrgObj>; if (mutilValues != null) { Dictionary <OrgTreeItemTypes, string> dictTypes = new Dictionary <OrgTreeItemTypes, string>(); dictTypes.Add(OrgTreeItemTypes.Company, FieldName.OwnerCompanyID); dictTypes.Add(OrgTreeItemTypes.Department, FieldName.OwnerDepartmentID); dictTypes.Add(OrgTreeItemTypes.Personnel, FieldName.OwnerID); dictTypes.Add(OrgTreeItemTypes.Post, FieldName.OwnerPostID); mutilValues.Values.ForEach(item => { string propertyName = dictTypes[item.ObjectType]; QueryExpression qeItem = QueryExpressionHelper.Equal(propertyName, item.ObjectID); qeItem.RelatedType = QueryExpression.RelationType.Or; qeItem.RelatedExpression = qeTemp; qeTemp = qeItem; }); } if (qeTemp != null) { qe.RelatedExpression = qeTemp; } fbEntityService.QueryFBEntities(qeBudget); }
private void OnBorrowIDChanged <TEntity>() where TEntity : EntityObject { DetailGrid dgrid = this.EditForm.FindControl("OrderGrid") as DetailGrid; if (dgrid != null) { dgrid.ShowToolBar = false; } ObservableCollection <FBEntity> details = this.OrderEntity.GetRelationFBEntities(typeof(TEntity).Name); details.Clear(); T_FB_BORROWAPPLYMASTER borrowMaster = this.OrderEntity.GetObjValue(typeof(T_FB_BORROWAPPLYMASTER).Name.ToEntityString()) as T_FB_BORROWAPPLYMASTER; if (borrowMaster == null) { return; } int iPayType = 0; int.TryParse(this.OrderEntity.GetObjValue("Entity.PAYTYPE").ToString(), out iPayType); if (iPayType != 2) { this.OrderEntity.ReferencedData["Entity.PAYTYPE"] = DataCore.FindRefData("PayTypeData", 2); } T_FB_CHARGEAPPLYMASTER chargeMaster = this.OrderEntity.Entity as T_FB_CHARGEAPPLYMASTER; if (chargeMaster.OWNERID == borrowMaster.OWNERID) { if (chargeMaster.OWNERPOSTID != borrowMaster.OWNERPOSTID) { chargeMaster.OWNERPOSTID = borrowMaster.OWNERPOSTID; chargeMaster.OWNERPOSTNAME = borrowMaster.OWNERPOSTNAME; } if (chargeMaster.OWNERDEPARTMENTID != borrowMaster.OWNERDEPARTMENTID) { chargeMaster.OWNERDEPARTMENTID = borrowMaster.OWNERDEPARTMENTID; chargeMaster.OWNERDEPARTMENTNAME = borrowMaster.OWNERDEPARTMENTNAME; } if (chargeMaster.OWNERCOMPANYID != borrowMaster.OWNERCOMPANYID) { chargeMaster.OWNERCOMPANYID = borrowMaster.OWNERCOMPANYID; chargeMaster.OWNERCOMPANYNAME = borrowMaster.OWNERCOMPANYNAME; } } QueryExpression qeBorrow = QueryExpressionHelper.Equal("T_FB_BORROWAPPLYMASTER.BORROWAPPLYMASTERID", borrowMaster.BORROWAPPLYMASTERID); QueryExpression qeOwner = this.OrderEntity.GetQueryExpression(FieldName.OwnerID); QueryExpression qeOwnerPost = this.OrderEntity.GetQueryExpression(FieldName.OwnerPostID); qeBorrow.QueryType = typeof(TEntity).Name; qeBorrow.RelatedExpression = qeOwner; qeOwner.RelatedExpression = qeOwnerPost; FBEntityService service = new FBEntityService(); service.QueryFBEntitiesCompleted += (o, ea) => { ea.Result.ToList().ForEach(item => { details.Add(item); item.FBEntityState = FBEntityState.Added; }); }; service.QueryFBEntities(qeBorrow); }