public static int AddData(CandidateSelectionHistoryDTO data)
        {
            using (DBEntities db = new DBEntities())
            {
                db.TB_CANDIDATE_SELECTION_HISTORY.Add(new TB_CANDIDATE_SELECTION_HISTORY
                {
                    CANDIDATE_ID = data.CANDIDATE_ID,
                    PIC_ID       = data.PIC_ID,
                    CANDIDATE_APPLIED_POSITION  = data.CANDIDATE_APPLIED_POSITION,
                    CANDIDATE_SUITABLE_POSITION = data.CANDIDATE_SUITABLE_POSITION,
                    CANDIDATE_SOURCE            = data.CANDIDATE_SOURCE,
                    CANDIDATE_STATE             = data.CANDIDATE_STATE,
                    CANDIDATE_EXPECTED_SALARY   = data.CANDIDATE_EXPECTED_SALARY,
                    PROCESS_DATE             = DateTime.Now,
                    NOTES                    = data.NOTES,
                    CANDIDATE_INTERVIEW_DATE = data.CANDIDATE_INTERVIEW_DATE,
                    LAST_UPDATE              = DateTime.Now,
                    VIEWS_INFORMATION        = "YES",
                    CANDIDATE_CLIENT         = data.CANDIDATE_CLIENT,
                    DELIVERY_ID              = data.DELIVERY_ID
                });

                return(db.SaveChanges());
            }
        }
        public static int AddData(CandidateSelectionHistoryDTO data)
        {
            using (DBEntities db = new DBEntities())
            {
                db.TB_CANDIDATE_SELECTION_HISTORY.Add(new TB_CANDIDATE_SELECTION_HISTORY
                {
                    CANDIDATE_ID = data.CANDIDATE_ID,
                    PIC_ID       = data.PIC_ID,
                    CANDIDATE_APPLIED_POSITION  = data.CANDIDATE_APPLIED_POSITION,
                    CANDIDATE_SUITABLE_POSITION = data.CANDIDATE_SUITABLE_POSITION,
                    CANDIDATE_SOURCE            = data.CANDIDATE_SOURCE,
                    CANDIDATE_STATE             = data.CANDIDATE_STATE,
                    CANDIDATE_EXPECTED_SALARY   = data.CANDIDATE_EXPECTED_SALARY,
                    PROCESS_DATE = DateTime.Now,
                    NOTES        = data.NOTES
                });

                return(db.SaveChanges());
            }
        }
        public static int EditData(CandidateSelectionHistoryDTO Data)
        {
            using (DBEntities db = new DBEntities())
            {
                //prepare data pic
                UserDTO DataPIC = (UserDTO)HttpContext.Current.Session["UserLogin"];

                var DataSelectHistory = db.TB_CANDIDATE_SELECTION_HISTORY.FirstOrDefault(sh => sh.CANDIDATE_ID == Data.CANDIDATE_ID && sh.CANDIDATE_STATE == Data.CANDIDATE_STATE);

                DataSelectHistory.PIC_ID                      = DataPIC.USER_ID;
                DataSelectHistory.CANDIDATE_STATE             = Data.CANDIDATE_STATE;
                DataSelectHistory.NOTES                       = Data.NOTES;
                DataSelectHistory.PROCESS_DATE                = DateTime.Now;
                DataSelectHistory.CANDIDATE_EXPECTED_SALARY   = Data.CANDIDATE_EXPECTED_SALARY;
                DataSelectHistory.CANDIDATE_INTERVIEW_DATE    = Data.CANDIDATE_INTERVIEW_DATE;
                DataSelectHistory.CANDIDATE_APPLIED_POSITION  = Data.CANDIDATE_APPLIED_POSITION;
                DataSelectHistory.CANDIDATE_SUITABLE_POSITION = Data.CANDIDATE_SUITABLE_POSITION;
                DataSelectHistory.CANDIDATE_SOURCE            = Data.CANDIDATE_SOURCE;
                return(db.SaveChanges());
            }
        }