static bool Delete(Project_Cast p)
 {
     pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
     return ta.DeleteByID(p.id) == 0 ?  false:true;
 }
        public static bool UpdateByID(Project_Cast o)
        {
            o.modifydate = DateTime.Now;
            pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
            int ret  = ta.UpdateByID(
              o.project_id,
              o.contact_id,
              o.character_description,
              o.wardrobe_description,
              o.calltime_description,
              o.notes,
              o.createdate,
              o.modifydate,
              o.id

               );
               if(ret == 1) return true;
               return false;
        }
        public static bool Insert(Project_Cast o)
        {
            o.createdate = o.modifydate = DateTime.Now;
            pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
            o.id = Convert.ToInt32(ta.InsertQuery(
              o.project_id,
              o.contact_id,
              o.character_description,
              o.wardrobe_description,
              o.calltime_description,
              o.notes,
              o.createdate,
              o.modifydate

               ));
               return true;
        }
        public static Project_Cast GetByID(int id)
        {
            try{
               pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
               pmanAPI.App_Data.pmanDB.Project_CastDataTable table = ta.GetDataByID(id);
               pmanAPI.App_Data.pmanDB.Project_CastRow row = (pmanAPI.App_Data.pmanDB.Project_CastRow)table.Rows[0];

               return Project_Cast.LoadFromModel(row);
               }
               catch(Exception){
               return null;
               }
        }
 public static List<Project_Cast> GetAll()
 {
     pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
     pmanAPI.App_Data.pmanDB.Project_CastDataTable table = ta.GetData();
     return LoadFromModel(table);
 }
 public static bool Exists(int id)
 {
     pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter ta = new pmanAPI.App_Data.pmanDBTableAdapters.Project_CastTableAdapter();
     if (ta.GetSumByID(id) == 0)
         return false;
     return true;
 }