protected void givShowMessage_RowCommand(object sender, GridViewCommandEventArgs e) { MessageReceiveBLL message = new MessageReceiveBLL(); string name = e.CommandName; int id = Convert.ToInt32(e.CommandArgument); if ("Del" == name) { Response.Cache.SetExpires(DateTime.Now); Permissions.CheckManagePermission(EnumCompanyPermission.ManageMessageReciveDelete); if (message.DelMessageReceive(id, Session["Company"].ToString(), 0)) { ScriptHelper.SetAlert(Page, GetTran("000008", "删除成功") + "!!!"); } else { ScriptHelper.SetAlert(Page, GetTran("000009", "删除失败") + "!!!"); } //Pager page = Page.FindControl("Pager1") as Pager; //string wherepage= ViewState["pagewhere"].ToString(); //page.PageBind(0, 10, "MessageReceive", "ID, MessagesendID, LoginRole, Receive, InfoTitle, SenderRole, Sender, Senddate, DropFlag, ReadFlag, ReplyFlag", wherepage, "ID", "givShowMessage"); PageBind(); } else if ("huifu" == name) { if (this.DropMsgClass.SelectedValue.Equals("-1")) { Response.Redirect("ManageMessage.aspx?type=huifu&hfid=" + id); } else { Response.Redirect("ManageMessage.aspx?type=huifu&hfid=" + id + "&ClassID=" + this.DropMsgClass.SelectedValue); } } }
protected void btndownExcel_Click(object sender, EventArgs e) { BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); string[] tran = new string[] { GetTran("000151", "管理员"), GetTran("000388", "店铺"), GetTran("000599", "会员") }; DataTable dt = bll.GetExcelTable(tran, ViewState["where"].ToString() + " order by ID desc "); foreach (DataRow dr in dt.Rows) { dr["Senddate"] = (Convert.ToDateTime(dr["Senddate"]).AddHours(BLL.other.Company.WordlTimeBLL.ConvertAddHours())).ToString(); dr["LoginRole"] = jieshuoduixing(dr["LoginRole"].ToString()); } Excel.OutToExcel(dt, "公告表", new string[] { "InfoTitle=" + GetTran("000724", "公告标题"), "LoginRole=" + GetTran("000784", "接收者"), "Condition=" + GetTran("007227", "接收条件"), "Sender=" + GetTran("000726", "发送人编号"), "Senddate=" + GetTran("000752", "发送时间") }); }
protected void givMessageSend_RowCommand(object sender, GridViewCommandEventArgs e) { BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); string name = e.CommandName; int id = Convert.ToInt32(e.CommandArgument.ToString()); if (name == "Del") { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MessageSend", "ltrim(rtrim(id))"); cl_h_info.AddRecord(id); cl_h_info.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company19, id.ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); if (bll.delGongGao(id) > 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000008", "删除成功") + "!!!');</script>"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000009", "删除失败") + "!!!');</script>"); } btnseach_Click(null, null); } else if ("Distal" == name) { Response.Redirect("ShowMessage.aspx?id=" + id); } else if ("GO" == name) { Response.Redirect("MessageContent.aspx?id=" + e.CommandArgument.ToString() + "&T=messagesend&source=ManageQueryGongGao.aspx"); } else { Response.Redirect("ManageAffiche.aspx?id=" + id); } }
protected void btn_Save_Click(object sender, EventArgs e) { #region 验证用户输入 if (txtBianhao.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(\"" + GetTran("001607", "请输入收件人编号") + "!!!\");</script>"); return; } if (txtTitle.Text.Trim() == "") { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("001609", "请输入标题") + "!!!');</script>"); Literal1.Text = ""; return; } if (this.content1.Value.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请输入公告内容") + "!!!');</script>"); return; } if (this.content1.Value.Trim().Length > 4000) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("000863", "您输入的信息过长") + "!!!');</script>"); return; } double from = 0; double to = 0; if (this.ChkBonus.Checked) { if (string.IsNullOrEmpty(this.TxtBonusFrom.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 起始奖金不能为空!');</script>"); return; } if (string.IsNullOrEmpty(this.TxtBonusTo.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 未尾奖金不能为空!');</script>"); return; } try { from = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); to = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); if (from <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 起始奖金不能为负数!');</script>"); return; } if (from <= 0) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert(' 未尾奖金不能负数!');</script>"); return; } } catch { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } if (from >= to) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "您输入的奖金区间无效") + "!!!');</script>"); return; } } if (this.drop_LoginRole.SelectedValue.Equals("2") && this.ChkNet.Checked) { if (this.TxtLeader.Text.Trim().Length.Equals(0)) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "请指定团队领导人编号") + "!!!');</script>"); return; } else { if (!MessageSendBLL.CheckNumber(2, this.TxtLeader.Text.Trim())) { ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('" + GetTran("kwl", "指定的团队领导人不存在") + "!!!');</script>"); return; } } } #endregion StringBuilder sb = new StringBuilder(); if (Request["Id"] != null) { int id = Convert.ToInt32(Request["Id"]); ChangeLogs cl = new ChangeLogs("MessageSend", "ltrim(rtrim(id))"); cl.AddRecord(id); ChangeLogs clsend = new ChangeLogs("MessageReceive", "ltrim(rtrim(messagesendid))"); clsend.AddRecord(id); BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); bll.delGongGao(id); cl.ModifiedIntoLogs(ChangeCategory.company19, Session["Company"].ToString(), ENUM_USERTYPE.objecttype10); clsend.ModifiedIntoLogs(ChangeCategory.company19, Session["Company"].ToString(), ENUM_USERTYPE.objecttype10); this.btn_Save.Text = GetTran("000259", "修改"); sb.Append(GetTran("001621", "公告修改")); } else { sb.Append(GetTran("001620", "公告发布")); } MessageSendModel messagesend = new MessageSendModel(); //messagesend.Content = TextBox1.Text.Trim(); messagesend.Content = this.content1.Value.Trim(); messagesend.DropFlag = 0; messagesend.InfoTitle = txtTitle.Text.Trim().Replace("<", "<").Replace(">", ">"); messagesend.LoginRole = drop_LoginRole.SelectedItem.Value; messagesend.ReadFlag = 0; messagesend.Sender = Session["Company"].ToString(); messagesend.SenderRole = "0"; messagesend.Receive = "*"; messagesend.CountryCode = this.DropDownList1.SelectedValue; messagesend.LanguageCode = this.DropDownList2.SelectedValue; //if (this.ChkLevel.Checked) //{ // messagesend.ConditionLevel = Convert.ToInt16(this.DropLevel.SelectedValue); //} //else //{ // messagesend.ConditionLevel = -1; //} if (this.ChkBonus.Checked) { messagesend.ConditionBonusFrom = Convert.ToDouble(this.TxtBonusFrom.Text.Trim()); messagesend.ConditionBonusTo = Convert.ToDouble(this.TxtBonusTo.Text.Trim()); } else { messagesend.ConditionBonusFrom = -1; messagesend.ConditionBonusTo = -1; } if (this.ChkNet.Checked) { messagesend.ConditionRelation = Convert.ToChar(this.DropRelation.SelectedValue); messagesend.ConditionLeader = this.TxtLeader.Text.Trim(); } else { messagesend.ConditionLeader = ""; messagesend.ConditionRelation = '0'; } messagesend.Qishu = CommonDataDAL.getMaxqishu(); messagesend.MessageType = 'a'; if (MessageSendBLL.Addsendaffiche(messagesend)) { BLL.other.Company.MessageReceiveBLL bll = new MessageReceiveBLL(); if (this.drop_LoginRole.SelectedValue == "1") { bll.UpdateStore(); } else if (this.drop_LoginRole.SelectedValue == "2") { bll.UpdateMember(); } sb.Append(GetTran("001600", "成功") + "!!!"); ScriptHelper.SetAlert(Page, sb.ToString()); } else { sb.Append(GetTran("001618", "失败")); ScriptHelper.SetAlert(Page, sb.ToString()); } txtTitle.Text = ""; TextBox1.Text = ""; content1.Value = ""; }