protected void btnTest_Click(object sender, EventArgs e) { FBCommonService s = new FBCommonService(); QueryExpression qe = new QueryExpression() { QueryType = typeof(T_FB_COMPANYBUDGETAPPLYMASTER).Name }; var data = s.QueryFBEntities(qe); this.GridView1.DataSource = data; DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //return; FBCommonService fbCommonService = new FBCommonService(); EntityInfoList = fbCommonService.GetEntityInfoList(); if (!IsPostBack) { this.ddlOrderType.DataTextField = "Type"; this.ddlOrderType.DataValueField = "Type"; this.ddlOrderType.DataSource = EntityInfoList; this.DataBind(); BindMobileDpd(dpdMobileEntityList, "Type", "Type", EntityInfoList); } }
protected void Page_Load(object sender, EventArgs e) { entityTypeList.Add(typeof(T_FB_COMPANYBUDGETSUMMASTER).Name); entityTypeList.Add(typeof(T_FB_COMPANYBUDGETMODMASTER).Name); entityTypeList.Add(typeof(T_FB_COMPANYTRANSFERMASTER).Name); entityTypeList.Add(typeof(T_FB_DEPTBUDGETSUMMASTER).Name); entityTypeList.Add(typeof(T_FB_DEPTBUDGETADDMASTER).Name); entityTypeList.Add(typeof(T_FB_DEPTTRANSFERMASTER).Name); entityTypeList.Add(typeof(T_FB_PERSONMONEYASSIGNMASTER).Name); entityTypeList.Add(typeof(T_FB_BORROWAPPLYMASTER).Name); entityTypeList.Add(typeof(T_FB_REPAYAPPLYMASTER).Name); entityTypeList.Add(typeof(T_FB_CHARGEAPPLYMASTER).Name); entityTypeList.Add(typeof(T_FB_TRAVELEXPAPPLYMASTER).Name); FBCommonService fs = new FBCommonService(); }
protected void btnDeptDetail_Click(object sender, EventArgs e) { // 预算月份 //DateTime dtBudgetDate = DateTime.Parse(); //string dataValue = dtBudgetDate.ToString("yyyy-MM-dd"); QueryExpression qeMonth = QueryExpression.Equal("BUDGETARYMONTH", this.txtMonth.Text); qeMonth.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; // 预算部门 QueryExpression qeDept = QueryExpression.Equal("OWNERDEPARTMENTID", this.txtDeptID.Text); qeDept.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; qeDept.RelatedExpression = qeMonth; FBCommonService fbService = new FBCommonService(); var resultList = fbService.QueryFBEntities(qeDept); this.GridView1.DataSource = resultList.ToEntityList<T_FB_DEPTBUDGETAPPLYDETAIL>(); DataBind(); }
protected void btnDeptDetail_Click(object sender, EventArgs e) { // 预算月份 //DateTime dtBudgetDate = DateTime.Parse(); //string dataValue = dtBudgetDate.ToString("yyyy-MM-dd"); QueryExpression qeMonth = QueryExpression.Equal("BUDGETARYMONTH", this.txtMonth.Text); qeMonth.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; // 预算部门 QueryExpression qeDept = QueryExpression.Equal("OWNERDEPARTMENTID", this.txtDeptID.Text); qeDept.QueryType = typeof(T_FB_DEPTBUDGETAPPLYDETAIL).Name; qeDept.RelatedExpression = qeMonth; FBCommonService fbService = new FBCommonService(); var resultList = fbService.QueryFBEntities(qeDept); this.GridView1.DataSource = resultList.ToEntityList <T_FB_DEPTBUDGETAPPLYDETAIL>(); DataBind(); }
public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg) { int i = -1; try { SystemBLL.Debug("UpdateCheckState方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates); // begin 用于出差报销、事项审批的手机提交 if (strModelCode == "Travel") { var tempResult = UpdateExtensionOrder(strModelCode, orderID, strCheckStates, ref strMsg); return((tempResult == null) ? -1 : 1); } // end FBCommonService fbCommonService = new FBCommonService(); List <EntityInfo> EntityInfoList = fbCommonService.GetEntityInfoList(); if (EntityInfoList == null) { strMsg = "预算服务初始化异常,请重试。"; return(-1); } if (EntityInfoList.Count() == 0) { strMsg = "预算服务初始化异常,请重试。"; return(-1); } string strTypeName = ""; string strKeyName = ""; CheckStates cs = CheckStates.UnSubmit; switch (strCheckStates) { case "1": cs = CheckStates.Approving; break; case "2": cs = CheckStates.Approved; break; case "3": cs = CheckStates.UnApproved; break; default: break; } var entityInfo = EntityInfoList.Where(t => t.Type == strModelCode).FirstOrDefault(); strTypeName = entityInfo.Type; strKeyName = entityInfo.KeyName; /////add 2012.12.12 /////传入报销月份为时间去和当前时间判断,如果不在同一年 /////说明该报销单是跨年的,则不能进行审核操作,即当年的报销单只能在当年进行报销 //if (dNewCheckStates == FBAEnums.CheckStates.Approved || dNewCheckStates == FBAEnums.CheckStates.Approving) //{ // if (IsOverYear(entity.BUDGETARYMONTH)) // { // strMsg = "报销单跨年后只能终审不通过(财务规定)"; // Tracer.Debug(strMsg); // return; // } //} using (FBCommonBLL bllCommon = new FBCommonBLL()) { bllCommon.BeginTransaction(); SystemBLL.Debug("BeginTransaction " + strModelCode + " 的单据[" + orderID + "]"); try { QueryExpression qe = QueryExpression.Equal(strKeyName, orderID); qe.QueryType = strTypeName; var data = qe.Query(bllCommon); var order = data.FirstOrDefault(); if (order == null) { strMsg = "没有可操作的数据"; return(-1); } bllCommon.AuditFBEntityWithoutFlow(order, cs, ref strMsg); i = 1; if (string.IsNullOrEmpty(strMsg)) { bllCommon.CommitTransaction(); SystemBLL.Debug("CommitTransaction " + strModelCode + " 的单据[" + orderID + "]"); } else { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); } } catch (Exception ex) { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw ex; } } } catch (Exception ex) { strMsg = "单据审核异常,请联系管理员"; throw ex; } // 把消息通过异常机制返回 if (!string.IsNullOrWhiteSpace(strMsg)) { SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw new Exception(strMsg); } return(i); }
public int UpdateCheckState(string strModelCode, string orderID, string strCheckStates, ref string strMsg) { int i = -1; try { SystemBLL.Debug("UpdateCheckState方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates); // begin 用于出差报销、事项审批的手机提交 if (strModelCode == "Travel") { var tempResult = UpdateExtensionOrder(strModelCode, orderID, strCheckStates, ref strMsg); return (tempResult == null) ? -1 : 1; } // end FBCommonService fbCommonService = new FBCommonService(); List<EntityInfo> EntityInfoList = fbCommonService.GetEntityInfoList(); if (EntityInfoList == null) { strMsg = "预算服务初始化异常,请重试。"; return -1; } if (EntityInfoList.Count() == 0) { strMsg = "预算服务初始化异常,请重试。"; return -1; } string strTypeName = ""; string strKeyName = ""; CheckStates cs = CheckStates.UnSubmit; switch (strCheckStates) { case "1": cs = CheckStates.Approving; break; case "2": cs = CheckStates.Approved; break; case "3": cs = CheckStates.UnApproved; break; default: break; } var entityInfo = EntityInfoList.Where(t => t.Type == strModelCode).FirstOrDefault(); strTypeName = entityInfo.Type; strKeyName = entityInfo.KeyName; /////add 2012.12.12 /////传入报销月份为时间去和当前时间判断,如果不在同一年 /////说明该报销单是跨年的,则不能进行审核操作,即当年的报销单只能在当年进行报销 //if (dNewCheckStates == FBAEnums.CheckStates.Approved || dNewCheckStates == FBAEnums.CheckStates.Approving) //{ // if (IsOverYear(entity.BUDGETARYMONTH)) // { // strMsg = "报销单跨年后只能终审不通过(财务规定)"; // Tracer.Debug(strMsg); // return; // } //} using (FBCommonBLL bllCommon = new FBCommonBLL()) { bllCommon.BeginTransaction(); SystemBLL.Debug("BeginTransaction "+ strModelCode + " 的单据[" + orderID + "]"); try { QueryExpression qe = QueryExpression.Equal(strKeyName, orderID); qe.QueryType = strTypeName; var data = qe.Query(bllCommon); var order = data.FirstOrDefault(); if (order == null) { strMsg = "没有可操作的数据"; return -1; } bllCommon.AuditFBEntityWithoutFlow(order, cs, ref strMsg); i = 1; if (string.IsNullOrEmpty(strMsg)) { bllCommon.CommitTransaction(); SystemBLL.Debug("CommitTransaction " + strModelCode + " 的单据[" + orderID + "]"); } else { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); } } catch (Exception ex) { bllCommon.RollbackTransaction(); SystemBLL.Debug("RollbackTransaction 审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw ex; } } } catch (Exception ex) { strMsg = "单据审核异常,请联系管理员"; throw ex; } // 把消息通过异常机制返回 if (!string.IsNullOrWhiteSpace(strMsg)) { SystemBLL.Debug("审核" + strModelCode + "的单据[" + orderID + "]失败,提示消息为:" + strMsg); throw new Exception(strMsg); } return i; }