Exemple #1
0
    /// <summary>
    /// 利用PagedDataSource做数据源绑定数据分页
    /// </summary>
    /// <param name="pageIndex"></param>
    private void DataBind(int pageIndex)
    {
        try
        {
            PagedDataSource pds = new PagedDataSource();

            pds.DataSource   = LeaveWordManager.SelectLeaveWordByAll(dropMsgTypeId.SelectedValue, dropMsgState.SelectedValue, RadioButtonList1.SelectedValue);
            Pager1.DataCount = pds.Count;//获取记录数 并赋值
            if (pageIndex >= Pager1.PageCount - 1)
            {
                pageIndex--;
            }
            pds.CurrentPageIndex = pageIndex;  //取得当前页索引
            pds.AllowPaging      = true;
            pds.PageSize         = 5;

            Pager1.PageCount         = pds.PageCount;
            gvLeaveWord.DataSourceID = null; //LeaveWordManager.SelectLeaveWordByAll;
            gvLeaveWord.DataSource   = pds;
            gvLeaveWord.DataBind();
        }
        catch (Exception)
        {
            return;
        }
    }
Exemple #2
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        //this.txtStartTime.Value =Convert.ToString(leaveWord.MsgSendTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
    }
Exemple #3
0
    protected void btnReplay_Click(object sender, EventArgs e)
    {
        LeaveWord leaveWord = new LeaveWord();

        if (typeId > 0)
        {
            leaveWord.MsgTitle         = this.txtTitle.Text.Trim();
            leaveWord.MsgSendTime      = Convert.ToDateTime(this.txtStartTime.Value);
            leaveWord.MeetingBeginTime = Convert.ToDateTime("2010-10-01");
            leaveWord.MsgContent       = "";
            leaveWord.MsgState         = "";
            leaveWord.MeetingAddr      = "";
            leaveWord.ChargeMan        = "";
            leaveWord.MeetingType      = "";
            leaveWord.MsgTypeId.Id     = 4;
            leaveWord.SenderUser.UID   = 2;//Convert.ToString(this.txtSenderUser.Text.Trim());
            leaveWord.ReceiverUser.UID = 1;
            leaveWord.IsAgree          = "";
            leaveWord.Remark           = "";
            LeaveWordManager.AddLeaveWord(leaveWord);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('回复成功!');</script>");

            Response.Redirect("ShowMessage.aspx");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('回复失败!');</script>");
        }
    }
Exemple #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["TypeId"].ToString()))
         {
             typeId = Convert.ToInt32(Request.QueryString["TypeId"].ToString());
             if (Request.QueryString["typeTitle"] == null)
             {
                 LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);
                 this.txtTitle.Text      = leaveWord.MsgTitle;
                 this.txtSenderUser.Text = leaveWord.ReceiverUser.Name;
                 this.txtEndTime.Text    = Convert.ToString(leaveWord.MsgSendTime);
                 if (leaveWord.IsAgree.Trim() == "是")
                 {
                     this.rdoAgree.SelectedValue = "是";
                 }
                 else
                 {
                     this.rdoAgree.SelectedValue = "否";
                 }
                 this.txtRemark.Text = leaveWord.Remark;
                 this.btnOK.Visible  = false;
             }
             else
             {
                 typeId = Convert.ToInt32(Request.QueryString["TypeId"]);
                 Bind();
             }
         }
     }
 }
 protected void LinkButton3_Click(object sender, EventArgs e)
 {
     if (this.lwId.Value != null)
     {
         LeaveWordManager.UpdateWordProviderById(null, null, false, this.lwId.Value);
         DataBindLeaveWord(this.lwId.Value);
     }
 }
Exemple #6
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtEndTime.Text    = Convert.ToString(leaveWord.MeetingBeginTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.ReceiverUser.Name);
    }
Exemple #7
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordMsgTypeId(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtStartTime.Value = Convert.ToString(leaveWord.MsgSendTime);
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
        this.txDes.Value        = leaveWord.Remark;
    }
Exemple #8
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordMsgTypeId(typeId);

        this.txtTitle.Text      = leaveWord.MsgTitle;
        this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
        this.txtEndTime.Text    = Convert.ToString(leaveWord.MsgSendTime);
        this.txtMsgContent.Text = leaveWord.MsgContent;
    }
 //修改
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     if (this.lwId.Value != null && oper.NickName != null)
     {
         LeaveWordManager.UpdateWordProviderById(DateTime.Now.ToString(), oper.NickName, true, this.lwId.Value);
         DataBindLeaveWord(this.lwId.Value);
         string msg = "mailto:" + this.lblEmail.Text + "?subject=LiveSupport";
         ClientScript.RegisterStartupScript(this.GetType(), "Error", "<script>window.open('" + msg + "');</script>");
     }
 }
