public ActionResult EditInterviewPanel(InterviewPanelViewModel obj, FormCollection objf)
        {
            InterviewPanelModel objI = new InterviewPanelModel();

            if (obj.Mode == "A")
            {
                int result = AddIP(obj, objf);
                if (result == 0)
                {
                    TempData["Message"] = "Interview Panel has not added";
                    return(RedirectToAction("AddInterviewPanel"));
                }
                //TempData["Message"] = "Interview Panel added successfully";
                return(RedirectToAction("AddInterviewPanel"));
            }
            if (obj.Mode == "U")
            {
                objI.PanelId = Convert.ToInt32(CheckAccessAttribute.Decode(objf["InterviewPanelId"]));
                objI.EmpId   = obj.EmpId;
                objI.CandidateDesignations = objf["lstDesignation"];
                objI.SecondarySkills       = objf["lstSkill"];
                objI.LevelIds         = objf["chkLevel"];
                objI.TrainingAttended = obj.TrainingAttendedId;
                objI.Inducted         = obj.InductedId;
                objI.CreatedBy        = Convert.ToInt32(Session["EmpID"]);
                int result = _objIInterviewPanelService.UpdateInterviewPanel(objI);
                if (objI.PanelId != 0)
                {
                    TempData["Message"] = "Interview Panel updated successfully";
                    return(RedirectToAction("AddInterviewPanel"));
                }
            }
            return(View());
        }
Exemplo n.º 2
0
        public int Delete(InterviewPanelModel Obj)
        {
            int result = 0;

            using (TransactionScope Ts = new TransactionScope())
            {
                //Delete Panel Data
                T_InterviewPanel objIP = new T_InterviewPanel();
                objIP.PanelId = Obj.PanelId;
                objIP         = _IInterviewPanelRepository.SingleOrDefault(Obj.PanelId);
                //Set The data which need to update
                objIP.PanelId     = Obj.PanelId;
                objIP.IsActive    = 0;
                objIP.UpdatedBy   = Obj.CreatedBy;
                objIP.UpdatedDate = DateTime.Today;
                result            = _IInterviewPanelRepository.Delete(objIP);

                //Delete Level
                if (result == 1)
                {
                    result = _IInterviewPanelRepository.DeleteInterviewPanel(Obj);
                }
                Ts.Complete();
                return(1);
            }
        }
Exemplo n.º 3
0
 public int UpdateInterviewPanel(InterviewPanelModel objUpdate)
 {
     using (var _context = new RMS_Entities())
     {
         var GetIPList = _context.Usp_IP_UpdateIP(objUpdate.PanelId, objUpdate.EmpId, objUpdate.CandidateDeptId, objUpdate.CandidateDesignations, objUpdate.SecondarySkills, objUpdate.LevelIds, objUpdate.Inducted, objUpdate.TrainingAttended, objUpdate.CreatedBy)
                         .ToList();
         return(0);
     }
 }
Exemplo n.º 4
0
        public int DeleteInterviewPanel(InterviewPanelModel objUpdate)
        {
            using (var db = new RMS_Entities())
            {
                var list = from data in db.T_IP_PanelLevel
                           where data.PanelId == objUpdate.PanelId
                           select data;
                //Delete Level
                foreach (T_IP_PanelLevel i in list)
                {
                    var c = (from singledata in db.T_IP_PanelLevel
                             where singledata.LevelId == i.LevelId && singledata.IsActive == 1
                             select singledata).FirstOrDefault();
                    if (c != null)
                    {
                        T_IP_PanelLevel objIPL = new T_IP_PanelLevel();
                        c.IsActive    = 0;
                        c.UpdatedBy   = objUpdate.CreatedBy;
                        c.UpdatedDate = DateTime.Today;
                    }
                    db.SaveChanges();
                }

                //Delete Level
                var listDesign = from data in db.T_IP_PanelDesignation
                                 where data.PanelId == objUpdate.PanelId
                                 select data;
                //Delete Level
                foreach (T_IP_PanelDesignation i in listDesign)
                {
                    var c = (from singledata in db.T_IP_PanelDesignation
                             where singledata.PanelDesignationId == i.PanelDesignationId && singledata.IsActive == 1
                             select singledata).FirstOrDefault();
                    if (c != null)
                    {
                        T_IP_PanelDesignation objIPLD = new T_IP_PanelDesignation();
                        // c.PanelDesignationId = objIPLD.PanelDesignationId;
                        c.IsActive    = 0;
                        c.UpdatedBy   = objUpdate.CreatedBy;
                        c.UpdatedDate = DateTime.Today;
                    }
                    db.SaveChanges();
                }
                return(1);
            }
        }
