Exemplo n.º 1
0
 public string GetDelType(int WMId, int UserId)
 {
     M_WebMessage message = new M_WebMessage();
     if (this.Show(WMId, UserId).ReceiverId == UserId)
     {
         return "ReceiverDel";
     }
     return "SendDel";
 }
Exemplo n.º 2
0
 public void Insert(M_WebMessage model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@ReceiverId", SqlDbType.Int, 4), new SqlParameter("@ReceiverName", SqlDbType.NVarChar), new SqlParameter("@SendId", SqlDbType.Int, 4), new SqlParameter("@SendName", SqlDbType.NVarChar), new SqlParameter("@Title", SqlDbType.NVarChar), new SqlParameter("@Content", SqlDbType.NVarChar), new SqlParameter("@IsSend", SqlDbType.Int, 4), new SqlParameter("@IsRead", SqlDbType.Int, 4), new SqlParameter("@ReceiverDel", SqlDbType.Int, 4), new SqlParameter("@SendDel", SqlDbType.Int, 4), new SqlParameter("@AllUser", SqlDbType.Int, 4), new SqlParameter("@UserGroupId", SqlDbType.Int, 4), new SqlParameter("@OverdueDate", SqlDbType.DateTime), new SqlParameter("@AddDate", SqlDbType.DateTime) };
     commandParameters[0].Value = model.ReceiverId;
     commandParameters[1].Value = model.ReceiverName;
     commandParameters[2].Value = model.SendId;
     commandParameters[3].Value = model.SendName;
     commandParameters[4].Value = model.Title;
     commandParameters[5].Value = model.Content;
     commandParameters[6].Value = model.IsSend;
     commandParameters[7].Value = model.IsRead;
     commandParameters[8].Value = model.ReceiverDel;
     commandParameters[9].Value = model.SendDel;
     commandParameters[10].Value = model.AllUser;
     commandParameters[11].Value = model.UserGroupId;
     commandParameters[12].Value = model.OverdueDate;
     commandParameters[13].Value = model.AddDate;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_WebMessage", commandParameters);
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string Id=Request.QueryString["id"];
            string TypeId=Request.QueryString["TypeId"];

            if(Id=="" || Id==null || TypeId=="" || TypeId==null)
            {
                Response.Redirect("MessageList.aspx?TypeId="+TypeId+"");
                Response.End();
            }

            m_user=b_user.GetCookie();

            m_message=b_message.Show(int.Parse(Id),m_user.UserID);

            if (m_message == null)
            {
                Response.Redirect("MessageList.aspx?TypeId="+TypeId+"");
                Response.End();
            }

            if (m_message.AllUser == 1 || (m_message.AllUser == 0 && m_message.UserGroupId != 0) || (m_message.AllUser == 0 && m_message.SendId == 0 && m_message.UserGroupId==0))
            {
                LinkButton1.Visible = false;
                ShowRe.Visible = false;
            }

            AddDate.Text = m_message.AddDate.ToString();
            SendName.Text = m_message.SendName;
            Title.Text = m_message.Title;
            Content.Text = Function.Decode(m_message.Content);
            Response.Write("<script type='text/javascript'>parent.LeftIframe.location.reload();</script>");
        }
    }
Exemplo n.º 4
0
 public void Auditing(string tableName, string idStr, int status)
 {
     if (idStr != string.Empty)
     {
         B_Admin admin = new B_Admin();
         B_Column column = new B_Column();
         B_Channel channel = new B_Channel();
         string[] strArray = idStr.Split(new char[] { ',' });
         foreach (string str in strArray)
         {
             int id = int.Parse(str);
             DataRow info = this.dal.GetInfo(tableName, id);
             if (info == null)
             {
                 break;
             }
             int columnId = (int) info["colid"];
             M_Column column2 = column.GetColumn(columnId);
             if (column2 == null)
             {
                 break;
             }
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 == null)
             {
                 break;
             }
             int num3 = (int) info["Status"];
             int num4 = (int) info["UserType"];
             int userId = (int) info["UId"];
             string str2 = info["UName"].ToString();
             string newValue = info["Title"].ToString();
             string str4 = channel2.Notice2.Replace("{@标题}", newValue);
             M_LoginAdmin loginModel = admin.GetLoginModel();
             int adiminId = loginModel.UserId;
             string loginName = loginModel.LoginName;
             this.dal.Auditing(tableName, id, status, adiminId, loginName);
             if ((((status == 3) && (num3 != 3)) && (num4 == 0)) && (userId > 0))
             {
                 B_WebMessage message = new B_WebMessage();
                 M_WebMessage message2 = new M_WebMessage();
                 message2.Title = "稿件采纳通知";
                 message2.Content = str4;
                 message2.IsRead = 0;
                 message2.IsSend = 1;
                 message2.ReceiverId = userId;
                 message2.ReceiverName = str2;
                 message2.SendId = 0;
                 message2.SendName = loginName;
                 message2.OverdueDate = DateTime.Now;
                 message2.AddDate = DateTime.Now;
                 message2.ReceiverDel = 0;
                 message2.SendDel = 0;
                 message.Insert(message2);
             }
             M_User user = new B_User().GetUser(userId);
             if (user == null)
             {
                 break;
             }
             B_UserGroup group = new B_UserGroup();
             M_UserGroup model = group.GetModel(user.GroupID);
             if (group == null)
             {
                 break;
             }
             int num7 = int.Parse(group.Power_UserGroup("Contribute", 0, model.GroupPower)) * column2.ScoreReward;
             new B_Money().Integral(num7, userId);
         }
     }
 }
