protected void EgvCompanyMember_RowCommand(object sender, CommandEventArgs e)
        {
            string userName       = e.CommandArgument.ToString();
            bool   flag           = false;
            string successMessage = "";
            string commandName    = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "RemoveFromCompany"))
                {
                    if (commandName == "AddToAdmin")
                    {
                        flag           = Users.AddToAdminCompany(userName);
                        successMessage = "已经将 " + userName + " 升级为管理员!";
                    }
                    else if (commandName == "RemoveFromAdmin")
                    {
                        flag           = Users.RemoveFromAdminCompany(userName);
                        successMessage = "已经将 " + userName + " 降为普通成员!";
                    }
                    else if (commandName == "Agree")
                    {
                        int companyClientId = 0;
                        EasyOne.Model.Crm.CompanyInfo compayById = Company.GetCompayById(this.CompanyId);
                        if (!compayById.IsNull)
                        {
                            companyClientId = compayById.ClientId;
                        }
                        flag           = Users.AgreeJoinCompany(userName, companyClientId);
                        successMessage = "已经批准 " + userName + " 加入企业中!";
                    }
                    else if (commandName == "Reject")
                    {
                        flag           = Users.RemoveFromCompany(userName);
                        successMessage = "已经拒绝 " + userName + " 加入企业中!";
                    }
                }
                else
                {
                    flag           = Users.RemoveFromCompany(userName);
                    successMessage = "已经将 " + userName + " 从企业中删除!";
                }
            }
            if (flag)
            {
                BaseUserControl.WriteSuccessMsg(successMessage, this.ReturnAddress);
            }
            else
            {
                BaseUserControl.WriteErrMsg("<li>操作失败!</li>");
            }
        }
