public int CreateQualificationDetails(QualificationDetailsEntities QualificationDetailsEntities)
        {
            //DateTime? enroldate = null;
            //DateTime? closeddate = null;
            var enroldate  = (DateTime?)null;
            var closeddate = (DateTime?)null;

            if (QualificationDetailsEntities.ENROLLEDDATE != null && QualificationDetailsEntities.ENROLLEDDATE != "")
            {
                enroldate = DateTime.ParseExact(QualificationDetailsEntities.ENROLLEDDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (QualificationDetailsEntities.COMPLETEDDATE != null && QualificationDetailsEntities.COMPLETEDDATE != "")
            {
                closeddate = DateTime.ParseExact(QualificationDetailsEntities.COMPLETEDDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (QualificationDetailsEntities != null)
            {
                //var QualificationDetails = _UOW.EMP_QUALIFICATION_DETAILSRepository.GetAll().Where(x => x.EMPLOYEE_ID == QualificationDetailsEntities.EMPLOYEE_ID && x.EXAM_DEGREE_TYPE == QualificationDetailsEntities.EXAM_DEGREE_TYPE).ToList().FirstOrDefault();

                //if (QualificationDetails != null)
                //{
                //    if (QualificationDetailsEntities.EMPLOYEE_ID != null)
                //    {
                //        QualificationDetails.EMPLOYEE_ID = QualificationDetailsEntities.EMPLOYEE_ID;
                //    }
                //    if (QualificationDetailsEntities.SCHOOL_COLLEGE_NAME != "" && QualificationDetailsEntities.SCHOOL_COLLEGE_NAME != null)
                //    {
                //        QualificationDetails.SCHOOL_COLLEGE_NAME = QualificationDetailsEntities.SCHOOL_COLLEGE_NAME;
                //    }

                //    if (QualificationDetailsEntities.BOARD_UNIVERSITY_NAME != null)
                //    {
                //        QualificationDetails.BOARD_UNIVERSITY_NAME = QualificationDetailsEntities.BOARD_UNIVERSITY_NAME;
                //    }
                //    if (QualificationDetailsEntities.TYPE != null && QualificationDetailsEntities.TYPE != "")
                //    {
                //        QualificationDetails.TYPE = QualificationDetailsEntities.TYPE;
                //    }

                //    if (QualificationDetailsEntities.ENROLLEDDATE != null && QualificationDetailsEntities.ENROLLEDDATE != "")
                //    {
                //        QualificationDetails.START_DATE = enroldate;
                //    }
                //    if (QualificationDetailsEntities.COMPLETEDDATE != null && QualificationDetailsEntities.COMPLETEDDATE != "")
                //    {
                //        QualificationDetails.END_DATE = closeddate;
                //    }
                //    if (QualificationDetailsEntities.EXAM_DEGREE_TYPE != null)
                //    {
                //        QualificationDetails.EXAM_DEGREE_TYPE = QualificationDetailsEntities.EXAM_DEGREE_TYPE;
                //    }
                //    if (QualificationDetailsEntities.SUBJECT != "" && QualificationDetailsEntities.SUBJECT != null)
                //    {
                //        QualificationDetails.SUBJECT = QualificationDetailsEntities.SUBJECT;
                //    }

                //    if (QualificationDetailsEntities.TOTAL_MARKS != null)
                //    {
                //        QualificationDetails.TOTAL_MARKS = QualificationDetailsEntities.TOTAL_MARKS;
                //    }
                //    if (QualificationDetailsEntities.MARKS_SECURED != null)
                //    {
                //        QualificationDetails.MARKS_SECURED = QualificationDetailsEntities.MARKS_SECURED;
                //    }
                //    if (QualificationDetailsEntities.PERCENTAGE_OF_MARK_DIVISION != null)
                //    {
                //        QualificationDetails.PERCENTAGE_OF_MARK_DIVISION = QualificationDetailsEntities.PERCENTAGE_OF_MARK_DIVISION;
                //    }

                //    _UOW.EMP_QUALIFICATION_DETAILSRepository.Update(QualificationDetails);
                //    _UOW.Save();

                //}
                //else
                //{
                var QualificationDetail = new TBL_EMP_QUALIFICATION_DETAILS
                {
                    EMPLOYEE_ID           = QualificationDetailsEntities.EMPLOYEE_ID,
                    SCHOOL_COLLEGE_NAME   = QualificationDetailsEntities.SCHOOL_COLLEGE_NAME,
                    BOARD_UNIVERSITY_NAME = QualificationDetailsEntities.BOARD_UNIVERSITY_NAME,
                    TYPE                        = QualificationDetailsEntities.TYPE,
                    START_DATE                  = enroldate,
                    END_DATE                    = closeddate,
                    EXAM_DEGREE_TYPE            = QualificationDetailsEntities.EXAM_DEGREE_TYPE,
                    SUBJECT                     = QualificationDetailsEntities.SUBJECT,
                    TOTAL_MARKS                 = QualificationDetailsEntities.TOTAL_MARKS,
                    MARKS_SECURED               = QualificationDetailsEntities.MARKS_SECURED,
                    PERCENTAGE_OF_MARK_DIVISION = QualificationDetailsEntities.PERCENTAGE_OF_MARK_DIVISION
                };
                _UOW.EMP_QUALIFICATION_DETAILSRepository.Insert(QualificationDetail);
                _UOW.Save();
                //}
            }
            return(Convert.ToInt32(QualificationDetailsEntities.ID));
        }
Beispiel #2
0
        public int CreateExcelupload(ExcelUploadEntities ExcelUploadEntity)
        {
            //if (ExcelUploadEntity.SUBDIVISION!=null)
            //{
            //    ExcelUploadEntity.SUBDIVISION = Getsubdivisionid(ExcelUploadEntity.SUB_DIVISIONNAME);
            //}
            //if (ExcelUploadEntity.SECTION != null)
            //{
            //    ExcelUploadEntity.SECTION = Getsectionid(ExcelUploadEntity.SECTIONNAME);
            //}
            if (ExcelUploadEntity.gradename != null)
            {
                ExcelUploadEntity.GRADE = Getdgradeid(ExcelUploadEntity.gradename);
            }
            if (ExcelUploadEntity.departmentname != null)
            {
                ExcelUploadEntity.DEPARTMENT = Getdepartmentid(ExcelUploadEntity.departmentname);
            }
            if (ExcelUploadEntity.designationname != null)
            {
                ExcelUploadEntity.DESIGNATION = Getdesigid(ExcelUploadEntity.designationname);
            }
            //if (ExcelUploadEntity.bloodgroup != null)
            //{
            //    ExcelUploadEntity.BLOOD_GROUP = Getbloodgid(ExcelUploadEntity.bloodgroup);
            //}


            var bsicinfo = new TBL_EMP_BASICINFO
            {
                DESIGNATION         = ExcelUploadEntity.DESIGNATION,
                JOINING_DATE        = ExcelUploadEntity.JOINING_DATE,
                EMPLOYEE_CODE       = ExcelUploadEntity.EMPLOYEE_CODE,
                EMPLOYEE_FIRSTNAME  = ExcelUploadEntity.EMPLOYEE_FIRSTNAME,
                EMPLOYEE_MIDDLENAME = ExcelUploadEntity.EMPLOYEE_MIDDLENAME,
                EMPLOYEE_LASTNAME   = ExcelUploadEntity.EMPLOYEE_LASTNAME,
                DATE_OF_BIRTH       = ExcelUploadEntity.DATE_OF_BIRTH,
                AGE                        = ExcelUploadEntity.AGE,
                SEX                        = ExcelUploadEntity.SEX,
                MATERIAL_STATUS            = ExcelUploadEntity.MATERIAL_STATUS,
                WEDDING_ANNIVERSARY        = ExcelUploadEntity.WEDDING_ANNIVERSARY,
                REPORTING_TO               = ExcelUploadEntity.REPORTING_TO,
                GRADE                      = ExcelUploadEntity.GRADE,
                DIVISION                   = ExcelUploadEntity.DIVISION,
                SUBDIVISION                = ExcelUploadEntity.SUBDIVISION,
                SECTION                    = ExcelUploadEntity.SECTION,
                BLOOD_GROUP                = ExcelUploadEntity.BLOOD_GROUP,
                HEIGHT                     = ExcelUploadEntity.HEIGHT,
                WEIGHT                     = ExcelUploadEntity.WEIGHT,
                MEDICLAIM_NUMBER           = ExcelUploadEntity.MEDICLAIM_NUMBER,
                ESIC_NO                    = ExcelUploadEntity.ESIC_NO,
                PF_UNID_NUMBER             = ExcelUploadEntity.PF_UNID_NUMBER,
                INDUCTION                  = ExcelUploadEntity.INDUCTION,
                IDENTIFICATION_MARK        = ExcelUploadEntity.IDENTIFICATION_MARK,
                LAST_MAJOR_ILLNESS_SURGERY = ExcelUploadEntity.LAST_MAJOR_ILLNESS_SURGERY,
                ALLERGY_HISTORY            = ExcelUploadEntity.ALLERGY_HISTORY,
                PHYSICAL_DISABILITY        = ExcelUploadEntity.PHYSICAL_DISABILITY,
                HIRING_TYPE                = ExcelUploadEntity.HIRING_TYPE,
                CV_TYPE                    = ExcelUploadEntity.CV_TYPE,
                YEAR_OF_EXPERIENCE         = ExcelUploadEntity.YEAR_OF_EXPERIENCE,
                EXIT_DATE                  = ExcelUploadEntity.EXIT_DATE,
                EXIT_TYPE                  = ExcelUploadEntity.EXIT_TYPE,
                REFERENCE                  = ExcelUploadEntity.REFERENCE,
                DEPARTMENT                 = ExcelUploadEntity.DEPARTMENT,
                FULL_N_FINAL_STATUS        = ExcelUploadEntity.FULL_N_FINAL_STATUS,
                MOTHERTOUNGE               = ExcelUploadEntity.MOTHERTOUNGE,
                WORKLOCATION               = ExcelUploadEntity.WORKLOCATION,
                RELIGION                   = ExcelUploadEntity.RELIGION,
                STATUS                     = ExcelUploadEntity.STATUS,
                EMPIMG                     = ExcelUploadEntity.EMPIMG
            };

            _UOW.EMP_BASICINFORepository.Insert(bsicinfo);
            _UOW.Save();
            TBL_EMP_TRANSFER_DETAILS tr = new TBL_EMP_TRANSFER_DETAILS();

            tr.EMPLOYEE_ID      = Convert.ToDecimal(bsicinfo.ID);
            tr.DESIGNATION_ID   = ExcelUploadEntity.DESIGNATION;
            tr.WORK_LOCATION    = ExcelUploadEntity.WORKLOCATION;
            tr.DIVISION         = ExcelUploadEntity.DIVISION;
            tr.SUB_DIVISION     = ExcelUploadEntity.SUBDIVISION;
            tr.SECTION          = ExcelUploadEntity.SECTION;
            tr.DEPARTMENT       = ExcelUploadEntity.DEPARTMENT;
            tr.REPORTINGPERNAME = ExcelUploadEntity.REPORTING_TO;
            //tr.REPORTING_PERSON = Convert.ToDecimal(ExcelUploadEntity.REPORTING_TO);
            tr.FROM_DATE = ExcelUploadEntity.JOINING_DATE;
            tr.TO_DATE   = ExcelUploadEntity.EXIT_DATE;
            tr.STATUS    = ExcelUploadEntity.STATUS;
            _UOW.TRANSFER_DETAILSMASTERRepository.Insert(tr);
            _UOW.Save();
            if (ExcelUploadEntity.Account != null)
            {
                foreach (var item in ExcelUploadEntity.Account)
                {
                    TBL_EMP_SALARYACCOUNTDETAILS sal = new TBL_EMP_SALARYACCOUNTDETAILS();
                    sal.EMPLOYEE_ID = Convert.ToDecimal(bsicinfo.ID);
                    sal.ACCOUNTNO   = item.ACCOUNTNO;
                    sal.IFSCCODE    = item.IFSCCODE;
                    sal.BRANCH      = item.BRANCH;
                    sal.BANKNAME    = item.BANKNAME;
                    sal.CTC         = item.CTC;
                    _UOW.SALARYACCOUNTDETAILSRepository.Insert(sal);
                    _UOW.Save();
                }
            }
            if (ExcelUploadEntity.Relationship != null)
            {
                foreach (var item in ExcelUploadEntity.Relationship)
                {
                    TBL_EMP_RELATIONSHIP_DETAILS rel = new TBL_EMP_RELATIONSHIP_DETAILS();
                    rel.EMPLOYEE_ID   = Convert.ToDecimal(bsicinfo.ID);
                    rel.RELATIVE_NAME = item.RELATIVE_NAME;
                    rel.RELATIONSHIP  = item.RELATIONSHIP;
                    rel.DATE_OF_BIRTH = item.DATE_OF_BIRTH;
                    _UOW.RELATIONSHIP_DETAILSRepository.Insert(rel);
                    _UOW.Save();
                }
            }
            if (ExcelUploadEntity.Communication != null)
            {
                foreach (var item in ExcelUploadEntity.Communication)
                {
                    TBL_EMP_COMMUNICATION_DETAILS rel = new TBL_EMP_COMMUNICATION_DETAILS();
                    rel.EMPLOYEE_ID              = Convert.ToDecimal(bsicinfo.ID);
                    rel.PERMANENT_ADDRESS        = item.PERMANENT_ADDRESS;
                    rel.MOBILE_NUMBER            = item.MOBILE_NUMBER;
                    rel.PANCARD_NUMBER           = item.PANCARD_NUMBER;
                    rel.EMERGENCY_CONTACT_NUMBER = item.EMERGENCY_CONTACT_NUMBER;
                    rel.OFFICIAL_MOBILE_NUMBER   = item.OFFICIAL_MOBILE_NUMBER;
                    rel.OFFICIAL_EMAIL           = item.OFFICIAL_EMAIL;
                    rel.PERSONAL_EMAIL           = item.PERSONAL_EMAIL;
                    rel.AADHAR_NUMBER            = item.AADHAR_NUMBER;
                    //rel.DATE_OF_BIRTH = item.DATE_OF_BIRTH;
                    _UOW.EMP_COMMUNICATION_DETAILSRepository.Insert(rel);
                    _UOW.Save();
                }
            }
            if (ExcelUploadEntity.qualification != null)
            {
                foreach (var item in ExcelUploadEntity.qualification)
                {
                    TBL_EMP_QUALIFICATION_DETAILS qual = new TBL_EMP_QUALIFICATION_DETAILS();
                    qual.EMPLOYEE_ID      = Convert.ToDecimal(bsicinfo.ID);
                    qual.EXAM_DEGREE_TYPE = item.EXAM_DEGREE_TYPE;
                    qual.END_DATE         = item.END_DATE;

                    _UOW.EMP_QUALIFICATION_DETAILSRepository.Insert(qual);
                    _UOW.Save();
                }
            }
            if (ExcelUploadEntity.Employment != null)
            {
                foreach (var item in ExcelUploadEntity.Employment)
                {
                    TBL_EMP_EMPLOYMENT_RECORD qual = new TBL_EMP_EMPLOYMENT_RECORD();
                    qual.EMPLOYEE_ID       = Convert.ToDecimal(bsicinfo.ID);
                    qual.ORGANISATION_NAME = item.ORGANISATION_NAME;
                    _UOW.EMPLOYMENT_RECORDRepository.Insert(qual);
                    _UOW.Save();
                }
            }
            return(Convert.ToInt32(bsicinfo.ID));
        }