Exemplo n.º 5
0
 public void Cancel(string tableName, int id)
 {
     B_Channel channel = new B_Channel();
     B_Column column = new B_Column();
     B_Admin admin = new B_Admin();
     DataRow info = this.dal.GetInfo(tableName, id);
     if (info != null)
     {
         int columnId = (int) info["colid"];
         M_Column column2 = column.GetColumn(columnId);
         if (column2 != null)
         {
             M_Channel channel2 = channel.GetChannel(column2.ChId);
             if (channel2 != null)
             {
                 int num2 = (int) info["UserType"];
                 int num3 = (int) info["UId"];
                 string str = info["UName"].ToString();
                 string newValue = info["Title"].ToString();
                 string str3 = channel2.Notice1.Replace("{@标题}", newValue);
                 string loginName = admin.GetLoginModel().LoginName;
                 this.dal.Cancel(tableName, id);
                 if ((num2 == 0) && (num3 > 0))
                 {
                     B_WebMessage message = new B_WebMessage();
                     M_WebMessage model = new M_WebMessage();
                     model.Title = "退稿通知";
                     model.Content = str3;
                     model.IsRead = 0;
                     model.IsSend = 1;
                     model.ReceiverId = num3;
                     model.ReceiverName = str;
                     model.SendId = 0;
                     model.SendName = loginName;
                     model.OverdueDate = DateTime.Now;
                     model.AddDate = DateTime.Now;
                     model.ReceiverDel = 0;
                     model.SendDel = 0;
                     message.Insert(model);
                 }
             }
         }
     }
 }
Exemplo n.º 6
0
 public void Insert(M_WebMessage model)
 {
     this.iwebm.Insert(model);
 }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string Action = Request.QueryString["Action"];
            string Id = Request.QueryString["MessageId"];
            string sReceiverName = Request.QueryString["ReceiverName"];
            muser = buser.GetCookie();
            //好友
            int total = 0;

            DataTable dt = new DataTable();
            dt = buser.ListGroupMember("KyUserFriend.UserId=" + muser.UserID + " and FriendGroupId!=2", 1000, 1, ref total);

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    UserFriend.Items.Add(new ListItem(dt.Rows[i]["LogName"].ToString(), dt.Rows[i]["LogName"].ToString()));
                }
            }

            if (Action == null)
            {
                Action = "";
            }

            if (Id == null)
            {
                Id = "";
            }

            if (sReceiverName == null)
            {
                sReceiverName = "";
            }

            if (sReceiverName != "")
            {
                ReceiverName.Text = sReceiverName;
            }

            if (Action != "" || Id != "")
            {
                m_message = b_message.Show(int.Parse(Id), muser.UserID);

                if (m_message.AllUser == 0 && m_message.UserGroupId == 0)
                {
                    if (Action == "Re")
                    {
                        ReceiverName.Text = m_message.SendName;
                        Title.Text = "Re:" + m_message.Title + "";
                        Content.Text = "======在 " + m_message.AddDate + " 您来信中写道:======\r\n<br/>" + Function.Decode(m_message.Content) + "\n=======================================\n";
                    }
                }
                if (Action == "Fw")
                {
                    Title.Text = "Fw:" + m_message.Title + "";
                    Content.Text = "======下面是转发信息======\n原发件人:" + m_message.SendName + "\n<br/>原发件内容:\n" + Function.Decode(m_message.Content) + "\n======================================\n";
                }

                if (m_message.IsSend == 0)
                {
                    if (Action == "Edit")
                    {
                        ReceiverName.Text = m_message.ReceiverName;
                        Title.Text = m_message.Title;
                        Content.Text = Function.Decode(m_message.Content);
                    }
                }
            }
        }
    }
