<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ★33°空間‰


                           ----★七彩服飾  【最潮拜☆日單精品】【Esprit】【Hotwind】滿150包郵-女裝-流行女裝    www.7color.hb.cn

                           ----智力比知識(shí)重要,素質(zhì)比智力重要,覺悟比素質(zhì)更重要
    posts - 110,comments - 35,trackbacks - 0
    using ?TestWeb.HR.BusinessLogicLayer;
    using ?TestWeb.HR.DataAccessLayer;
    public ? partial ? class ?HR_CompanyView?:?System.Web.UI.UserControl
    {
    ????
    protected ? void ?Page_Load( object ?sender,?EventArgs?e)
    ????
    {
    ????????
    if ?( ! this .IsPostBack)
    ????????
    {
    ????????????GetAllCompanies();?
    // 初試加載所有公司
    ????????}

    }

    ????
    /// ? <summary>
    ????
    /// ?返回所有公司
    ????
    /// ? </summary>

    ???? private ? void ?GetAllCompanies()
    ????
    {
    ????????
    try
    ????????
    {
    ????????????List
    < Company > ?companyList? = ? new ?List < Company > ();
    ????????????companyList?
    = ?Company.GetAllCompanies();
    ????????????
    if ?(companyList? != ? null )
    ????????????
    {
    ????????????????
    this .GridView1.DataSource? = ?companyList;
    ????????????????
    this .GridView1.DataBind();
    ????????????}

    ????????}

    ????????
    catch ?(Exception?ex)
    ????????
    {
    ????????????ShowMessage.ErrorMessage(
    this .Page,?ex.Message);
    ????????}

    ????}

    ????
    /// ? <summary>
    ????
    /// ?編輯公司
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_RowEditing( object ?sender,?GridViewEditEventArgs?e)
    ????
    {
    ????????
    this .GridView1.EditIndex? = ?e.NewEditIndex;
    ????????GetAllCompanies();
    ????}

    ????
    /// ? <summary>
    ????
    /// ?取消編輯
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_RowCancelingEdit( object ?sender,?GridViewCancelEditEventArgs?e)
    ????
    {
    ????????
    this .GridView1.EditIndex? = ? - 1 ;
    ????????GetAllCompanies();
    ????}

    ????
    /// ? <summary>
    ????
    /// ?更新公司
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_RowUpdating( object ?sender,?GridViewUpdateEventArgs?e)
    ????
    {
    ????????GridViewRow?uprow?
    = ? this .GridView1.Rows[e.RowIndex];
    ????????TextBox?text1?
    = ?(TextBox)uprow.Cells[ 0 ].FindControl( " TextBox1 " );
    ????????TextBox?text2?
    = ?(TextBox)uprow.Cells[ 0 ].FindControl( " TextBox2 " );
    ????????TextBox?text3?
    = ?(TextBox)uprow.Cells[ 0 ].FindControl( " TextBox3 " );
    ????????HyperLink?hlk?
    = ?(HyperLink)uprow.Cells[ 0 ].FindControl( " HyperLink1 " );
    ????????
    int ?companyId? = ?Convert.ToInt32( this .GridView1.DataKeys[e.RowIndex].Value);
    ????????
    // 直接調(diào)用存儲(chǔ)過程進(jìn)行更新
    ???????? string ?connectionstring? = ?ConfigurationManager.ConnectionStrings[ " TESTDB_Database_Connection " ].ConnectionString;
    ????????SqlCommand?upcmd?
    = ? new ?SqlCommand();
    ????????upcmd.CommandType?
    = ?CommandType.StoredProcedure;
    ????????upcmd.CommandText?
    = ? " UPCompany " ;
    ????????upcmd.Parameters.Add(
    " @CompanyName " ,?SqlDbType.VarChar,? 50 );
    ????????upcmd.Parameters[
    " @CompanyName " ].Value? = ?text1.Text.Trim();
    ????????upcmd.Parameters.Add(
    " @Phone " ,?SqlDbType.VarChar,? 50 );
    ????????upcmd.Parameters[
    " @Phone " ].Value? = ?text2.Text.Trim();
    ????????upcmd.Parameters.Add(
    " @Fax " ,?SqlDbType.VarChar,? 50 );
    ????????upcmd.Parameters[
    " @Fax " ].Value? = ?text3.Text.Trim();
    ????????upcmd.Parameters.Add(
    " @WebSite " ,?SqlDbType.VarChar,? 50 );
    ????????upcmd.Parameters[
    " @WebSite " ].Value? = ?hlk.Text.Trim();
    ????????upcmd.Parameters.Add(
    " @CompanyId " ,?SqlDbType.Int,? 4 );
    ????????upcmd.Parameters[
    " @CompanyId " ].Value? = ?companyId;
    ????????SqlConnection?con?
    = ? new ?SqlConnection(connectionstring);
    ????????upcmd.Connection?
    = ?con;
    ????????con.Open();
    ????????upcmd.ExecuteNonQuery();
    ????????con.Close();

    ????????
    this .GridView1.EditIndex? = ? - 1 ;
    ????????GetAllCompanies();
    ????}

    ????
    /// ? <summary>
    ????
    /// ?刪除公司
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_RowDeleting( object ?sender,?GridViewDeleteEventArgs?e)
    ????
    {
    ????????
    int ?companyId? = ?Convert.ToInt32( this .GridView1.DataKeys[e.RowIndex].Value);
    ????????
    string ?connectionstring? = ?ConfigurationManager.ConnectionStrings[ " TESTDB_Database_Connection " ].ConnectionString;
    ????????SqlCommand?delcmd?
    = ? new ?SqlCommand();
    ????????delcmd.CommandType?
    = ?CommandType.StoredProcedure;
    ????????delcmd.CommandText?
    = ? " HR_DeleteCompanyByCompanyId " ;
    ????????delcmd.Parameters.Add(
    " @CompanyId " ,?SqlDbType.Int,? 4 );
    ????????delcmd.Parameters[
    " @CompanyId " ].Value? = ?companyId;
    ????????SqlConnection?_Con?
    = ? new ?SqlConnection(connectionstring);
    ????????delcmd.Connection?
    = ?_Con;
    ????????_Con.Open();
    ????????delcmd.ExecuteNonQuery();
    ????????_Con.Close();
    ????????GetAllCompanies();
    ????}

    ????
    /// ? <summary>
    ????
    /// ?允許分頁
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_PageIndexChanging( object ?sender,?GridViewPageEventArgs?e)
    ????
    {
    ????????
    this .GridView1.PageIndex? = ?e.NewPageIndex;
    ????????GetAllCompanies();
    ????}

    ????
    /// ? <summary>
    ????
    /// ?焦點(diǎn)行顏色變化
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?GridView1_RowDataBound( object ?sender,?GridViewRowEventArgs?e)
    ????
    {
    ????????
    if ?(e.Row.RowType? == ?DataControlRowType.DataRow)
    ????????
    {
    ????????????
    // 當(dāng)鼠標(biāo)放上去的時(shí)候?先保存當(dāng)前行的背景顏色?并給附一顏色?
    ????????????e.Row.Attributes.Add( " onmouseover " ,? " currentcolor=this.style.backgroundColor;this.style.backgroundColor='yellow',this.style.fontWeight=''; " );
    ????????????
    // 當(dāng)鼠標(biāo)離開的時(shí)候?將背景顏色還原的以前的顏色?
    ????????????e.Row.Attributes.Add( " onmouseout " ,? " this.style.backgroundColor=currentcolor,this.style.fontWeight=''; " );
    ????????}

    ????????
    // 單擊行改變行背景顏色?
    ???????? if ?(e.Row.RowType? == ?DataControlRowType.DataRow)
    ????????
    {
    ????????????e.Row.Attributes.Add(
    " onclick " ,? " this.style.backgroundColor='#99cc00';?this.style.color='buttontext';this.style.cursor='default'; " );
    ????????}

    ????}

    ????
    /// ? <summary>
    ????
    /// ?根據(jù)ID獲取公司詳細(xì)信息
    ????
    /// ? </summary>
    ????
    /// ? <param?name="sender"></param>
    ????
    /// ? <param?name="e"></param>

    ???? protected ? void ?Button1_Click( object ?sender,?EventArgs?e)
    ????
    {
    ????????Response.Redirect(
    " ~/CompanyDetails.aspx " );
    ????}
    ?
    }
    posted on 2006-10-30 14:44 圣域飛俠 閱讀(538) 評(píng)論(0)  編輯  收藏

    只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 青柠影视在线观看免费高清| 亚洲一区二区三区电影| 国内永久免费crm系统z在线| 免费二级毛片免费完整视频| 国产亚洲一卡2卡3卡4卡新区 | 亚洲av中文无码乱人伦在线播放| 七次郎成人免费线路视频| 亚洲国产精品综合久久一线| 国产午夜亚洲精品不卡免下载 | 亚洲免费人成在线视频观看| 国产免费阿v精品视频网址| 亚洲大尺度无码无码专区| 暖暖在线视频免费视频| 亚洲高清免费在线观看| 亚洲视频免费播放| 亚洲a∨无码男人的天堂| 女人18毛片特级一级免费视频| 久久久久久亚洲av无码蜜芽| 亚洲欧洲自拍拍偷精品 美利坚| 久久久WWW成人免费精品| 亚洲国产成人久久综合一| 久视频精品免费观看99| 亚洲免费网站观看视频| 亚洲精品乱码久久久久久不卡| a级成人免费毛片完整版| 亚洲精品动漫在线| 日本人护士免费xxxx视频| jzzjzz免费观看大片免费| 久久精品国产精品亚洲艾草网| 4虎永免费最新永久免费地址| 日日摸日日碰夜夜爽亚洲| 久久夜色精品国产亚洲| 69成人免费视频| 一级毛片在播放免费| 亚洲视频国产视频| 国产在线98福利播放视频免费| 永久免费不卡在线观看黄网站| 亚洲高清有码中文字| 亚洲乱色熟女一区二区三区丝袜 | 亚洲综合亚洲国产尤物| 午夜一级毛片免费视频|