예제 #1
0
    /// <summary>
    /// 详细
    /// </summary>
    /// <param name="id"></param>
    public void Bind(int id)
    {
        Car_Davnote dav = CarDavnoteManager.SelectDavnoteById(Id);

        txtDept.Text       = dav.DavDept.Departmentname.ToString();
        txtDirection.Text  = dav.DavTtion.ToString();
        txtLiCheng.Text    = dav.DavCourse.ToString();
        txtMan.Text        = dav.DavMan.Trim().ToString();
        txtDriver.Text     = dav.DavDriver.Trim().ToString();
        txtMark.Text       = dav.DavMark.ToString();
        txtOutDate.Text    = dav.DavData.ToString();
        txtReMark.Text     = dav.DavRemark.ToString();
        txtReturnDate.Text = dav.DavReturnData.ToString();
        txtStartAddr.Text  = dav.DavPlace.ToString();

        if (dav.DavTypeId.TypeId == 1)
        {
            rdo1.Checked = true;
        }
        else if (dav.DavTypeId.TypeId == 2)
        {
            rdo2.Checked = true;
        }
        else if (dav.DavTypeId.TypeId == 3)
        {
            rdo3.Checked = true;
        }
        else
        {
            rdo4.Checked = true;
        }
    }
예제 #2
0
    void ucpage_onPageIndexChanging(int pageIndex)
    {
        string mark   = txtMark.Text.ToString();
        string typeid = ddlType.SelectedValue.ToString();
        string dept   = ddlDept.SelectedValue.ToString();

        gvDavnote.DataSourceID = null;
        IList <Car_Davnote> list = CarDavnoteManager.SelectDavnoteDark(txtMark.Text, ddlType.SelectedValue, ddlDept.SelectedValue);

        if (list.Count == 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('无记录!');", true);
            return;
        }
        PagedDataSource page = new PagedDataSource();

        page.AllowPaging      = true;
        page.DataSource       = list;// CarDavnoteManager.SelectDavnoteDark(txtMark.Text, ddlDept.SelectedValue, ddlType.SelectedValue);
        page.PageSize         = 5;
        ucpage.PageCount      = page.PageCount;
        page.CurrentPageIndex = pageIndex;
        gvDavnote.DataSource  = page;
        gvDavnote.DataBind();
        ucpage.SetButtonEnable();
    }
예제 #3
0
    void ucpage_onPageIndexChanging(int pageIndex)
    {
        PagedDataSource page = new PagedDataSource();

        page.AllowPaging = true;
        page.DataSource  = CarDavnoteManager.SelectDavnoteDark(txtMark.Text, ddlDept.SelectedValue, ddlType.SelectedValue);
        page.PageSize    = 5;
        ucpage.PageCount = page.PageCount;

        page.CurrentPageIndex = pageIndex;

        gvDavnote.DataSource = page;
        ucpage.SetButtonEnable();
        gvDavnote.DataBind();
    }
예제 #4
0
    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Car_Davnote davnote = new Car_Davnote();

        davnote = getdavs(ref davnote);
        int num = CarDavnoteManager.AddDavte(davnote);

        if (num > 0)
        {
            Page.ClientScript.RegisterStartupScript(GetType(), "", "<script>alert('保存成功!');window.location.href=Davnotelist.aspx';</script>");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加失败!');", true);
        }
    }
예제 #5
0
    /// <summary>
    /// 查询
    /// </summary>
    private void Bind()
    {
        string mark   = txtMark.Text.ToString();
        string typeid = ddlType.SelectedValue.ToString();
        string dept   = ddlDept.SelectedValue.ToString();

        gvDavnote.DataSourceID = null;
        IList <Car_Davnote> list = CarDavnoteManager.SelectDavnoteDark(txtMark.Text, ddlType.SelectedValue, ddlDept.SelectedValue);

        if (list.Count == 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('无记录!');", true);
            return;
        }
        gvDavnote.DataSource = list;

        gvDavnote.DataBind();
    }
예제 #6
0
    /// <summary>
    /// 删除方法
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        CheckBox   chckbx      = null;
        LinkButton lkbtnDelete = null;
        string     Id          = "";

        for (int i = 0; i < this.gvDavnote.Rows.Count; i++)
        {
            chckbx      = this.gvDavnote.Rows[i].FindControl("chSelect") as CheckBox;
            lkbtnDelete = this.gvDavnote.Rows[i].FindControl("lnkdel") as LinkButton;
            if (chckbx.Checked)
            {
                string Id1 = lkbtnDelete.CommandArgument.ToString();
                Id += Id1 + ",";
            }
        }

        if (Id != "")
        {
            try
            {
                Id = Id.Substring(0, Id.Length - 1);


                CarDavnoteManager.DeleteDavnote(Id);
                Bind();
            }
            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除失败!');", true);
                return;
            }
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请选择要删除的项!');", true);
        }
    }
예제 #7
0
    public void Bind(int id)
    {
        Car_Davnote dav = CarDavnoteManager.SelectDavnoteById(Id);

        ddlDepartment.DataSourceID   = null;
        ddlDepartment.DataSource     = DepartmentManager.GetAllDepartment();
        ddlDepartment.DataTextField  = "departmentName";
        ddlDepartment.DataValueField = "Id";
        ddlDepartment.DataBind();
        ddlDepartment.SelectedValue = dav.DavDept.Id.ToString();

        txtDirection.Text   = dav.DavTtion.ToString();
        txtLiCheng.Text     = dav.DavCourse.ToString();
        txtMan.Text         = dav.DavMan.Trim().ToString();
        txtDriver.Text      = dav.DavDriver.Trim().ToString();
        txtMark.Text        = dav.DavMark.ToString();
        txtOutDate.Value    = dav.DavData.ToString();
        txtReMark.Text      = dav.DavRemark.ToString();
        txtReturnDate.Value = dav.DavReturnData.ToString();
        txtStartAddr.Text   = dav.DavPlace.ToString();

        if (dav.DavTypeId.TypeId == 1)
        {
            rdo1.Checked = true;
        }
        else if (dav.DavTypeId.TypeId == 2)
        {
            rdo2.Checked = true;
        }
        else if (dav.DavTypeId.TypeId == 3)
        {
            rdo3.Checked = true;
        }
        else
        {
            rdo4.Checked = true;
        }
    }
예제 #8
0
    protected void gvDavnote_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "del")
        {
            string Id = e.CommandArgument.ToString();
            try
            {
                int num = CarDavnoteManager.DeleteDavnote(Id);

                if (num > 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除成功!');", true);
                }
                Bind();
            }

            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('删除失败!');", true);
                return;
            }
        }
    }