Exemplo n.º 8
0
 public M_WebMessage Show(int WMId, int UserId)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("select * from KyWebMessage ");
     builder.Append("where WMId=" + WMId + "");
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@SqlStr", SqlDbType.NVarChar, 3910) };
     commandParameters[0].Value = builder.ToString();
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Sp_ExecuteSql", commandParameters);
     if (table.Rows.Count > 0)
     {
         M_WebMessage message = new M_WebMessage();
         if (table.Rows[0]["ReceiverId"].ToString() != "")
         {
             message.ReceiverId = int.Parse(table.Rows[0]["ReceiverId"].ToString());
         }
         message.ReceiverName = table.Rows[0]["ReceiverName"].ToString();
         if (table.Rows[0]["SendId"].ToString() != "")
         {
             message.SendId = int.Parse(table.Rows[0]["SendId"].ToString());
         }
         message.SendName = table.Rows[0]["SendName"].ToString();
         message.Title = table.Rows[0]["Title"].ToString();
         message.Content = table.Rows[0]["Content"].ToString();
         if (table.Rows[0]["IsSend"].ToString() != "")
         {
             message.IsSend = int.Parse(table.Rows[0]["IsSend"].ToString());
         }
         if (table.Rows[0]["IsRead"].ToString() != "")
         {
             message.IsRead = int.Parse(table.Rows[0]["IsRead"].ToString());
         }
         if (table.Rows[0]["ReceiverDel"].ToString() != "")
         {
             message.ReceiverDel = int.Parse(table.Rows[0]["ReceiverDel"].ToString());
         }
         if (table.Rows[0]["SendDel"].ToString() != "")
         {
             message.SendDel = int.Parse(table.Rows[0]["SendDel"].ToString());
         }
         if (table.Rows[0]["AllUser"].ToString() != "")
         {
             message.AllUser = int.Parse(table.Rows[0]["AllUser"].ToString());
         }
         if (table.Rows[0]["UserGroupId"].ToString() != "")
         {
             message.UserGroupId = int.Parse(table.Rows[0]["UserGroupId"].ToString());
         }
         if (table.Rows[0]["OverdueDate"].ToString() != "")
         {
             message.OverdueDate = DateTime.Parse(table.Rows[0]["OverdueDate"].ToString());
         }
         if (table.Rows[0]["AddDate"].ToString() != "")
         {
             message.AddDate = DateTime.Parse(table.Rows[0]["AddDate"].ToString());
         }
         if ((table.Rows[0]["AllUser"].ToString() == "0") && (table.Rows[0]["ReceiverId"].ToString() == ("" + UserId + "")))
         {
             this.UpdateRead(WMId);
         }
         return message;
     }
     return null;
 }
Exemplo n.º 9
0
 public void UpdateDel(int WMId, int UserId, int DelTypeId)
 {
     StringBuilder builder = new StringBuilder();
     if (DelTypeId == 1)
     {
         builder.Append("update KyWebMessage set ");
         builder.Append(string.Concat(new object[] { "ReceiverDel=1 where WMId=", WMId, " and ReceiverId=", UserId, "" }));
     }
     if (DelTypeId == 2)
     {
         builder.Append("update KyWebMessage set ");
         builder.Append(string.Concat(new object[] { "SendDel=1 where WMId=", WMId, " and SendId=", UserId, "" }));
     }
     if (DelTypeId == 3)
     {
         builder.Append("update KyWebMessage set ");
         builder.Append(string.Concat(new object[] { "SendDel=1 where WMId=", WMId, " and SendId=", UserId, " and SendDel=0" }));
     }
     if (DelTypeId == 4)
     {
         string delType = this.GetDelType(WMId, UserId);
         M_WebMessage message = new M_WebMessage();
         message = this.Show(WMId, UserId);
         if (((message.ReceiverDel == 2) || (message.SendDel == 2)) || (((message.SendId == message.ReceiverId) && (message.ReceiverDel == 1)) && (message.SendDel == 1)))
         {
             builder.Append("delete KyWebMessage ");
             builder.Append("where WMId=" + WMId + "");
         }
         else
         {
             builder.Append("update KyWebMessage set ");
             builder.Append(string.Concat(new object[] { "", delType, "=2 where WMId=", WMId, " and ", delType, "=1" }));
         }
     }
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@SqlStr", SqlDbType.NVarChar, 0x7d0) };
     commandParameters[0].Value = builder.ToString();
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Sp_ExecuteSql", commandParameters);
 }