public List <EntityObject> GetEntities(string entityType) { using (BudgetAccountBLL bll = new BudgetAccountBLL()) { DateTime dtStart = DateTime.Parse(this.tbStart.Text); DateTime dtEnd = DateTime.Parse(this.tbEnd.Text); QueryExpression qeStart = new QueryExpression(); qeStart.PropertyName = FieldName.UpdateDate; qeStart.PropertyValue = this.tbStart.Text; qeStart.Operation = QueryExpression.Operations.GreaterThanOrEqual; QueryExpression qeEnd = new QueryExpression(); qeEnd.PropertyName = FieldName.UpdateDate; qeEnd.PropertyValue = this.tbEnd.Text; qeEnd.Operation = QueryExpression.Operations.LessThanOrEqual; QueryExpression qeCheckStatesPass = QueryExpression.Equal(FieldName.CheckStates, "2"); QueryExpression qeCheckStatesPassing = QueryExpression.Equal(FieldName.CheckStates, "1"); qeStart.RelatedExpression = qeEnd; qeEnd.RelatedExpression = qeCheckStatesPass; qeCheckStatesPass.RelatedType = QueryExpression.RelationType.Or; qeCheckStatesPass.RelatedExpression = qeCheckStatesPassing; qeStart.QueryType = entityType; qeStart.OrderByExpression = new OrderByExpression { OrderByType = OrderByType.Asc, PropertyName = FieldName.UpdateDate }; qeStart.IsNoTracking = true; return(qeStart.Query(bll)); } }
public void CreatePersonMoneyAssignInfo(string ASSIGNCOMPANYID, string SubmitUserID, string CreateUserid) { using (BudgetAccountBLL obll = new BudgetAccountBLL()) { obll.CreatePersonMoneyAssignInfo(ASSIGNCOMPANYID, SubmitUserID, CreateUserid); Tracer.Debug(string.Format("在{0} 系统生成活动经费:公司ID{1},SubmitUserID:{2}, CreateUserid:{3}", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ASSIGNCOMPANYID, SubmitUserID, CreateUserid)); } }
public void CloseBudget() { DateTime currentDate = DateTime.Now; BudgetAccountBLL bll = new BudgetAccountBLL(); bll.CloseBudget(currentDate); Tracer.Debug(string.Format("在{0} 预算月结完毕!", System.DateTime.Now.ToString("yyyy-MM-dd"))); }
public List <T_FB_BUDGETACCOUNT> GetBudgetAccountByPerson(string strOwnerID, string strOwnerPostID, string strOwnerCompanyID) { using (BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { List <T_FB_BUDGETACCOUNT> entList = bllBudgetAccount.GetBudgetAccountByPerson(strOwnerID, strOwnerPostID, strOwnerCompanyID); return(entList.Count() > 0 ? entList : null); } }
public T_FB_BUDGETACCOUNT GetBudgetAccountByID(string strBudgetAccountId) { T_FB_BUDGETACCOUNT entRd = new T_FB_BUDGETACCOUNT(); using (BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { entRd = bllBudgetAccount.GetBudgetAccountByID(strBudgetAccountId); return(entRd); } }
public List <T_FB_BUDGETACCOUNT> GetBudgetAccountListByMultSearch(string strFilter, List <object> objArgs, string strSortKey, int pageIndex, int pageSize, ref int pageCount, string accountType) { IList <T_FB_BUDGETACCOUNT> entList = new List <T_FB_BUDGETACCOUNT>(); using (BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { entList = bllBudgetAccount.GetBudgetAccountRdListByMultSearch(strFilter, objArgs, strSortKey, pageIndex, pageSize, ref pageCount, accountType).ToList(); return(entList.Count() > 0 ? entList.ToList() : null); } }
/// <summary> /// 获取预算总帐 /// </summary> /// <param name="sbjectID"></param> /// <param name="companyID"></param> /// <param name="departmentID"></param> /// <param name="type"></param> /// <returns></returns> protected List<T_FB_BUDGETACCOUNT> FetchBudgetAccount(string sbjectID, string companyID, string departmentID, BudgetAccountBLL.AccountObjectType type) { QueryExpression qeTop = new QueryExpression(); QueryExpression qeFirst = qeTop; TryGetQueryExpression("T_FB_SUBJECT.SUBJECTID", sbjectID, ref qeTop); TryGetQueryExpression("OWNERCOMPANYID", companyID, ref qeTop); TryGetQueryExpression("OWNERDEPARTMENTID", departmentID, ref qeTop); // TryGetQueryExpression("ACCOUNTOBJECTTYPE", ((int)type).ToString(), ref qeTop); if (qeFirst.RelatedExpression == null) { return new List<T_FB_BUDGETACCOUNT>(); } qeFirst = qeFirst.RelatedExpression; qeFirst.QueryType = typeof(T_FB_BUDGETACCOUNT).Name; BudgetAccountBLL bll = new BudgetAccountBLL(); List<T_FB_BUDGETACCOUNT> listResult = bll.FetchBUDGETACCOUNT(qeFirst, type); return listResult; }
/// <summary> /// 获取预算总帐 /// </summary> /// <param name="sbjectID"></param> /// <param name="companyID"></param> /// <param name="departmentID"></param> /// <param name="type"></param> /// <returns></returns> protected List <T_FB_BUDGETACCOUNT> FetchBudgetAccount(string sbjectID, string companyID, string departmentID, BudgetAccountBLL.AccountObjectType type) { QueryExpression qeTop = new QueryExpression(); QueryExpression qeFirst = qeTop; TryGetQueryExpression("T_FB_SUBJECT.SUBJECTID", sbjectID, ref qeTop); TryGetQueryExpression("OWNERCOMPANYID", companyID, ref qeTop); TryGetQueryExpression("OWNERDEPARTMENTID", departmentID, ref qeTop); // TryGetQueryExpression("ACCOUNTOBJECTTYPE", ((int)type).ToString(), ref qeTop); if (qeFirst.RelatedExpression == null) { return(new List <T_FB_BUDGETACCOUNT>()); } qeFirst = qeFirst.RelatedExpression; qeFirst.QueryType = typeof(T_FB_BUDGETACCOUNT).Name; BudgetAccountBLL bll = new BudgetAccountBLL(); List <T_FB_BUDGETACCOUNT> listResult = bll.FetchBUDGETACCOUNT(qeFirst, type); return(listResult); }
private void AuditOrder(string orderID, CheckStates cs) { string typeName = ""; string keyName = ""; var entityInfo = EntityInfoList.First(item => item.Type == this.ddlOrderType.SelectedValue); typeName = entityInfo.Type; keyName = entityInfo.KeyName; QueryExpression qe = QueryExpression.Equal(keyName, orderID); qe.QueryType = typeName; using (BudgetAccountBLL bll = new BudgetAccountBLL()) { var data = qe.Query(bll); var order = data.FirstOrDefault(); if (order != null) { try { bll.BeginTransaction(); bll.UpdateAccount(order.ToFBEntity(), cs); bll.CommitTransaction(); } catch (Exception ex) { bll.RollbackTransaction(); SMT.Foundation.Log.Tracer.Error("手动审核异常:" + ex.ToString()); Response.Write(ex.ToString()); } Response.Write("操作成功"); } else { Response.Write("没有可操作的数据"); } } }
protected void testGetPersonMoneyAssign_Click(object sender, EventArgs e) { SMT.FB.BLL.BudgetAccountBLL bll = new BudgetAccountBLL(); var masters = bll.GetPersonMoneyAssign(this.inputASSIGNCOMPANYID.Value, this.inputOWNERID.Value, ""); List <FBEntity> resultList = new List <FBEntity>(); if (masters != null) { FBEntity fbResult = masters.ToFBEntity(); //处理岗位信息一栏 List <T_FB_PERSONMONEYASSIGNDETAIL> rlist = masters.T_FB_PERSONMONEYASSIGNDETAIL.ToList(); // rlist = obll.UpdatePostInfo(rlist); //按公司、部门排序 rlist = rlist.OrderBy(c => c.OWNERCOMPANYID).ThenBy(c => c.OWNERDEPARTMENTID).ToList(); fbResult.AddFBEntities <T_FB_PERSONMONEYASSIGNDETAIL>(rlist.ToFBEntityList()); resultList.Add(fbResult); this.GridView1.DataSource = masters.T_FB_PERSONMONEYASSIGNDETAIL.ToList(); this.DataBind(); } }
/// <summary> /// 根据扩展单据ID,查找与其关联的老单据,更新其状态为 /// </summary> /// <param name="strExtenOrderID"></param> private void CancelOldChargeRdByExtenOrder(string strExtenOrderID) { try { if (string.IsNullOrWhiteSpace(strExtenOrderID)) { return; } ChargeApplyMasterBLL bllCharge = new ChargeApplyMasterBLL(); var ents = bllCharge.GetChargeApplyMasterRdListByExtenOrderID(strExtenOrderID); if (ents == null) { return; } decimal dCheckState = 0, dEditState = 0; dCheckState = Convert.ToDecimal(FBAEnums.CheckStates.UnApproved); dEditState = Convert.ToDecimal(FBAEnums.EditStates.UnActived); BudgetAccountBLL bllAccount = new BudgetAccountBLL(); foreach (T_FB_CHARGEAPPLYMASTER item in ents) { item.CHECKSTATES = Convert.ToInt32(dCheckState); item.EDITSTATES = Convert.ToInt32(dEditState); item.UPDATEDATE = DateTime.Now; bllCharge.Update(item); bllAccount.UpdateAccount(item, dCheckState); } } catch (Exception ex) { Utility.SaveLog(ex.ToString()); } }
protected void Button1_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); BudgetAccountBLL bll = new BudgetAccountBLL(); try { var data = GetEntities(); bll.BeginTransaction(); entityTypeList.ForEach(item => { data[item].ForEach(entity => { try { sb.AppendLine(item + " : " + entity.GetOrderID()); CheckStates cstates = (CheckStates)int.Parse(entity.GetValue(FieldName.CheckStates).ToString()); var master = (entity as T_FB_DEPTBUDGETSUMMASTER); if (master != null ) { if (!master.T_FB_DEPTBUDGETSUMDETAIL.IsLoaded) { master.T_FB_DEPTBUDGETSUMDETAIL.Load(); } master.T_FB_DEPTBUDGETSUMDETAIL.ToList().ForEach(itemd => { if (!itemd.T_FB_DEPTBUDGETAPPLYMASTERReference.IsLoaded) { itemd.T_FB_DEPTBUDGETAPPLYMASTERReference.Load(); } bll.UpdateAccount(itemd.T_FB_DEPTBUDGETAPPLYMASTER.ToFBEntity(), CheckStates.Approving); }); } bll.UpdateAccount(entity.ToFBEntity(), CheckStates.Approving); if (cstates == CheckStates.Approved) { bll.UpdateAccount(entity.ToFBEntity(), CheckStates.Approved); } } catch (Exception exx) { throw exx; } }); }); bll.CommitTransaction(); } catch (Exception ex) { bll.RollbackTransaction(); sb.AppendLine(); sb.AppendLine(ex.ToString()); } finally { this.tbRemark.Text = sb.ToString(); } }
public T_FB_BUDGETACCOUNT GetBudgetAccountByID(string strBudgetAccountId) { T_FB_BUDGETACCOUNT entRd = new T_FB_BUDGETACCOUNT(); using(BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { entRd = bllBudgetAccount.GetBudgetAccountByID(strBudgetAccountId); return entRd; } }
public void CreatePersonMoneyAssignInfo(string ASSIGNCOMPANYID, string SubmitUserID,string CreateUserid) { using (BudgetAccountBLL obll = new BudgetAccountBLL()) { obll.CreatePersonMoneyAssignInfo(ASSIGNCOMPANYID, SubmitUserID, CreateUserid); Tracer.Debug(string.Format("在{0} 系统生成活动经费:公司ID{1},SubmitUserID:{2}, CreateUserid:{3}", System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ASSIGNCOMPANYID, SubmitUserID, CreateUserid)); } }
public List<T_FB_BUDGETACCOUNT> GetBudgetAccountByPerson(string strOwnerID, string strOwnerPostID, string strOwnerCompanyID) { using(BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { List<T_FB_BUDGETACCOUNT> entList = bllBudgetAccount.GetBudgetAccountByPerson(strOwnerID, strOwnerPostID, strOwnerCompanyID); return entList.Count() > 0 ? entList : null; } }
protected void testGetPersonMoneyAssign_Click(object sender, EventArgs e) { SMT.FB.BLL.BudgetAccountBLL bll = new BudgetAccountBLL(); var masters = bll.GetPersonMoneyAssign(this.inputASSIGNCOMPANYID.Value, this.inputOWNERID.Value,""); List<FBEntity> resultList = new List<FBEntity>(); if (masters != null) { FBEntity fbResult = masters.ToFBEntity(); //处理岗位信息一栏 List<T_FB_PERSONMONEYASSIGNDETAIL> rlist = masters.T_FB_PERSONMONEYASSIGNDETAIL.ToList(); // rlist = obll.UpdatePostInfo(rlist); //按公司、部门排序 rlist = rlist.OrderBy(c => c.OWNERCOMPANYID).ThenBy(c => c.OWNERDEPARTMENTID).ToList(); fbResult.AddFBEntities<T_FB_PERSONMONEYASSIGNDETAIL>(rlist.ToFBEntityList()); resultList.Add(fbResult); this.GridView1.DataSource = masters.T_FB_PERSONMONEYASSIGNDETAIL.ToList(); this.DataBind(); } }
public List<EntityObject> GetEntities(string entityType) { using (BudgetAccountBLL bll = new BudgetAccountBLL()) { DateTime dtStart = DateTime.Parse(this.tbStart.Text); DateTime dtEnd = DateTime.Parse(this.tbEnd.Text); QueryExpression qeStart = new QueryExpression(); qeStart.PropertyName = FieldName.UpdateDate; qeStart.PropertyValue = this.tbStart.Text; qeStart.Operation = QueryExpression.Operations.GreaterThanOrEqual; QueryExpression qeEnd = new QueryExpression(); qeEnd.PropertyName = FieldName.UpdateDate; qeEnd.PropertyValue = this.tbEnd.Text; qeEnd.Operation = QueryExpression.Operations.LessThanOrEqual; QueryExpression qeCheckStatesPass = QueryExpression.Equal(FieldName.CheckStates, "2"); QueryExpression qeCheckStatesPassing = QueryExpression.Equal(FieldName.CheckStates, "1"); qeStart.RelatedExpression = qeEnd; qeEnd.RelatedExpression = qeCheckStatesPass; qeCheckStatesPass.RelatedType = QueryExpression.RelationType.Or; qeCheckStatesPass.RelatedExpression = qeCheckStatesPassing; qeStart.QueryType = entityType; qeStart.OrderByExpression = new OrderByExpression { OrderByType = OrderByType.Asc, PropertyName = FieldName.UpdateDate }; qeStart.IsNoTracking = true; return qeStart.Query(bll); } }
protected void Button1_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); BudgetAccountBLL bll = new BudgetAccountBLL(); try { var data = GetEntities(); bll.BeginTransaction(); entityTypeList.ForEach(item => { data[item].ForEach(entity => { try { sb.AppendLine(item + " : " + entity.GetOrderID()); CheckStates cstates = (CheckStates)int.Parse(entity.GetValue(FieldName.CheckStates).ToString()); var master = (entity as T_FB_DEPTBUDGETSUMMASTER); if (master != null) { if (!master.T_FB_DEPTBUDGETSUMDETAIL.IsLoaded) { master.T_FB_DEPTBUDGETSUMDETAIL.Load(); } master.T_FB_DEPTBUDGETSUMDETAIL.ToList().ForEach(itemd => { if (!itemd.T_FB_DEPTBUDGETAPPLYMASTERReference.IsLoaded) { itemd.T_FB_DEPTBUDGETAPPLYMASTERReference.Load(); } bll.UpdateAccount(itemd.T_FB_DEPTBUDGETAPPLYMASTER.ToFBEntity(), CheckStates.Approving); }); } bll.UpdateAccount(entity.ToFBEntity(), CheckStates.Approving); if (cstates == CheckStates.Approved) { bll.UpdateAccount(entity.ToFBEntity(), CheckStates.Approved); } } catch (Exception exx) { throw exx; } }); }); bll.CommitTransaction(); } catch (Exception ex) { bll.RollbackTransaction(); sb.AppendLine(); sb.AppendLine(ex.ToString()); } finally { this.tbRemark.Text = sb.ToString(); } }
public List<T_FB_BUDGETACCOUNT> GetBudgetAccountListByMultSearch(string strFilter, List<object> objArgs, string strSortKey, int pageIndex, int pageSize, ref int pageCount, string accountType) { IList<T_FB_BUDGETACCOUNT> entList = new List<T_FB_BUDGETACCOUNT>(); using(BudgetAccountBLL bllBudgetAccount = new BudgetAccountBLL()) { entList = bllBudgetAccount.GetBudgetAccountRdListByMultSearch(strFilter, objArgs, strSortKey, pageIndex, pageSize, ref pageCount, accountType).ToList(); return entList.Count() > 0 ? entList.ToList() : null; } }