Ejemplo n.º 1
0
        /// <summary>
        /// 保存实体
        /// </summary>
        /// <param name="fbEntityList"></param>
        /// <returns></returns>
        public SaveResult Save(SaveEntity saveEntity)
        {

            SaveResult result = new SaveResult();
            try
            {
                result.FBEntity = base.SaveEntityBLLSave(saveEntity);
                result.Successful = true;
            }
            catch (FBBLLException ex)
            {
                result.Successful = false;
                result.Exception = ex.Message;
                SystemBLL.Debug(ex.ToString());

            }
            return result;
        }
Ejemplo n.º 2
0
        public T_FB_EXTENSIONALORDER UpdateExtensionOrder(string strModelCode, string orderID, string strCheckStates, ref string strMsg)
        {
            string travelCode = string.Empty;
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                try
                {
                    SystemBLL.Debug("UpdateExtensionOrder方法已被调用,参数:strModelCode: " + strModelCode + ", orderID: " + orderID + ", strCheckStates: " + strCheckStates);

                    QueryExpression queryExpression = QueryExpression.Equal("ORDERID", orderID);

                    if (strModelCode == "Travel")
                    {
                        travelCode = strMsg;
                        strMsg = string.Empty;
                        QueryExpression tempQE = QueryExpression.Equal("TravelSubject", "1");

                        tempQE.RelatedExpression = QueryExpression.Equal("EXTENSIONALTYPECODE", "CCPX");
                        queryExpression.RelatedExpression = tempQE;
                    }
                    //查出保存的外部单据
                    queryExpression.QueryType = typeof(T_FB_EXTENSIONALORDER).Name;
                    queryExpression.IsNoTracking = true;
                    List<FBEntity> listDetail = fbCommonBLL.QueryFBEntities(queryExpression);
                    //如果存在外部单据
                    if (listDetail.Count > 0)
                    {
                        var saveFBEntity = listDetail[0];
                        saveFBEntity.Entity.SetValue("CHECKSTATES", Decimal.Parse(strCheckStates));
                        saveFBEntity.Entity.SetValue("INNERORDERCODE", travelCode);
                        Tracer.Debug("出差更新预算单据,传入的单据编号为:"+travelCode);
                        saveFBEntity.FBEntityState = FBEntityState.Modified;
                        //var temp = fbCommonBLL.FBCommSaveEntity(listDetail[0]);
                        SaveResult temp = new SaveResult();
                        try
                        {
                            temp.FBEntity = fbCommonBLL.SaveT_FB_EXTENSIONALORDER(listDetail[0]);
                            temp.Successful = true;
                        }
                        catch(Exception ex)
                        {
                            temp.Exception = ex.Message;
                            temp.Successful = false;
                        }
                         
                        if (temp.Successful)
                        {
                            return temp.FBEntity.Entity as T_FB_EXTENSIONALORDER;
                        }
                        else
                        {
                            strMsg = temp.Exception;
                        }
                    }
                    else
                    {
                        strMsg = "没有可操作的数据";
                    }
                }
                catch (Exception ex)
                {
                    strMsg = ex.Message;
                    if (!(ex is FBBLLException))
                    {
                        // strMsg = "单据审核异常,请联系管理员";
                        Tracer.Debug("审核" + strModelCode + "的单据[" + orderID + "]出现异常,错误消息为:" + ex.ToString());
                    }
                }
                return null;
            }
        }
Ejemplo n.º 3
0
        public SaveResult Save(SaveEntity saveEntity)
        {
            using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
            {
                SaveResult result = new SaveResult();
                try
                {
                    result = fbCommonBLL.Save(saveEntity);
                }
                catch (Exception ex)
                {
                    result.Successful = false;
                    result.Exception = ex.Message;
                    Tracer.Debug(ex.ToString());

                }
                return result;
            }
        }
Ejemplo n.º 4
0
 public SaveResult Save(FBEntity fbEntity)
 {
     SaveResult result = new SaveResult();
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             result = fbCommonBLL.FBCommSaveEntity(fbEntity);
         }
     }
     catch (Exception ex)
     {
         result.Successful = false;
         result.Exception = ex.Message;
     }
     return result;
 }
Ejemplo n.º 5
0
 public SaveResult Save(FBEntity fbEntity,CurrentUserPost user)
 {
     SaveResult result = new SaveResult();
     try
     {
         using (FBCommonBLL fbCommonBLL = new FBCommonBLL())
         {
             fbCommonBLL.user = user;
             fbCommonBLL.BeginTransaction();
             result = fbCommonBLL.FBCommSaveEntity(fbEntity);
             if (result.Successful)
             {
                 fbCommonBLL.CommitTransaction();
             }
         }
     }
     catch (Exception ex)
     {
         result.Successful = false;
         result.Exception = ex.Message;
         Tracer.Debug(ex.ToString());
     }
     return result;
 }