Exemple #10
0
    private void Bind()
    {
        LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);

        this.txtTitle.Text                 = leaveWord.MsgTitle;
        this.txtStartTime.Text             = Convert.ToString(leaveWord.MeetingBeginTime);
        this.txtMeetingAddr.Text           = leaveWord.MeetingAddr;
        this.txtReceiverUser.Text          = Convert.ToString(leaveWord.ReceiverUser.Name);
        this.txtChargeMan.Text             = leaveWord.ChargeMan;
        this.dropMeetingType.SelectedValue = leaveWord.MeetingType;
        this.txtRemark.Text                = leaveWord.Remark;
    }
Exemple #11
0
    public void DataBindLeaveWord(string id)
    {
        LeaveWord lw = LeaveWordManager.GetLeaveWordById(id);

        this.lblCallerName.Text = lw.CallerName;
        this.lblEmail.Text      = lw.Email;
        this.lblIP.Text         = lw.Ip;
        this.lblPhone.Text      = lw.Phone;
        this.lblCallerName.Text = lw.CallerName;
        this.lblCallerDate.Text = lw.CallerDate;
        this.lblContent.Text    = lw.Content;
        this.lblSenddate.Text   = lw.Senddate;
        this.lblSubject.Text    = lw.Subject;
        this.lblIsSend.Text     = lw.IsSend;
        this.lblSendName.Text   = lw.OperatorName;
        this.lwId.Value         = lw.Id;
        this.lblDomainName.Text = lw.DomainName;
    }
    public void DataBindLeaveWord(string accountId, string domainName, string beginDate, string endDate)
    {
        List <LeaveWord> list = null;

        if (domainName == null)
        {
            list = LeaveWordManager.GetLeaveWordByAccountId(accountId, beginDate, endDate);
        }
        else
        {
            list = LeaveWordManager.GetLeaveWordByAccountIdAndDomainName(accountId, domainName, beginDate, endDate);
        }

        if (list != null)
        {
            this.gvLeaveWord.DataSource = list;
            this.gvLeaveWord.DataBind();
        }
    }
Exemple #13
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     int[] ids = new int[gvLeaveWord.Rows.Count];
     for (int a = 0; a < gvLeaveWord.Rows.Count; a++)
     {
         if ((gvLeaveWord.Rows[a].FindControl("chkOne") as CheckBox).Checked)
         {
             HiddenField hfId = gvLeaveWord.Rows[a].FindControl("hfOne") as HiddenField;
             ids[a] = Convert.ToInt32(hfId.Value);
         }
     }
     foreach (int riid in ids)
     {
         if (riid != 0)
         {
             LeaveWordManager.DeleteLeaveWordById(riid);
         }
     }
     Pager1_onLoadPageIndexChaning(Pager1.PageIndex);
 }
Exemple #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["TypeId"].ToString()))
         {
             typeId = Convert.ToInt32(Request.QueryString["TypeId"].ToString());
             if (Request.QueryString["typeTitle"] == null)
             {
                 LeaveWord leaveWord = LeaveWordManager.GetLeaveWordById(typeId);
                 this.txtTitle.Text      = leaveWord.MsgTitle;
                 this.txtStartTime.Value = Convert.ToString(leaveWord.MsgSendTime);
                 this.txtSenderUser.Text = Convert.ToString(leaveWord.SenderUser.Name);
                 this.txDes.Value        = leaveWord.Remark;
                 this.btnReplay.Visible  = false;
             }
             else
             {
                 typeId = Convert.ToInt32(Request.QueryString["TypeId"]);
                 Bind();
             }
         }
     }
 }
