Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }

           
         
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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;
        }