Ejemplo n.º 1
0
 private void SetInfo(Foresight.DataAccess.Mall_BusinessDiscountRequest data)
 {
     this.labelAddUserMan.InnerHtml     = data.AddUserMan;
     this.labelAddTime.InnerHtml        = data.AddTime.ToString("yyyy-MM-dd HH:mm:ss");
     this.labelRequestContent.InnerHtml = data.RequestContent;
     if (data.BusinessID > 0)
     {
         var business = Mall_Business.GetMall_Business(data.BusinessID);
         if (business != null)
         {
             this.labelBusinessName.InnerHtml = business.BusinessName;
         }
     }
     this.Status = data.Status;
     this.tdApproveRemark.Value = data.ApproveRemark;
     if (data.Status != 1)
     {
         this.tdApproveMan.Value  = data.ApproveUserMan;
         this.tdApproveTime.Value = data.ApproveTime > DateTime.MinValue ? data.ApproveTime.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
     }
     else
     {
         this.tdApproveMan.Value  = WebUtil.GetUser(this.Context).RealName;
         this.tdApproveTime.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     }
 }
 private void SetInfo(Foresight.DataAccess.Mall_BusinessDiscountRequest data)
 {
     this.labelAddUserMan.InnerHtml     = data.AddUserMan;
     this.labelAddTime.InnerHtml        = data.AddTime.ToString("yyyy-MM-dd HH:mm:ss");
     this.labelRequestContent.InnerHtml = data.RequestContent;
     if (data.BusinessID > 0)
     {
         var business = Mall_Business.GetMall_Business(data.BusinessID);
         if (business != null)
         {
             this.labelBusinessName.InnerHtml = business.BusinessName;
         }
     }
 }
Ejemplo n.º 3
0
        private void savebusinessuserinfo(HttpContext context)
        {
            string UserType   = UserTypeDefine.APPBusiness.ToString();
            int    UserID     = GetIntValue(context, "UserID");
            int    BusinessID = GetIntValue(context, "BusinessID");

            Foresight.DataAccess.User          user     = null;
            Foresight.DataAccess.Mall_Business business = null;
            if (BusinessID > 0)
            {
                business = Mall_Business.GetMall_Business(BusinessID);
            }
            if (business == null)
            {
                WebUtil.WriteJson(context, new { status = false, error = "商家不存在" });
                return;
            }
            if (UserID > 0)
            {
                user = User.GetUser(UserID);
            }
            bool new_user_add = false;

            if (user == null)
            {
                new_user_add    = true;
                user            = new User();
                user.CreateTime = DateTime.Now;
            }
            string LoginName = context.Request.Params["LoginName"];
            var    sameuser  = Foresight.DataAccess.User.GetAPPUserByLoginName(LoginName, UserType: UserTypeDefine.APPBusiness.ToString());

            if (sameuser != null && sameuser.UserID != user.UserID)
            {
                WebUtil.WriteJson(context, new { status = false, error = "登录名已存在" });
                return;
            }
            user.Type        = UserType;
            user.NickName    = context.Request.Params["NickName"];
            user.RealName    = context.Request.Params["RealName"];
            user.PhoneNumber = context.Request.Params["PhoneNumber"];
            user.Gender      = context.Request.Params["Gender"];
            int isLocked = GetIntValue(context, "IsLocked");

            user.IsLocked = isLocked == 0 ? false : true;
            if (user.IsLocked)
            {
                user.LockTime = DateTime.Now;
            }
            if (!user.IsLocked)
            {
                user.ActiveTime = DateTime.Now;
            }
            string Pwd = context.Request.Params["Password"];

            user.LoginName = LoginName;
            if (!string.IsNullOrEmpty(Pwd))
            {
                user.Password = User.EncryptPassword(Pwd);
            }
            using (SqlHelper helper = new SqlHelper())
            {
                try
                {
                    helper.BeginTransaction();
                    user.Save(helper);
                    Mall_BusinessUser.Save_Mall_BusinessUser(business.ID, user.UserID, helper);
                    helper.Commit();
                }
                catch (Exception)
                {
                    helper.Rollback();
                }
            }
            if (new_user_add)
            {
                #region 新增账号日志
                APPCode.CommHelper.SaveOperationLog("新增账号" + user.LoginName, Utility.EnumModel.OperationModule.AddUser.ToString(), "新增账号", user.UserID.ToString(), "User");
                #endregion
            }
            WebUtil.WriteJson(context, new { status = true });
        }