Exemplo n.º 1
0
 /// <summary>
 /// 获取出差方案设置
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Travelmanagement_GetTravelSolutionByCompanyIDCompleted(object sender, GetTravelSolutionByCompanyIDCompletedEventArgs e)
 {
     try
     {
         if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
         {
             if (e.UserState != null)
             {
                 Button btn = e.UserState as Button;
                 btn.IsEnabled = true;
             }
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr(e.Error.Message), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
         }
         if (e.Result != null)
         {
             travelsolutions = e.Result;//出差方案
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "没有找到对应的出差方案,不能产生出差报销单", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
         }
         if (e.PlaneObj != null)
         {
             cantaketheplaneline = e.PlaneObj.ToList();//乘坐飞机线路设置
         }
         if (e.StandardObj != null)
         {
             takethestandardtransport = e.StandardObj.ToList();//乘坐交通工具设置
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "没有获取到交通工具设置,不能产生出差报销单", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
         }
         Travelmanagement.GetTravleAreaAllowanceByPostValueAsync(postLevel, travelsolutions.TRAVELSOLUTIONSID, null, e.UserState);
     }
     catch (Exception ex)
     {
         if (e.UserState != null)
         {
             Button btn = e.UserState as Button;
             btn.IsEnabled = true;
         }
         Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 根据当前用户的岗位级别与方案设置的岗位级别匹配,确认该出差人是否能够申请借款
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Travelmanagement_GetTravelSolutionByCompanyIDCompleted(object sender, GetTravelSolutionByCompanyIDCompletedEventArgs e)
 {
     try
     {
         travelsolutions_Golbal = new T_OA_TRAVELSOLUTIONS();
         if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
         {
             RefreshUI(RefreshedTypes.HideProgressBar);
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr(e.Error.Message), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
         }
         if (e.Result != null)
         {
             travelsolutions_Golbal = e.Result;//出差方案
         }
         if (Master_Golbal.POSTLEVEL.ToInt32() <= travelsolutions_Golbal.RANGEPOSTLEVEL.ToInt32())
         {
             fbCtr.IsEnabled = false;//如果当前用户的级别与方案设置的"报销范围级别"相同则不能申请费用
         }
         if (e.PlaneObj != null)
         {
             cantaketheplaneline = e.PlaneObj.ToList();//乘坐飞机线路设置
         }
         if (e.StandardObj != null)
         {
             //交通工具乘坐标准
             transportToolStand = e.StandardObj.ToList();//乘坐交通工具标准设置
         }
         RefreshUI(RefreshedTypes.ShowProgressBar);
         OaPersonOfficeClient.GetTravleAreaAllowanceByPostValueAsync(Master_Golbal.POSTLEVEL, travelsolutions_Golbal.TRAVELSOLUTIONSID, null);
     }
     catch (Exception ex)
     {
         RefreshUI(RefreshedTypes.HideProgressBar);
         Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
     }
 }
 /// <summary>
 /// 获取出差方案设置
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Travelmanagement_GetTravelSolutionByCompanyIDCompleted(object sender, GetTravelSolutionByCompanyIDCompletedEventArgs e)
 {
     try
     {
         if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
         {
             if (e.UserState != null)
             {
                 Button btn = e.UserState as Button;
                 btn.IsEnabled = true;
             }
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr(e.Error.Message), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information);
         }
         if (e.Result != null)
         {
             travelsolutions = e.Result;//出差方案
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "没有找到对应的出差方案,不能产生出差报销单", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
         }
         if (e.PlaneObj != null)
         {
             cantaketheplaneline = e.PlaneObj.ToList();//乘坐飞机线路设置
         }
         if (e.StandardObj != null)
         {
             takethestandardtransport = e.StandardObj.ToList();//乘坐交通工具设置
         }
         else
         {
             ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "没有获取到交通工具设置,不能产生出差报销单", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
         }
         Travelmanagement.GetTravleAreaAllowanceByPostValueAsync(postLevel, travelsolutions.TRAVELSOLUTIONSID, null, e.UserState);
     }
     catch (Exception ex)
     {
         if (e.UserState != null)
         {
             Button btn = e.UserState as Button;
             btn.IsEnabled = true;
         }
         Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
         ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
     }
 }
        /// <summary>
        /// 获取出差方案
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void TrC_GetTravelSolutionByCompanyIDCompleted(object sender, GetTravelSolutionByCompanyIDCompletedEventArgs e)//判断能否乘坐哪种类型的交通工具及级别
        {
            try
            {
                if (e.Error != null && !string.IsNullOrEmpty(e.Error.Message))
                {
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), e.Error.Message);
                }
                if (e.Result != null)
                {

                    travelsolutions = e.Result;//出差方案
                }
                else
                {
                    RefreshUI(RefreshedTypes.HideProgressBar);
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "您公司没有关联出差方案,请关联一套出差方案以便报销", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                }
                if (e.PlaneObj != null)
                {
                    cantaketheplaneline = e.PlaneObj.ToList();//乘坐飞机线路设置
                }
                if (e.StandardObj != null)
                {
                    if (e.StandardObj.Count() > 0)
                    {
                        takethestandardtransport = e.StandardObj.ToList();//乘坐交通工具设置
                    }
                    else
                    {
                        ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "出差方案中没有关联对应的交通工具设置", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                    }
                }
                else
                {
                    ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), "出差方案中没有关联对应的交通工具设置", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
                }
                RefreshUI(RefreshedTypes.ShowProgressBar);
                OaPersonOfficeClient.GetTravleAreaAllowanceByPostValueAsync(EmployeePostLevel, travelsolutions.TRAVELSOLUTIONSID, null);
            }
            catch (Exception ex)
            {
                RefreshUI(RefreshedTypes.HideProgressBar);
                Logger.Current.Log(ex.Message, Category.Debug, Priority.Low);
                ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation);
            }
            finally
            {
                //计算一次出差天数并保存在明细表中,以解决出差申请自动生成出差报销未计算出差天数问题。
                TravelTime();
            }
        }