protected void btnAdd_Click(object sender, EventArgs e)
    {
        PostVO postVO = new PostVO();

        postVO.Title       = txtTitle.Text.Trim();
        postVO.SortNo      = int.Parse(txtSortNo.Text.Trim());
        postVO.Node        = m_PostService.GetNodeById(m_NodeId);
        postVO.PicFileName = m_PicFileName;
        postVO.Flag        = int.Parse(ddlFlag.SelectedValue);
        postVO.ShowDate    = DateTime.Today;
        //if (!string.IsNullOrEmpty(txtShowDate.Text.Trim()))
        //{
        //    postVO.ShowDate = DateTime.Parse(txtShowDate.Text.Trim());
        //}
        postVO.LinkUrl = txtLinkUrl.Text.Trim();
        if (!string.IsNullOrEmpty(txtLinkUrl.Text.Trim()))
        {
            postVO.Type = 1;
        }
        else
        {
            postVO.Type = 0;
        }
        m_PostService.CreatePost(postVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, postVO);
        ClearUI();
        fillGridView();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        PostVO postVO = new PostVO();

        UIHelper.FillVO(pnlContent, postVO);
        postVO.Node = m_PostService.GetNodeById(m_NodeId);
        //postVO.PicFileName = m_PicFileName;
        postVO.Flag        = 1;
        postVO.NeedUpdate  = true;
        postVO.CreatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        postVO.UpdatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        postVO.CreatedDate = DateTime.Now;
        postVO.UpdatedDate = DateTime.Now;
        //if (!string.IsNullOrEmpty(txtShowDate.Text.Trim()))
        //{
        //    postVO.ShowDate = DateTime.Parse(txtShowDate.Text.Trim());
        //}
        //if (!string.IsNullOrEmpty(txtCloseDate.Text.Trim()))
        //{
        //    postVO.ShowDate = DateTime.Parse(txtCloseDate.Text.Trim());
        //}
        m_PostService.CreatePost(postVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, postVO);
        new Thread(new ThreadStart(() => ApiUtil.UpdatePostToServer(2))).Start();
        ClearUI();
        fillGridView();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        PostVO postVO = new PostVO();

        UIHelper.FillVO(pnlContent, postVO);
        postVO.Node = m_PostService.GetNodeById(m_NodeId);
        m_PostService.CreatePost(postVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, postVO);
        ClearUI();
        fillGridView();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        NodeVO nodeVO = new NodeVO();

        nodeVO.Name        = txtNodeName.Text.Trim();
        nodeVO.PicFileName = m_PicFileName;
        nodeVO.ParentNode  = m_PostService.GetNodeById(m_NodeId);;
        nodeVO             = m_PostService.CreateNode(nodeVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, nodeVO);
        ClearUI();
        GetList();
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        NodeVO nodeVO = new NodeVO();

        nodeVO.Name   = txtNodeName.Text.Trim();
        nodeVO.SortNo = int.Parse(txtSortNo.Text.Trim());
        //nodeVO.HtmlContent = txtContent.Text.Trim();
        nodeVO.ParentNode = m_PostService.GetNodeById(m_NodeId);;
        m_PostService.CreateNode(nodeVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, nodeVO);
        ClearUI();
        GetList();
    }
Beispiel #6
0
    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        lblMsg.Text = string.Empty;
        //轉成小寫
        string id                    = txtId.Text.Trim().ToLower();
        string nameInChinese         = txtFullNameInChinese.Text.Trim();
        string nameInEnglish         = txtFullNameInEnglish.Text.Trim();
        int    IsAlive               = int.Parse(rdbIsValidAccount.SelectedValue);
        int    ShowInSalesStatistics = int.Parse(rdbShowInSalesStatistics.SelectedValue);

        string mobie   = txtMobile.Text.Trim();
        string ssid    = txtSSID.Text.Trim();
        string email   = txtEmail.Text.Trim();
        string address = txtAddress.Text.Trim();

        LoginUserVO user = m_AuthService.GetLoginUserById(id);

        if (user != null)
        {
            lblMsg.Text = MsgVO.USER_ALREADY_EXIST;
            return;
        }
        else
        {
            LoginUserVO newUser = new LoginUserVO();
            newUser.UserId                = id;
            newUser.FullNameInChinese     = nameInChinese;
            newUser.FullNameInEnglish     = nameInEnglish;
            newUser.IsAlive               = IsAlive;
            newUser.ShowInSalesStatistics = ShowInSalesStatistics;
            newUser.Mobile                = mobie;
            newUser.SSID           = ssid;
            newUser.Email          = email;
            newUser.ContactAddress = address;
            newUser.Password       = "******";
            newUser.CreateDate     = DateTime.Now;
            m_AuthService.CreateLoginUser(newUser);
            m_WebLogService.AddSystemLog(MsgVO.Action.新增, newUser);
            lblMsg.Text = MsgVO.INSERT_OK;
            clearInput();
            LoadDataToUI();
        }
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        MemberVO memberVO = new MemberVO();

        UIHelper.FillVO(pnlContent, memberVO);
        //postVO.PicFileName = m_PicFileName;
        memberVO.Status      = "1";
        memberVO.CreateIP    = m_HttpHelper.GetUserIp(Context);
        memberVO.NeedUpdate  = true;
        memberVO.CreatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        memberVO.UpdatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        memberVO.CreatedDate = DateTime.Now;
        memberVO.UpdatedDate = DateTime.Now;
        memberVO             = m_MemberService.CreateMember(memberVO);
        new Thread(new ThreadStart(ApiUtil.UpdateMemberToServer)).Start();
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, memberVO);
        UpdateProductByPhoneSer(memberVO.MemberId);
        ClearUI();
        fillGridView();
    }
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        lblMsg.Text = "";

        string roleName = txtRoleName.Text;

        if (String.IsNullOrEmpty(txtRoleName.Text))
        {
            return;
        }

        LoginRoleVO loginRole = new LoginRoleVO();

        loginRole.RoleName = roleName;

        m_AuthService.CreateLoginRole(loginRole);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, loginRole);

        lblMsg.Text = MsgVO.INSERT_OK;

        LoadDataToUI();
    }