Exemplo n.º 5
0
        public List <InterviewPanelModel> GetInterviewPanelSearch(string Technology, string Level, string DeptId, string Designation,
                                                                  string BusinessVertical, string Skill)
        {
            List <InterviewPanelModel> objIPList = new List <InterviewPanelModel>();
            InterviewPanelModel        objIP;

            using (var result = new RMS_Entities())
            {
                var GetIPList = result.USP_IP_GetInterviewPanelSearch(Convert.ToInt32(Technology),
                                                                      Convert.ToInt32(Level),
                                                                      Convert.ToInt32(DeptId),
                                                                      Convert.ToInt32(Designation),
                                                                      Convert.ToInt32(BusinessVertical)
                                                                      , Skill).ToList <USP_IP_GetInterviewPanelSearch_Result>();
                foreach (var obj in GetIPList)
                {
                    objIP                          = new InterviewPanelModel();
                    objIP.PanelId                  = obj.PANELID;
                    objIP.PanelIdEncr              = CommonRepository.Encode(obj.PANELID.ToString());
                    objIP.EmpId                    = Convert.ToInt32(obj.EMPID);
                    objIP.EmpName                  = obj.EMPNAME;
                    objIP.DesignationName          = obj.DesignationName;
                    objIP.LINEMANAGER              = obj.LINEMANAGER;
                    objIP.BusinessVertical         = obj.BUSINESSVERTICAL;
                    objIP.EmpSecondarySkill        = obj.SECONDARYSKILL;
                    objIP.PrimarySkillName         = obj.PRIMARYSKILLNAME;
                    objIP.CandidateDeptId          = Convert.ToInt32(obj.CANDIDATEDEPTID);
                    objIP.DEPTName                 = obj.DEPTNAME;
                    objIP.CandidateDesignations    = obj.CANDIDATEDESIGNATIONS;
                    objIP.CandidateDesignationName = obj.CANDIDATEDESIGNATIONNAME;
                    objIP.SecondarySkills          = obj.SECONDARYSKILLS;
                    objIP.SecondarySkillname       = obj.SECONDARYSKILLNAME;
                    objIP.LevelIds                 = obj.LEVELIDS;
                    objIP.levelidName              = obj.LEVELIDNAME;
                    objIP.Inducted                 = Convert.ToInt32(obj.INDUCTED);
                    objIP.InductedName             = obj.INDUCTEDNAME;
                    objIP.TrainingAttended         = Convert.ToInt32(obj.TRAININGATTENDED);
                    objIP.TrainingAttendedName     = obj.TRAININGATTENDEDNAME;
                    objIP.PageMode                 = "S";
                    objIPList.Add(objIP);
                }
            }
            return(objIPList);
        }
