public bool DeleteApporvalTempletsByIDs(List <string> IDs)
 {
     using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     {
         return(approvalBll.DeleteApporvalTempletsByIDs(IDs));
     }
 }
 private T_OA_APPROVALINFOTEMPLET Get_ApporvalTempletByApporvalType(string id)
 {
     ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
     //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     //{
     return approvalBll.Get_ApporvalTempletByApporvalType(id);
     //}
 }
        private T_OA_APPROVALINFOTEMPLET Get_ApporvalTempletByApporvalType(string id)
        {
            ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();

            //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
            //{
            return(approvalBll.Get_ApporvalTempletByApporvalType(id));
            //}
        }
        public bool DeleteApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo)
        {
            ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();

            //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
            //{
            return(approvalBll.DeleteApprovalTemplet(approvakInfo));
            //}
        }
        public List <T_OA_APPROVALINFOTEMPLET> GetApporvalTempletList(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, string flagState, LoginUserInfo loginUserInfo)//0待审核  1已审核
        {
            ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();

            //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
            //{
            if (flagState != "4")//草稿,审核完成(已过,未过)   建立人操作
            {
                IQueryable <T_OA_APPROVALINFOTEMPLET> approvalList = approvalBll.GetApprovalTempletList(pageIndex, pageSize, sort, filterString, paras, ref pageCount, loginUserInfo.userID, null, flagState);
                if (approvalList == null)
                {
                    return(null);
                }
                else
                {
                    return(approvalList.ToList());
                }
            }
            else//审批人
            {
                ServiceClient workFlowWS = new ServiceClient();
                string        isView     = "1";
                if (flagState == "4")
                {
                    isView = "0";
                }
                FLOW_FLOWRECORDDETAIL_T[] flowList = workFlowWS.GetFlowInfo("", "", "1", "0", "T_OA_APPROVALINFOTEMPLET", "", loginUserInfo.userID);
                if (flowList == null)
                {
                    return(null);
                }
                List <string> guidStringList = new List <string>();
                foreach (FLOW_FLOWRECORDDETAIL_T f in flowList)
                {
                    guidStringList.Add(f.FLOW_FLOWRECORDMASTER_T.FORMID);
                }
                if (guidStringList.Count < 1)
                {
                    return(null);
                }
                IQueryable <T_OA_APPROVALINFOTEMPLET> approList = approvalBll.GetApprovalTempletList(pageIndex, pageSize, sort, filterString, paras, ref pageCount, loginUserInfo.userID, guidStringList, flagState);
                if (approList == null)
                {
                    return(null);
                }
                else
                {
                    return(approList.ToList());
                }
            }
            //}
        }
 public List<T_OA_APPROVALINFOTEMPLET> GetApporvalTempletList(int pageIndex, int pageSize, string sort, string filterString, object[] paras, ref int pageCount, string flagState, LoginUserInfo loginUserInfo)//0待审核  1已审核
 {
     ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
     //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     //{
     if (flagState != "4")//草稿,审核完成(已过,未过)   建立人操作
     {
         IQueryable<T_OA_APPROVALINFOTEMPLET> approvalList = approvalBll.GetApprovalTempletList(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, null, flagState);
         if (approvalList == null)
         {
             return null;
         }
         else
         {
             return approvalList.ToList();
         }
     }
     else//审批人
     {
         ServiceClient workFlowWS = new ServiceClient();
         string isView = "1";
         if (flagState == "4")
         {
             isView = "0";
         }
         FLOW_FLOWRECORDDETAIL_T[] flowList = workFlowWS.GetFlowInfo("", "", "1", "0", "T_OA_APPROVALINFOTEMPLET", "", loginUserInfo.userID);
         if (flowList == null)
         {
             return null;
         }
         List<string> guidStringList = new List<string>();
         foreach (FLOW_FLOWRECORDDETAIL_T f in flowList)
         {
             guidStringList.Add(f.FLOW_FLOWRECORDMASTER_T.FORMID);
         }
         if (guidStringList.Count < 1)
         {
             return null;
         }
         IQueryable<T_OA_APPROVALINFOTEMPLET> approList = approvalBll.GetApprovalTempletList(pageIndex, pageSize, sort, filterString, paras, ref  pageCount, loginUserInfo.userID, guidStringList, flagState);
         if (approList == null)
         {
             return null;
         }
         else
         {
             return approList.ToList();
         }
     }
     //}
 }
        public int DeleteApporvalTempletList(List <T_OA_APPROVALINFOTEMPLET> approvakInfo)
        {
            ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();

            //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
            //{
            foreach (T_OA_APPROVALINFOTEMPLET obj in approvakInfo)
            {
                if (!approvalBll.DeleteApprovalTemplet(obj))
                {
                    return(-1);
                }
            }
            return(1);
            //}
        }
        public int UpdateApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo)
        {
            ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();

            //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
            //{
            if (approvalBll.UpdateApprovalTemplet(approvakInfo) != -1)
            {
                return(1);
            }
            else
            {
                return(-1);
            }
            //}
        }
 public int AddApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo, ref string ApprovalCode)
 {
     try
     {
         ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
         //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
         //{
         bool sucess = approvalBll.AddApprovalTemplet(approvakInfo, ref ApprovalCode);
         if (sucess == false)
         {
             return(-1);
         }
         return(1);
     }
     catch (Exception ex)
     {
         Tracer.Debug(ex.ToString());
         return(0);
     }
     //}
 }
 public int DeleteApporvalTempletList(List<T_OA_APPROVALINFOTEMPLET> approvakInfo)
 {
     ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
     //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     //{
     foreach (T_OA_APPROVALINFOTEMPLET obj in approvakInfo)
     {
         if (!approvalBll.DeleteApprovalTemplet(obj))
         {
             return -1;
         }
     }
     return 1;
     //}
 }
 public int UpdateApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo)
 {
     ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
     //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     //{
     if (approvalBll.UpdateApprovalTemplet(approvakInfo) != -1)
         return 1;
     else
         return -1;
     //}
 }
 public bool DeleteApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo)
 {
     ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
     //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     //{
     return approvalBll.DeleteApprovalTemplet(approvakInfo);
     //}
 }
 public int AddApporvalTemplet(T_OA_APPROVALINFOTEMPLET approvakInfo,ref string ApprovalCode)
 {
     try
     {
         ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll();
         //using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
         //{
         bool sucess = approvalBll.AddApprovalTemplet(approvakInfo, ref ApprovalCode);
         if (sucess == false)
             return -1;
         return 1;
     }
     catch (Exception ex)
     {                
         Tracer.Debug(ex.ToString());
         return 0;
     }
     //}
 }
 public bool DeleteApporvalTempletsByIDs(List<string> IDs)
 {            
     using (ApprovalTempletManagementBll approvalBll = new ApprovalTempletManagementBll())
     {
         return approvalBll.DeleteApporvalTempletsByIDs(IDs);                
     }
 }