예제 #1
0
        /// <summary>
        /// 更新计划工时
        /// </summary>
        /// <param name="pMissionId"></param>
        /// <param name="pWorkHour"></param>
        /// <returns></returns>
        public bool UpdateWorkHour(int pMissionId, int pWorkHour)
        {
            bool _Result = true;

            try
            {
                OleDbParameter[] parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_MissionId, OleDbType.Integer),
                    new OleDbParameter(Parm_WorkHour, OleDbType.Integer)
                };
                parms[0].Value = pMissionId;
                parms[1].Value = pWorkHour;

                string sql = SQL_Update_WorkHour;
                AccessHelper.ExecuteNonQuery(AccessHelper.CONN_STRING, CommandType.Text, sql, parms);
            }
            catch (Exception ex)
            {
                _Result = false;
                throw ex;
            }

            return(_Result);
        }
예제 #2
0
        /// <summary>
        /// 获取分页的总个数
        /// </summary>
        /// <param name="DocType">文档类别</param>
        /// <param name="BeginTime">开始时间</param>
        /// <param name="EndTime">结束时间</param>
        /// <param name="KeyWord">标题关键字</param>
        /// <returns></returns>
        public int GetFileFYCount(string DocType, string BeginTime, string EndTime, string KeyWord)
        {
            int    resultNum  = 0;
            string tempSqlStr = "";

            try
            {
                OleDbParameter[] parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_WriteDate, OleDbType.VarChar, 200),
                    new OleDbParameter(Parm_EndTime, OleDbType.VarChar, 200)
                };
                parms[0].Value = BeginTime;
                parms[1].Value = EndTime;

                tempSqlStr += " and FileTitle like '%" + KeyWord + "%'";

                if (DocType != "全部")
                {
                    tempSqlStr += " and FileType='" + DocType + "'";
                }

                string sql = string.Format(SQL_Select_FileCount, tempSqlStr);

                using (OleDbDataReader sdr = AccessHelper.ExecuteReader(AccessHelper.CONN_STRING, CommandType.Text, sql, parms))
                {
                    while (sdr.Read())
                    {
                        resultNum = int.Parse(sdr["resultCount"].ToString());  //表示普通
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(resultNum);
        }
예제 #3
0
        public List <string> GetNoWriteList(ref string beginTime)
        {
            DateTime    _begin       = Convert.ToDateTime(beginTime);
            int         i            = 30;
            NetRestDate _netRestDate = new NetRestDate();

            while (i > 0)
            {
                i--;

                int _dateCount = _netRestDate.GetRestDateCount(_begin.ToShortDateString());
                if (_dateCount > 0)
                {
                    _begin = _begin.AddDays(-1);
                }
                else
                {
                    break;
                }
            }
            beginTime = _begin.ToString("yyyy-MM-dd");


            DataSet       objDs     = new DataSet("reslut");
            List <string> _nameList = new List <string>();

            try
            {
                OleDbParameter[] parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_WriteTime, OleDbType.VarChar)
                };
                parms[0].Value = _begin.ToString("yyyy-MM-dd");

                objDs = AccessHelper.ExcuteDataSet(AccessHelper.CONN_STRING, CommandType.Text, SQL_Select_JournalIsWC, parms);
            }
            catch (Exception ex)
            {
            }


            if (objDs == null || objDs.Tables.Count == 0)
            {
                return(null);
            }

            int _count = objDs.Tables[0].Rows.Count;

            if (_count > 0)
            {
                //NetRestDate _netRestDate = new NetRestDate();
                DataSet _nameDS = _netRestDate.GetUserIdDataSetByRestDate(_begin.ToString("yyyy-MM-dd"));

                for (int j = 0; j < _count; j++)
                {
                    string _userId = objDs.Tables[0].Rows[j]["userid"].ToString();

                    if (!this.IsNameInRestNameList(_userId, _nameDS))
                    {
                        _nameList.Add(objDs.Tables[0].Rows[j]["realName"].ToString());
                    }
                }
            }
            return(_nameList);
        }
예제 #4
0
        /// <summary>
        ///  获取假日
        /// </summary>
        /// <param name="pBeginTime">开始日期</param>
        /// <param name="pEndTime">结束日期</param>
        /// <param name="pType">假日类型,若想查全部,输入“请选择”</param>
        /// <param name="pUserId">用户Id,若想查所有人,输入“-2”</param>
        /// <returns></returns>
        public DataSet GetRestDateDataSet(string pBeginTime, string pEndTime, string pType, int pUserId)
        {
            DataSet objDs   = new DataSet("result");
            string  _sqlstr = string.Empty;

            OleDbParameter[] parms = null;

            if (pEndTime == string.Empty)
            {
                parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_BeginDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_UserId, OleDbType.Integer),
                    new OleDbParameter(Parm_UserId, OleDbType.Integer)
                };
                parms[0].Value = this.GetFullDate(pBeginTime);
                parms[1].Value = -1;
                parms[2].Value = pUserId;
                _sqlstr        = SQL_Select_RestDateAllByBeginAndUserId;
                try
                {
                    objDs = AccessHelper.ExcuteDataSet(AccessHelper.CONN_STRING, CommandType.Text, _sqlstr, parms);
                }
                catch (Exception ex)
                {
                }

                return(objDs);
            }

            if (pType != "请选择" && pUserId != -2)
            {
                parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_BeginDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_EndDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_Type, OleDbType.VarChar),
                    new OleDbParameter(Parm_UserId, OleDbType.Integer)
                };
                parms[0].Value = this.GetFullDate(pBeginTime);
                parms[1].Value = this.GetFullDate(pEndTime);
                parms[2].Value = pType;
                parms[3].Value = pUserId;
                _sqlstr        = SQL_Select_RestDateAllByTypeAndUserId;
            }
            else if (pType == "请选择" && pUserId != -2)
            {
                parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_BeginDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_EndDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_UserId, OleDbType.Integer)
                };
                parms[0].Value = this.GetFullDate(pBeginTime);
                parms[1].Value = this.GetFullDate(pEndTime);
                parms[2].Value = pUserId;
                _sqlstr        = SQL_Select_RestDateByUserId;
            }
            else if (pType != "请选择" && pUserId == -2)
            {
                parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_BeginDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_EndDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_Type, OleDbType.VarChar)
                };
                parms[0].Value = this.GetFullDate(pBeginTime);
                parms[1].Value = this.GetFullDate(pEndTime);
                parms[2].Value = pType;
                _sqlstr        = SQL_Select_RestDateByType;
            }
            else
            {
                parms = new OleDbParameter[] {
                    new OleDbParameter(Parm_BeginDate, OleDbType.VarChar),
                    new OleDbParameter(Parm_EndDate, OleDbType.VarChar)
                };
                parms[0].Value = this.GetFullDate(pBeginTime);
                parms[1].Value = this.GetFullDate(pEndTime);
                _sqlstr        = SQL_Select_RestDateAll;
            }
            try
            {
                objDs = AccessHelper.ExcuteDataSet(AccessHelper.CONN_STRING, CommandType.Text, _sqlstr, parms);
            }
            catch (Exception ex)
            {
            }

            return(objDs);
        }