Exemplo n.º 6
0
        public string IsAlreadyExist(InterviewPanelModel Obj)
        {
            string strResult = "";

            //using (TransactionScope ts = new TransactionScope())
            //{
            try
            {
                string[] strLevel = Obj.LevelIds.Split(',');
                for (int i = 0; i < strLevel.Length; i++)
                {
                    //Save Designation againt Level
                    string[] strDesg = Obj.CandidateDesignations.Split(',');
                    for (int j = 0; j < strDesg.Length; j++)
                    {
                        bool IslevelwiseDesignExist = _IInterviewPanelRepository.IsAlreadyExist(Convert.ToInt32(Obj.EmpId),
                                                                                                Convert.ToInt32(strLevel[i]), Convert.ToInt32(strDesg[j]));
                        //If exist, skip furture save
                        if (IslevelwiseDesignExist)
                        {
                            T_Master objLevel = new T_Master();
                            objLevel = _objIMasterRepository.SingleOrDefault(Convert.ToInt32(strLevel[i]));

                            //SelectList SL = _objEmployeeService.GetSkillTypesCategory();
                            IEnumerable <SelectListItem> SL = _objEmployeeService.FillDesignationList(Convert.ToInt32(Obj.CandidateDeptId));
                            string DesignationName          = SL.Where(p => p.Value == strDesg[j]).First().Text;

                            strResult = DesignationName + " Designation has already been entered for " + objLevel.Name + " Level";
                            //ts.Dispose();
                            return(strResult);
                        }
                    }
                }
                //ts.Complete();
            }
            catch (Exception ex)
            {
                //ts.Dispose();
                throw ex;
            }
            //}

            return(strResult);
        }
        public ActionResult DeleteInterviewPanel(string InterviewPanelId)
        {
            InterviewPanelViewModel objVm = new InterviewPanelViewModel();
            int _InterviewPanelid         = Convert.ToInt32(CheckAccessAttribute.Decode(InterviewPanelId));
            InterviewPanelModel objI      = new InterviewPanelModel();

            objI.PanelId = _InterviewPanelid;
            //Get single list
            int i = _objIInterviewPanelService.Delete(objI);

            if (i > 0)
            {
                objVm.Message       = "Interview Panel deleted successfully";
                TempData["Message"] = "Interview Panel deleted successfully";
                return(RedirectToAction("AddInterviewPanel"));
            }

            return(View());
        }
        int AddIP(InterviewPanelViewModel obj, FormCollection objf)
        {
            InterviewPanelModel objI = new InterviewPanelModel();

            if (obj.Mode == "A")
            {
                objI.EmpId = obj.EmpId;
                //objI.EmpId = Convert.ToInt32(objf["hfldEmpid"]);
                objI.CandidateDeptId       = obj.CandidateDeptId;
                objI.CandidateDesignations = objf["lstDesignation"];
                objI.SecondarySkills       = objf["lstSkill"];
                objI.LevelIds         = objf["chkLevel"];
                objI.TrainingAttended = obj.TrainingAttendedId;
                objI.Inducted         = obj.InductedId;
                objI.CreatedBy        = Convert.ToInt32(Session["EmpID"]);
                string strErrorMessage = _objIInterviewPanelService.IsAlreadyExist(objI);

                if (strErrorMessage == "")
                {
                    objI.PanelId = _objIInterviewPanelService.Insert(objI);
                    if (objI.PanelId != 0)
                    {
                        TempData["Message"] = "Interview Panel added successfully";
                        obj           = init(obj);
                        obj.ListAllIP = _objIInterviewPanelService.GetInterviewPanel(0, 0);
                        return(1);// RedirectToAction("AddInterviewPanel");
                    }
                    else
                    {
                        return(0);
                    }
                }
                else
                {
                    TempData["Message"] = strErrorMessage;
                    return(2);// RedirectToAction("AddInterviewPanel");
                }
            }
            return(1);
        }
Exemplo n.º 9
0
        //public List<InterviewPanelModel> GetInterviewPanel(InterviewPanelModel objIP)
        public List <InterviewPanelModel> GetInterviewPanel(int PanelId, int Empid)
        {
            List <InterviewPanelModel> objIPList = new List <InterviewPanelModel>();
            InterviewPanelModel        objIP;

            using (var result = new RMS_Entities())
            {
                var GetIPList = result.USP_IP_GetInterviewPanel(Convert.ToInt32(PanelId), Convert.ToInt32(Empid)).ToList <USP_IP_GetInterviewPanel_Result>();
                foreach (var obj in GetIPList)
                {
                    objIP                  = new InterviewPanelModel();
                    objIP.PanelId          = obj.panelid;
                    objIP.PanelIdEncr      = CommonRepository.Encode(obj.panelid.ToString());
                    objIP.EmpId            = Convert.ToInt32(obj.empid);
                    objIP.EmpIdEncr        = CommonRepository.Encode(obj.empid.ToString());
                    objIP.EmpName          = obj.EmpName;
                    objIP.DesignationName  = obj.DesignationName;
                    objIP.LINEMANAGER      = obj.LINEMANAGER;
                    objIP.PrimarySkillName = obj.PrimarySkillName;
                    objIP.CandidateDeptId  = Convert.ToInt32(obj.CandidateDeptId);
                    //objIP.DEPTName = obj.DEPTName;
                    objIP.CandidateDesignations    = obj.CandidateDesignations;
                    objIP.CandidateDesignationName = obj.CandidateDesignationName;
                    objIP.SecondarySkills          = obj.SecondarySkills;
                    objIP.SecondarySkillname       = obj.SecondarySkillname;
                    objIP.LevelIds             = obj.levelids;
                    objIP.levelidName          = obj.levelidName;
                    objIP.Inducted             = Convert.ToInt32(obj.Inducted);
                    objIP.InductedName         = obj.InductedName;
                    objIP.TrainingAttended     = Convert.ToInt32(obj.TrainingAttended);
                    objIP.TrainingAttendedName = obj.TrainingAttendedName;
                    objIP.EmpSecondarySkill    = obj.SecondarySkill;
                    objIP.BusinessVertical     = obj.BusinessVertical;
                    objIP.PageMode             = "V";
                    objIPList.Add(objIP);
                }
            }
            return(objIPList);
        }
