Example #1
0
        public void saveFormSubmit(string openId, string formId)
        {
            tbl_welcomeform welcomeForm = new tbl_welcomeform();

            welcomeForm.formId     = formId;
            welcomeForm.openId     = openId;
            welcomeForm.welcomeId  = Guid.NewGuid().ToString();
            welcomeForm.submitTime = DateTime.Now;

            SqlSugarClient db = SqlSugarInstance.newInstance();

            db.Insertable <tbl_welcomeform>(welcomeForm).ExecuteCommand();
        }
Example #2
0
        public int needToShowMask(string openId)
        {
            SqlSugarClient  db   = SqlSugarInstance.newInstance();
            tbl_welcomeform form = db.Queryable <tbl_welcomeform>().Where(o => o.openId == openId).OrderBy(o => o.submitTime, OrderByType.Desc).First();

            if (form == null)
            {
                return(0);
            }
            else if (form.submitTime.AddDays(6) <= DateTime.Now)
            {
                return(1);
            }
            else
            {
                return(2);
            }
        }