Beispiel #9
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        FileVO fileVO = new FileVO();

        UIHelper.FillVO(pnlContent, fileVO);
        fileVO.FileName = m_FileName;
        fileVO.Flag     = 1;
        if (!string.IsNullOrEmpty(txtShowDate.Text.Trim()))
        {
            fileVO.ShowDate = DateTime.Parse(txtShowDate.Text.Trim());
        }
        fileVO.FileNo      = GetFileNo(fileVO);
        fileVO.NeedUpdate  = true;
        fileVO.CreatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        fileVO.UpdatedBy   = m_SessionHelper.LoginUser.FullNameInChinese;
        fileVO.CreatedDate = DateTime.Now;
        fileVO.UpdatedDate = DateTime.Now;
        m_PostFileService.CreateFile(fileVO);
        m_WebLogService.AddSystemLog(MsgVO.Action.新增, fileVO);
        new Thread(new ThreadStart(() => ApiUtil.UpdateFileToServer(Server.MapPath("../../upload/")))).Start();
        ClearUI();
        fillGridView();
    }
    protected void btnChangePassword_Click(object sender, EventArgs e)
    {
        LoginUserVO user = m_AuthService.GetLoginUserById(m_SessionHelper.LoginUser.UserId);

        if (txtOldPassword.Text != user.Password)
        {
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "js", JavascriptUtil.AlertJS(MsgVO.PASSWORD_WRONG), false);
            return;
        }
        else//txtOldPassword.Text == sHelper.LoginUser.Password
        {
            user.Password = txtNewPassword.Text;
            m_AuthService.UpdateLoginUser(user);
            m_WebLogService.AddSystemLog(MsgVO.Action.修改, user);
            ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), "js", JavascriptUtil.AlertJS(MsgVO.UPDATE_OK), false);
        }
    }
    protected void gvSpecialToday_RowCommand1(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName;
        int    postId  = int.Parse(e.CommandArgument.ToString());
        PostVO postVO  = m_PostService.GetPostById(postId);

        switch (cmdName)
        {
        case "myDel":
            postVO.Flag = 0;
            m_PostService.UpdatePost(postVO);
            m_WebLogService.AddSystemLog(MsgVO.Action.刪除, postVO, "", string.Format("單號:{0}", postVO.PostId));
            break;

        default:
            break;
        }
        LoadDataToUI();
    }
    protected void btnUpdate_Click(object sender, ImageClickEventArgs e)
    {
        string      selectedRole = ddlRole.SelectedValue;
        LoginRoleVO role         = m_AuthService.GetLoginRoleByIdNoLazy(int.Parse(selectedRole));

        foreach (GridViewRow row in gvAuth.Rows)
        {
            CheckBox    ckAuth = (CheckBox)row.FindControl("ckIsAuth");
            HiddenField hdnId  = (HiddenField)row.FindControl("hdnId");

            if (ckAuth.Checked == true)
            {
                if (role.MenuFuncList == null)
                {
                    role.MenuFuncList = new List <MenuFuncVO>();
                }

                MenuFuncVO theFunc = m_AuthService.GetMenuFuncById(int.Parse(hdnId.Value));

                if (!m_AuthService.RoleHasMenuRight(role, theFunc))
                {
                    role.MenuFuncList.Add(theFunc);
                }
            }
            else
            {
                MenuFuncVO theFunc = m_AuthService.GetMenuFuncById(int.Parse(hdnId.Value));

                if (m_AuthService.RoleHasMenuRight(role, theFunc))
                {
                    //role.MenuFuncList.Remove(theFunc);
                    role.MenuFuncList.Remove(role.MenuFuncList.Where(p => p.MenuFuncId == int.Parse(hdnId.Value)).ToList()[0]);
                }
            }
        }

        m_AuthService.UpdateLoginRole(role);
        m_WebLogService.AddSystemLog(MsgVO.Action.修改, role);

        UserMenuFuncContainer.GetInstance().ResetAll();

        lblMsg.Text = MsgVO.UPDATE_OK;
    }
    protected void Button3_Click(object sender, ImageClickEventArgs e)
    {
        string             userId        = ddlUser.SelectedValue;
        LoginUserVO        user          = m_AuthService.GetLoginUserByIdNoLazy(userId);
        List <LoginRoleVO> loginRoleList = new List <LoginRoleVO>();

        foreach (ListItem item in lbxHadRole.Items)
        {
            loginRoleList.Add(m_AuthService.GetLoginRoleById(int.Parse(item.Value)));
        }

        user.LoginRoleList = loginRoleList;

        m_AuthService.UpdateLoginUser(user);
        m_WebLogService.AddSystemLog(MsgVO.Action.修改, user);

        //更新快取
        UserMenuFuncContainer.GetInstance().ResetAll();

        lblMsg.Text = MsgVO.UPDATE_OK;
    }