using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace bajaWare.UserControl.Comun
{
    public partial class wucListaInterfaces : System.Web.UI.UserControl
    {



        private int intCreditoID
        {
            get
            {
                if (ViewState["intCreditoID"] == null)
                    return 0;
                else
                    return (int)ViewState["intCreditoID"];
            }
            set { ViewState.Add("intCreditoID", value); }
        }



        protected void Page_Load(object sender, EventArgs e)
        {

        }


        public void CargaGrid(InterfacesService.Interfaces[] lstInterfaces, int iCreditoID)
        {
            intCreditoID = iCreditoID;

            grvListaInterface.DataSource = lstInterfaces;
            grvListaInterface.DataBind();
            UPD_grvListaInterface.Update();
        }


        #region GridView


        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grvListaInterface_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            GridView gridView = (GridView)sender;

            if (e.Row.RowType == DataControlRowType.Header)
            {


            }
            // Body
            if (e.Row.RowType == DataControlRowType.DataRow)
            {

            }

        }



        protected void grvListaInterface_OnRowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "go")
                {
                    Response.Redirect(e.CommandArgument.ToString() + "?intCredito=" + intCreditoID);
                }
            }
            catch (Exception ex)
            {
               
            }
        }

        #endregion

    }
}