Пример #1
0
        public JsonResult AdminQRCode(int eid)
        {
            var md = ActivesManageApplyBussiness.GetActivesManageApplyModel(m => m.ActiveID == eid && m.ExpirseDate <= DateTime.Now && m.Status == 0);

            if (md == null)
            {
                string floder = "/Image/AdminQRCode";
                string path   = Server.MapPath(floder);
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                string url = Common.HostUrl + floder + "/" + Guid.NewGuid().ToString() + ".png";
                try
                {
                    MiniprogramApiHelper.CreateShareCode(eid.ToString(), "subpackage/addadmin/addadmin").Save(url);
                }
                catch (Exception)
                {
                    url = "https://res.wx.qq.com/wxdoc/dist/assets/img/WXAQRCode.053ccc63.png";
                }
                md              = new ActivesManageApplyModel();
                md.Status       = 0;
                md.CreateUserID = LoginUserInfo.ID;
                md.URL          = url;
                md.Code         = LeoUtils.GetRandomStr();
                md.CreateTime   = DateTime.Now;
                md.ExpirseDate  = md.CreateTime.Value.AddMinutes(10);
                ActivesManageApplyBussiness.InsertActivesManageApplyModel(md);
            }
            else
            {
                md.Code        = LeoUtils.GetRandomStr();
                md.UpdateTime  = DateTime.Now;
                md.ExpirseDate = md.UpdateTime.Value.AddMinutes(10);
            }

            return(Success(new {
                url = md.URL,
                code = md.Code,
                expire_at = LeoUtils.ConvertDateTimeInt1(md.ExpirseDate)
            }));
        }
Пример #2
0
        public bool AddAdmin(AuditLogModel AuditLogModel, ActivesManageApplyModel activesManageApplyModel)
        {
            SqlConnection connection = new SqlConnection(ConnStr);

            connection.Open();
            var tran = connection.BeginTransaction();

            try
            {
                var id = Context.Insert(tran, AuditLogModel);
                Context.Update(tran, activesManageApplyModel);
                tran.Commit();
                connection.Close();
                return(true);
            }
            catch (Exception ex)
            {
                tran.Rollback();
                connection.Close();
                return(false);
            }
        }
 public static bool AddAdmin(ActiveManagesModel ActiveManagesModel, ActivesManageApplyModel activesManageApplyModel)
 {
     return(ActiveManagesDAL.dal.AddAdmin(ActiveManagesModel, activesManageApplyModel));
 }
Пример #4
0
 public static bool UpdateActivesManageApplyModel(ActivesManageApplyModel entity)
 {
     return(ActivesManageApplyDAL.dal.UpdateActivesManageApplyModel(entity));
 }
Пример #5
0
 public static bool InsertActivesManageApplyModel(ActivesManageApplyModel entity)
 {
     return(ActivesManageApplyDAL.dal.InsertActivesManageApplyModel(entity));
 }
 public static bool AddAdmin(AuditLogModel AuditLogModel, ActivesManageApplyModel activesManageApplyModel)
 {
     return(AuditLogDAL.dal.AddAdmin(AuditLogModel, activesManageApplyModel));
 }