Exemplo n.º 10
0
        public int Insert(InterviewPanelModel Obj)
        {
            int PanelId = 0;

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    T_InterviewPanel ObjT_IP = new T_InterviewPanel();

                    ObjT_IP.EmpId = Obj.EmpId;
                    ObjT_IP.CandidateDesignations = Obj.CandidateDesignations;
                    ObjT_IP.CandidateDeptId       = Obj.CandidateDeptId;
                    ObjT_IP.SecondarySkills       = Obj.SecondarySkills;
                    ObjT_IP.LevelIds         = Obj.LevelIds;
                    ObjT_IP.TrainingAttended = Convert.ToInt32(Obj.TrainingAttended);
                    ObjT_IP.Inducted         = Convert.ToInt32(Obj.Inducted);
                    ObjT_IP.CreatedBy        = Obj.CreatedBy;
                    ObjT_IP.IsActive         = 1;
                    ObjT_IP.CreatedDate      = DateTime.Now;

                    ObjT_IP = _IInterviewPanelRepository.Insert(ObjT_IP);
                    PanelId = ObjT_IP.PanelId;

                    //Save Level in Child table
                    string[] strLevel = Obj.LevelIds.Split(',');
                    for (int i = 0; i < strLevel.Length; i++)
                    {
                        T_IP_PanelLevel objIPL = new T_IP_PanelLevel();

                        objIPL.PanelId     = ObjT_IP.PanelId;
                        objIPL.Empid       = ObjT_IP.EmpId;
                        objIPL.LevelId     = Convert.ToInt32(strLevel[i]);
                        objIPL.CreatedBy   = Obj.CreatedBy;
                        objIPL.CreatedDate = DateTime.Now;
                        objIPL.IsActive    = 1;
                        objIPL             = _objIIPanelLevelRepository.Insert(objIPL);

                        //Save Designation againt Level
                        string[] strDesign = Obj.CandidateDesignations.Split(',');
                        for (int j = 0; j < strDesign.Length; j++)
                        {
                            T_IP_PanelDesignation objDes = new T_IP_PanelDesignation();
                            objDes.PanelId       = ObjT_IP.PanelId;
                            objDes.Empid         = ObjT_IP.EmpId;
                            objDes.LevelId       = Convert.ToInt32(strLevel[i]);
                            objDes.DesignationId = Convert.ToInt32(strDesign[j]);
                            objDes.CreatedBy     = Obj.CreatedBy;
                            objDes.CreatedDate   = DateTime.Now;
                            objDes.IsActive      = 1;

                            bool IslevelwiseDesignExist = _IInterviewPanelRepository.IsAlreadyExist(Convert.ToInt32(objDes.Empid), Convert.ToInt32(objDes.LevelId), Convert.ToInt32(objDes.DesignationId));
                            //If exist, skip furture save
                            if (IslevelwiseDesignExist)
                            {
                                ts.Dispose();
                                return(0);
                            }
                            objDes = _objIIPaneldesignationRepository.Insert(objDes);
                        }
                    }
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    ts.Dispose();
                    throw ex;
                }
            }

            return(PanelId);
        }
Exemplo n.º 11
0
 public int UpdateInterviewPanel(InterviewPanelModel objUpdate)
 {
     return(_IInterviewPanelRepository.UpdateInterviewPanel(objUpdate));
 }