コード例 #1
0
        /// <summary>
        /// 添加简历
        /// </summary>
        /// <param name="resume"></param>
        /// <returns></returns>
        public static bool AddResume(Resume resume)
        {
            if (resume == null)
            {
                return(false);
            }
            StringBuilder sb = new StringBuilder();

            sb.Append("insert into resume (name,mobile,email,school,education,workyear,companynow,positionnow,area,position,summary,posttime)");
            sb.Append(" values (@name,@mobile,@email,@school,@education,@workyear,@companynow,@positionnow,@area,@position,@summary,@posttime)");
            SqlParameter[] para =
            {
                new SqlParameter("@name",        resume.Name),
                new SqlParameter("@mobile",      resume.Mobile),
                new SqlParameter("@email",       resume.Email),
                new SqlParameter("@school",      resume.School),
                new SqlParameter("@education",   resume.Education),
                new SqlParameter("@workyear",    resume.WorkYear),
                new SqlParameter("@companynow",  resume.CompanyNow),
                new SqlParameter("@positionnow", resume.PositionNow),
                new SqlParameter("@area",        resume.Area),
                new SqlParameter("@position",    resume.Position),
                new SqlParameter("@summary",     resume.Summary),
                new SqlParameter("@posttime",    resume.PostTime)
            };
            int n = MsSQLHelper.ExecuteNonQuery(sb.ToString(), CommandType.Text, para);

            if (n == 1)
            {
                return(true);
            }
            return(false);
        }
コード例 #2
0
ファイル: Log.cs プロジェクト: itpanda2016/TQLSMacOld
        /// <summary>
        /// 判断是否有发送记录
        /// </summary>
        /// <param name="dt">农历日期</param>
        /// <returns>True:有,false:无</returns>
        public static bool CheckHasSend(DateTime dt)
        {
            string d  = dt.Year + "/" + string.Format("{0:00}", dt.Month) + "/" + string.Format("{0:00}", dt.Day);
            string sb = "select count(*) from logs where CONVERT(VARCHAR(32),sendtime,111) like '" + d + "%'";
            int    n  = Convert.ToInt32(MsSQLHelper.ExecuteScalar(sb));

            if (n > 0)
            {
                return(true);
            }
            return(false);
        }
コード例 #3
0
ファイル: Log.cs プロジェクト: itpanda2016/TQLSMacOld
        /// <summary>
        /// 添加发送日志到数据库
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        public static bool Add()
        {
            Model.Log     log = new Model.Log();
            StringBuilder sb  = new StringBuilder();

            sb.Append("insert into logs (sendtime) values (@sendtime)");
            SqlParameter[] paras =
            {
                new SqlParameter("@sendtime", log.SendTime)
            };
            int n = MsSQLHelper.ExecuteNonQuery(sb.ToString(), CommandType.Text, paras);

            if (n == 1)
            {
                return(true);
            }
            return(false);
        }
コード例 #4
0
ファイル: Log.cs プロジェクト: itpanda2016/TQLSMacOld
        /// <summary>
        /// 获取发送记录列表
        /// </summary>
        /// <returns></returns>
        public static DataTable GetLogList()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select id,sendtime,remark from logs");
            DataTable dt = MsSQLHelper.ExecuteDataTable(sb.ToString());

            //不知道当时为什么要写成字典,现在改回来   --20161114
            //Dictionary<int, DateTime> dict = new Dictionary<int, DateTime>();
            //if (dt.Rows.Count > 0) {
            //    foreach (DataRow item in dt.Rows) {
            //        dict.Add(Convert.ToInt32(item["id"]), Convert.ToDateTime(item["sendtime"]));
            //    }
            //    return dict;
            //}
            if (dt.Rows.Count > 0)
            {
                return(dt);
            }
            return(null);
        }