/// <summary>
 /// չʾ����
 /// </summary>
 /// <param name="id">��¼Id</param>
 private void ShowInfo(int id)
 {
     SFileBB fileBB = new SFileBB();
     LMessageBB messageBB = new LMessageBB();
     vLMessageData model = new vLMessageData();
     try
     {
         model = messageBB.GetVModel(id);
         this.title.Text = model.title;
         this.content.Text = model.content;
         this.fileId.Text = fileBB.GetDownBatchFileNm(model.fileId);
         this.sort.Text = model.sortNm;
         this.author.Text = model.author;
     }
     finally
     {
         fileBB.Dispose();
         messageBB.Dispose();
     }
     //�����Ѷ��˴�
     SCommBB commBB = new SCommBB();
     try
     {
         string strSql = "select count(distinct empId) from LMessageReaded where messageId=" + id.ToString();
         this.readedEmpCount.Text = commBB.ExecuteScalar(strSql).ToString();
     }
     finally
     {
         commBB.Dispose();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         string idValue = Request.Params["id"];
         if (idValue != null)
         {
             int id = Convert.ToInt32(idValue);
             LMessageBB messageBB = new LMessageBB();
             try
             {
                 LMessageData messageData = new LMessageData();
                 messageData = messageBB.GetModel(id);
                 //����й��������˴�Ҫ��֤�Ƿ�����ɾ��
                 if (this.ValidateDataPermission(messageData.isrtEmpId))
                 {
                     messageBB.DeleteRecord(id);
                 }
                 this.ClientScript.RegisterStartupScript(this.GetType(), "CloseSubmit", "CloseSubmit()", true);
             }
             catch (Exception ex)
             {
                 this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3)", true);
                 return;
             }
             finally
             {
                 messageBB.Dispose();
             }
         }
     }
 }
    /// <summary>
    /// ��Grid
    /// </summary>
    protected void BindGrid()
    {
        LMessageBB messageBB = new LMessageBB();
        DataSet ds = new DataSet();

        try
        {
            string strWhere = this.StrWhere;

            if (this.title.Text != "")
            {
                strWhere += " and title like '%" + this.title.Text + "%'";
            }
            if (this.isrtDt.Text != "")
            {
                strWhere += " and isrtDt = '" + this.isrtDt.Text + "'";
            }
            if (this.sortNm.SelectedValue != "")
            {
                strWhere += " and sort = " + this.sortNm.SelectedValue;
            }

            ds = messageBB.GetVList(strWhere);
            this.grid.DataSource = ds.Tables[0];
            this.grid.DataBind();
            //��ֵ��¼������ҳ������
            this.Label3.Text = ds.Tables[0].Rows.Count.ToString();
            this.Label2.Text = this.grid.PageCount.ToString();
            this.currPage.Text = (this.grid.PageIndex + 1).ToString();
        }
        finally
        {
            messageBB.Dispose();
        }
    }
示例#4
0
    private void BindGV()
    {
        DataSet ds = new DataSet();
        LMessageBB messageBB = new LMessageBB();
        try
        {
            ds = messageBB.GetVListR(this.StrWhere, this.currentUser.empId);

            ds.Tables[0].DefaultView.Sort = "sortNm,isrtDt desc";

            this.GridView1.DataSource = ds.Tables[0].DefaultView;
            this.GridView1.DataBind();
        }
        finally
        {
            messageBB.Dispose();
        }
    }
示例#5
0
 /// <summary>
 /// չʾ����
 /// </summary>
 /// <param name="id">��¼Id</param>
 private void ShowInfo(int id)
 {
     SFileBB fileBB = new SFileBB();
     LMessageBB messageBB = new LMessageBB();
     LMessageData model = new LMessageData();
     try
     {
         model = messageBB.GetModel(id);
         this.title.Text = model.title;
         this.content.Value = model.content;
         this.fileId.Value = model.fileId;
         this.fileNm.Text = fileBB.GetBatchFileNm(model.fileId);
         if (this.sort.Items.FindByValue(model.sort.ToString()) != null)
         {
             this.sort.SelectedValue = model.sort.ToString();
         }
         this.author.Text = model.author;
         this.isIndexShow.Checked = model.isIndexShow;
     }
     finally
     {
         fileBB.Dispose();
         messageBB.Dispose();
     }
 }
示例#6
0
    /// <summary>
    /// ���ݱ���
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        LMessageData model = new LMessageData();
        LMessageBB messageBB = new LMessageBB();
        try
        {
            if (this.State == "1")
            {
                //�����֤

                this.SetModel(ref model);
                model.isrtDt = DateTime.Now.ToString();
                model.isrtEmpId = this.currentUser.empId;
                this.IdValue = messageBB.AddRecord(model);
            }
            else if (this.State == "2")
            {
                //�����֤
                //if (this.isIndexShow.SelectedValue == "1")
                //{
                //    //���������֪ͨ�Ѿ�ѡ������ҳ��ʾ����ʾ�û�
                //    if (messageBB.GetList("isIndexShow=1 and id <>" + this.IdValue.ToString()).Tables[0].Rows.Count >= 5)
                //    {
                //        this.ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert(\"�Ѿ���5��֪ͨѡ���˷�����������޸�!\");", true);
                //        return;
                //    }
                //}

                model = messageBB.GetModel(this.IdValue);
                this.SetModel(ref model);
                messageBB.ModifyRecord(model);
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3)", true);
            return;
        }
        finally
        {
            messageBB.Dispose();
        }

        Response.Redirect("LMessageList.aspx?itemNo=" + this.itemNo + "&pTypeNo=main", false);
    }
    /// <summary>
    /// ɾ��
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDel_Click(object sender, EventArgs e)
    {
        bool retChecked = false;
        LMessageBB messageBB = new LMessageBB();
        try
        {
            //��ȡѡ�е�����Id
            foreach (GridViewRow gvrow in this.grid.Rows)
            {
                CheckBox chkId = (CheckBox)gvrow.FindControl("chkId");
                if (chkId.Checked == true)
                {
                    retChecked = true;
                    int id = int.Parse(chkId.ValidationGroup);
                    messageBB.DeleteRecord(id);
                }
            }
        }
        catch (Exception ex)
        {
            this.ClientScript.RegisterStartupScript(this.GetType(), "ShowErr", "ShowErr(\"" + Server.UrlEncode(ex.Message) + "\",3);", true);
            return;
        }
        finally
        {
            messageBB.Dispose();
        }

        if (retChecked)
        {
            this.BindGrid();
        }
    }