Esempio n. 2
0
 protected void BtnDeleteAll_Click(object sender, EventArgs e)
 {
     if (Message.Clear(this.ManageType, PEContext.Current.User.UserName))
     {
         if (this.ManageType == MessageManageType.Recycle)
         {
             BaseUserControl.WriteSuccessMsg("删除短信息成功。", "MessageManager.aspx?ManageType=" + this.ManageType.ToString("D"));
         }
         else
         {
             BaseUserControl.WriteSuccessMsg("删除短消息成功。删除的消息将转移到您的废件箱中。", "MessageManager.aspx?ManageType=" + this.ManageType.ToString("D"));
         }
     }
     else
     {
         BaseUserControl.WriteErrMsg("删除失败!");
     }
 }
        protected void EgvFeedback_RowCommand(object sender, CommandEventArgs e)
        {
            string commandName = e.CommandName;

            if (commandName != null)
            {
                if (!(commandName == "Del"))
                {
                    if (!(commandName == "DelReply"))
                    {
                        if (commandName == "ReplyContent")
                        {
                            BaseUserControl.ResponseRedirect("OrderFeedbackModify.aspx?Action=ReplyContent&ID=" + e.CommandArgument.ToString());
                        }
                        return;
                    }
                }
                else
                {
                    if (OrderFeedback.Delete(e.CommandArgument.ToString()))
                    {
                        BaseUserControl.WriteSuccessMsg("删除反馈信息成功", "OrderManage.aspx?OrderID=" + this.OrderId);
                        return;
                    }
                    BaseUserControl.WriteErrMsg("删除反馈信息失败");
                    return;
                }
                OrderFeedbackInfo orderFeedbackById = OrderFeedback.GetOrderFeedbackById(DataConverter.CLng(e.CommandArgument));
                if (!orderFeedbackById.IsNull)
                {
                    orderFeedbackById.ReplyContent = string.Empty;
                    orderFeedbackById.ReplyName    = string.Empty;
                }
                if (OrderFeedback.Update(orderFeedbackById))
                {
                    BaseUserControl.WriteSuccessMsg("删除回复信息成功!", "OrderManage.aspx?OrderID=" + this.OrderId);
                }
                else
                {
                    BaseUserControl.WriteErrMsg("删除回复信息失败!");
                }
            }
        }
        protected void InitComment()
        {
            if (this.m_GeneralId == 0)
            {
                BaseUserControl.WriteErrMsg("<li>没有找到隶属信息评论,请返回!</li>");
            }
            else
            {
                string s = BaseUserControl.RequestString("Title");
                this.LblTitle.Text = s;
                string returnurl = this.ViewFile + "?GeneralID=" + this.m_GeneralId.ToString() + "&title=" + base.Server.UrlEncode(s);
                int    commentId = BaseUserControl.RequestInt32("CommentID");
                switch (BaseUserControl.RequestString("Action"))
                {
                case "Delete":
                    if (Comment.Delete(commentId))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>删除指定信息评论成功!</li>", returnurl);
                    }
                    break;

                case "Audited":
                    if (Comment.SetStatus(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>指定信息评论审核成功!</li>", returnurl);
                    }
                    break;

                case "UnAudited":
                    if (Comment.SetStatus(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论审核!</li>", returnurl);
                    }
                    break;

                case "Premier":
                    if (Comment.Elite(commentId, true))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>设定指定评论精华成功!</li>", returnurl);
                    }
                    break;

                case "UnPremier":
                    if (Comment.Elite(commentId, false))
                    {
                        BaseUserControl.WriteSuccessMsg("<li>已取消指定评论精华!</li>", returnurl);
                    }
                    break;

                case "AddPKZone":
                {
                    CommentPKZoneInfo commentPKZoneInfo = new CommentPKZoneInfo();
                    commentPKZoneInfo.CommentId  = commentId;
                    commentPKZoneInfo.Content    = base.Request["ItemContent"];
                    commentPKZoneInfo.Position   = DataConverter.CLng(base.Request["RadlPosition"]);
                    commentPKZoneInfo.IP         = PEContext.Current.UserHostAddress;
                    commentPKZoneInfo.UpdateTime = DateTime.Now;
                    commentPKZoneInfo.UserName   = "******";
                    CommentPKZone.Add(commentPKZoneInfo);
                    BaseUserControl.WriteSuccessMsg("<li>感谢您的参与,添加辩论成功!</li>", returnurl);
                    break;
                }
                }
                this.CommentBindData();
            }
        }
 protected void BtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         if (this.TxtPrincipalOrder.Text == this.TxtSubordinateOrder.Text)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单不能为同一个订单!</li>");
         }
         OrderInfo orderByOrderNum = Order.GetOrderByOrderNum(this.TxtPrincipalOrder.Text);
         if (orderByOrderNum.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>主订单(" + this.TxtPrincipalOrder.Text + ")不存在!</li>");
         }
         if (orderByOrderNum.Status > OrderStatus.WaitForConfirm)
         {
             BaseUserControl.WriteErrMsg("<li>合并的主订单必须为未确认的订单!</li>");
         }
         OrderInfo info2 = Order.GetOrderByOrderNum(this.TxtSubordinateOrder.Text);
         if (info2.IsNull)
         {
             BaseUserControl.WriteErrMsg("<li>从订单(" + this.TxtSubordinateOrder.Text + ")不存在!</li>");
         }
         if (info2.Status > OrderStatus.WaitForConfirm)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单必须为未确认的订单!</li>");
         }
         if (orderByOrderNum.UserName != info2.UserName)
         {
             BaseUserControl.WriteErrMsg("<li>合并的订单必须属于同个用户</li>");
         }
         if (!string.IsNullOrEmpty(this.OrderUserName) && (this.OrderUserName != orderByOrderNum.UserName))
         {
             BaseUserControl.WriteErrMsg("<li>只能合并属于自己的订单!</li>");
         }
         IList <OrderItemInfo> infoListByOrderId = OrderItem.GetInfoListByOrderId(orderByOrderNum.OrderId);
         foreach (OrderItemInfo info3 in OrderItem.GetInfoListByOrderId(info2.OrderId))
         {
             info3.OrderId = orderByOrderNum.OrderId;
             OrderItem.Update(info3);
             infoListByOrderId.Add(info3);
         }
         string selectedValue = this.RadlMergeType.SelectedValue;
         if (selectedValue != null)
         {
             if (!(selectedValue == "1"))
             {
                 if (selectedValue == "2")
                 {
                     orderByOrderNum.Remark = orderByOrderNum.Remark + info2.Remark;
                     orderByOrderNum.Memo   = orderByOrderNum.Memo + info2.Memo;
                 }
             }
             else
             {
                 orderByOrderNum.Remark = info2.Remark;
                 orderByOrderNum.Memo   = info2.Memo;
             }
         }
         Order.UpdateOrderInfo(orderByOrderNum, infoListByOrderId);
         Order.Delete(info2.OrderId.ToString());
         BaseUserControl.WriteSuccessMsg("订单合并成功!", this.Returnurl + "?OrderID=" + orderByOrderNum.OrderId.ToString());
     }
 }