Exemplo n.º 1
0
        /// <summary>
        /// 准备流程所需的插入数据
        /// </summary>
        /// <param name="leaveRequestItemID"></param>
        /// <returns></returns>
        private LeaveRequestFlow PrepareLeaveRequestFlow(int leaveRequestItemID)
        {
            LeaveRequestFlow leaveRequestFlow = new LeaveRequestFlow();

            leaveRequestFlow.LeaveRequestItem   = new LeaveRequestItem(leaveRequestItemID);
            leaveRequestFlow.LeaveRequestStatus = _RequestStatus;
            leaveRequestFlow.Account            = new Account(_OperatorID, "", "");
            leaveRequestFlow.OperationTime      = DateTime.Now;
            leaveRequestFlow.Remark             = _Reason;
            return(leaveRequestFlow);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 准备流程所需的插入数据
        /// </summary>
        /// <returns></returns>
        private LeaveRequestFlow PrepareLeaveRequestFlow(LeaveRequestItem item)
        {
            LeaveRequestFlow leaveRequestFlow = new LeaveRequestFlow();

            leaveRequestFlow.LeaveRequestStatus = item.Status;
            leaveRequestFlow.Account            = _LeaveRequest.Account;
            leaveRequestFlow.LeaveRequestItem   = item;
            leaveRequestFlow.OperationTime      = _LeaveRequest.SubmitDate;
            leaveRequestFlow.Remark             = _LeaveRequest.Reason;
            return(leaveRequestFlow);
        }
Exemplo n.º 3
0
        private void AddItemFlowForAutoCancel(LeaveRequestItem item)
        {
            LeaveRequestFlow leaveRequestFlow = new LeaveRequestFlow();

            leaveRequestFlow.LeaveRequestItem   = item;
            leaveRequestFlow.LeaveRequestStatus = item.Status;
            leaveRequestFlow.Account            = _OldLeaveRequest.Account;
            leaveRequestFlow.OperationTime      = DateTime.Now;
            leaveRequestFlow.Remark             = _OldLeaveRequest.Account.Name + "已经重新编辑请假单" + _OldLeaveRequest.PKID +
                                                  ",系统自动批准取消,并退回年假调休记录。";
            _DalLeaveRequestFlow.InsertLeaveRequestFlow(leaveRequestFlow);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 员工提交请假申请
        /// </summary>
        /// <param name="leaveRequestFlow"></param>
        /// <returns></returns>
        public int InsertLeaveRequestFlow(LeaveRequestFlow leaveRequestFlow)
        {
            int        pkid;
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_ParmLeaveRequestItemID, SqlDbType.Int).Value    = leaveRequestFlow.LeaveRequestItem.LeaveRequestItemID;
            cmd.Parameters.Add(_ParmOperatorID, SqlDbType.Int).Value            = leaveRequestFlow.Account.Id;
            cmd.Parameters.Add(_ParmOperationTime, SqlDbType.DateTime).Value    = leaveRequestFlow.OperationTime;
            cmd.Parameters.Add(_ParmLeaveRequestOperation, SqlDbType.Int).Value = leaveRequestFlow.LeaveRequestStatus.Id;
            cmd.Parameters.Add(_ParmRemark, SqlDbType.Text).Value  = leaveRequestFlow.Remark;
            cmd.Parameters.Add(_ParmPKID, SqlDbType.Int).Direction = ParameterDirection.Output;
            SqlHelper.ExecuteNonQueryReturnPKID("InsertLeaveRequestFlow", cmd, out pkid);
            return(pkid);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据PKID查询请假单
        /// </summary>
        /// <param name="leaveRequestItemID"></param>
        /// <returns></returns>
        public List <LeaveRequestFlow> GetLeaveRequestFlowByLeaveRequestItemID(int leaveRequestItemID)
        {
            List <LeaveRequestFlow> iRet = new List <LeaveRequestFlow>();
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_ParmLeaveRequestItemID, SqlDbType.Int).Value = leaveRequestItemID;
            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetLeaveRequestFlowByLeaveRequestItemID", cmd))
            {
                while (sdr.Read())
                {
                    LeaveRequestFlow leaveRequestFlow = new LeaveRequestFlow();
                    leaveRequestFlow.LeaveRequestFlowID = (int)sdr[_DBPKID];
                    leaveRequestFlow.Account            = new Account((int)sdr[_DBOperatorID], "", "");
                    leaveRequestFlow.LeaveRequestItem   =
                        new LeaveRequestItem((int)sdr[_DBLeaveRequestItemID], Convert.ToDateTime("1900-1-1"),
                                             Convert.ToDateTime("1900-1-1"), 0, RequestStatus.All);
                    leaveRequestFlow.LeaveRequestStatus = RequestStatus.FindRequestStatus((Int32)sdr[_DBOperation]);
                    leaveRequestFlow.OperationTime      = Convert.ToDateTime(sdr[_DBOperationTime]);
                    iRet.Add(leaveRequestFlow);
                }
                return(iRet);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 根据PKID查询请假单
        /// </summary>
        /// <param name="pkid"></param>
        /// <returns></returns>
        public LeaveRequestFlow GetLeaveRequestFlowByPKID(int pkid)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_ParmPKID, SqlDbType.Int).Value = pkid;
            using (SqlDataReader sdr = SqlHelper.ExecuteReader("GetLeaveRequestFlowByPKID", cmd))
            {
                while (sdr.Read())
                {
                    LeaveRequestFlow leaveRequestFlow = new LeaveRequestFlow();
                    leaveRequestFlow.LeaveRequestFlowID = pkid;
                    leaveRequestFlow.Account            = new Account((int)sdr[_DBOperatorID], "", "");
                    leaveRequestFlow.LeaveRequestItem   =
                        new LeaveRequestItem((int)sdr[_DBLeaveRequestItemID], Convert.ToDateTime("1900-1-1"),
                                             Convert.ToDateTime("1900-1-1"), 0, RequestStatus.All);
                    leaveRequestFlow.LeaveRequestStatus = RequestStatus.FindRequestStatus((Int32)sdr[_DBOperation]);
                    leaveRequestFlow.OperationTime      = Convert.ToDateTime(sdr[_DBOperationTime]);
                    leaveRequestFlow.Remark             = sdr[_DBRemark].ToString();

                    return(leaveRequestFlow);
                }
                return(null);
            }
        }