Esempio n. 1
0
        public static string[] GetEditActor(string id)
        {
            ActorBAL  sActorBAL = new ActorBAL();
            DataTable sDt       = new DataTable();

            string[] strActorData = new string[9];

            try
            {
                sActorBAL.ActorId = Convert.ToInt32(id);
                sDt = sActorBAL.ActorSelect();

                if (sDt.Rows.Count > 0)
                {
                    strActorData[0] = sDt.Rows[0]["FirstName"].ToString();
                    strActorData[1] = sDt.Rows[0]["LastName"].ToString();
                    strActorData[2] = sDt.Rows[0]["Email"].ToString();
                    strActorData[3] = Convert.ToDateTime(sDt.Rows[0]["BirthDate"].ToString()).Date.ToShortDateString();
                    strActorData[4] = sDt.Rows[0]["Age"].ToString();
                    strActorData[5] = sDt.Rows[0]["Bio"].ToString();
                    strActorData[6] = sDt.Rows[0]["ActorDocument"].ToString();
                    strActorData[7] = sDt.Rows[0]["Other"].ToString();
                    strActorData[8] = id;
                }

                return(strActorData);
            }
            catch (Exception ex)
            {
                strActorData[0] = ex.Message;
                return(strActorData);
            }
        }
Esempio n. 2
0
 public void getActor()
 {
     try
     {
         dataTable = actorBAL.ActorSelect();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     if (dataTable.Rows.Count > 0)
     {
         lnkExportExcel.Visible = true;
         ViewState["dtActor"]   = dataTable;
         gvActor.DataSource     = dataTable;
         gvActor.DataBind();
     }
     else
     {
         lnkExportExcel.Visible = false;
     }
 }