Exemple #15
0
    /// <summary>
    /// 添加审批记录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Examine em = new Examine();

        em.RequisitionID   = Convert.ToInt32(txtApplicationId.Text);
        em.RequisitionType = txtType.Text;
        em.ExamineUID.UID  = Convert.ToInt32(((UserInfo)Session["user"]).UID);
        em.ExamineIdea     = this.txtCause.Text;
        em.EndTime         = Convert.ToDateTime(txtTime.Value);
        em.IsApproved      = rdoAccess.SelectedValue == "未过" ? "未过" : "通过";

        //不管是否通过,都在审批记录表中添加一条审批记录
        if (ExamineManager.AddExamine(em) > 0)
        {
            //判断审批是否通过,
            if (rdoAccess.SelectedValue == "通过")
            {
                if (txtType.Text == "会议申请")
                {
                    try
                    {
                        MeetingApplication ma = MeetingApplicationManager.GetMeetingApplicationById(Convert.ToInt32(txtApplicationId.Text));
                        //获取所有与会人员,
                        string applicationMan = ma.WithinEnlistMan;

                        LeaveWord lw = new LeaveWord();
                        lw.MsgTitle         = ma.MeetTitle;                                         //会议标题
                        lw.MsgContent       = ma.MeetContent;                                       //会议内容
                        lw.MsgSendTime      = Convert.ToDateTime(DateTime.Now.ToShortDateString()); //发送时间
                        lw.MsgState         = "未读";
                        lw.MsgTypeId.Id     = 1;                                                    //1代表会议申请
                        lw.SenderUser       = user;                                                 //发送者
                        lw.MeetingBeginTime = ma.BeginTime;                                         //开会时间
                        lw.MeetingAddr      = ma.RoomInfo.RomeAddr;                                 //会议地点
                        lw.ChargeMan        = ma.Compere;                                           //会议负责人
                        lw.MeetingType      = ma.MeetType;

                        //用“,”号分割与会人员
                        string[] array = applicationMan.Split(new char[] { ',' });
                        for (int i = 0; i < array.Length; i++)
                        {
                            int uid = UserInfoManager.GetLeaveIDByMName(array[i]);
                            lw.ReceiverUser.UID = uid;
                            int flag = LeaveWordManager.AddLeaveWord(lw);
                        }
                        //更新会议申请的状态
                        MeetingApplicationManager.ModifyMeetingState(Convert.ToInt32(txtApplicationId.Text), "已办");
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
                    }
                    catch (Exception)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
                        return;
                    }
                }
                else if (txtType.Text == "用车申请")
                {
                    try
                    {
                        //更新用车申请状态
                        int flag = CarByapplyManager.UpadteByapplySate(Convert.ToInt32(txtApplicationId.Text), "已办");
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
                    }
                    catch (Exception)
                    {
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
                        return;
                    }
                }
            }
            else   //不通过,终结申请
            {
                if (txtType.Text == "会议申请")
                {
                    MeetingApplicationManager.ModifyMeetingState(Convert.ToInt32(txtApplicationId.Text), "终结");
                }
                else if (txtType.Text == "用车申请")
                {
                    //终结用车申请
                    int flag = CarByapplyManager.UpadteByapplySate(Convert.ToInt32(txtApplicationId.Text), "终结");
                }


                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('已终结!');window.location='Matter.aspx'</script>", true);
            }



            if (txtType.Text == "任务申请") //根据实际完成金额更新任务总体完成进度
            {
                try
                {
                    if (em.IsApproved == "通过")
                    {
                        TaskManager.UpdateTaskNowStatus(Convert.ToInt32(txtApplicationId.Text));//更新任务状态
                        //更新任务的完成比例
                        TaskManager.UpdateTaskFinshStatus(Convert.ToInt32(txtApplicationId.Text));

                        //更新申请单状态为通过
                        new RolePowerManager().UpdatePaddingStatus("已办", Convert.ToInt32(txtApplicationId.Text.Trim()));
                    }
                    else
                    {
                        //更新申请单状态为终结
                        new RolePowerManager().UpdatePaddingStatus("终结", Convert.ToInt32(txtApplicationId.Text.Trim()));
                    }
                }
                catch (Exception)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('更新任务状态失败!');", true);
                    return;
                }
            }
            if (txtType.Text == "资源采购")
            {
                StockApplication stock = StockApplicationManager.Get((int)em.RequisitionID);
                if (em.IsApproved == "通过")
                {
                    stock.IsExamine = "已办";
                    IList <ApplicationResourseInfo> items = ApplicationResourceManager.GetAllApplicationResource(2, stock.SAID);
                    foreach (ApplicationResourseInfo item in items)
                    {
                        item.Resource.Number += item.Number;
                        ResourceInfoManager.UpdateResourceInfo(item.Resource);
                    }
                }
                else
                {
                    stock.IsExamine = "终结";
                }
                StockApplicationManager.Update(stock);
            }
            else if (txtType.Text == "资源借用")
            {
                BorrowApplication borrow = BorrowApplicationManager.Get((int)em.RequisitionID);
                if (em.IsApproved == "通过")
                {
                    borrow.IsExamine = "已办";
                    IList <ApplicationResourseInfo> items = ApplicationResourceManager.GetAllApplicationResource(1, borrow.BAID);
                    foreach (ApplicationResourseInfo item in items)
                    {
                        item.Resource.Number -= item.Number;
                        ResourceInfoManager.UpdateResourceInfo(item.Resource);
                    }
                }
                else
                {
                    borrow.IsExamine = "终结";
                }
                BorrowApplicationManager.Update(borrow);
            }

            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('已审核!');location.href='CheckNote.aspx'", true);
            // Response.Redirect("");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('审核失败!');", true);
        }
    }