Esempio n. 1
0
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 24-Oct-2019
        /// Created For : To get details of form.
        /// </summary>
        /// <param name="Obj"></param>
        /// <returns></returns>
        public CommonFormModel GetFormDetails(CommonFormModel Obj)
        {
            var lstDetails = new CommonFormModel();

            try
            {
                if (Obj.UserId > 0)
                {
                    var getUserDetails = _workorderems.UserRegistrations.Where(x => x.UserId == Obj.UserId && x.IsEmailVerify == true && x.IsDeleted == false).FirstOrDefault();
                    if (getUserDetails != null)
                    {
                        if (Obj.FormName == "EducationForm")
                        {
                            var getEducationFormDetails = _FillableFormRepository.GetEducationFormDetails(getUserDetails.EmployeeID);
                            if (getEducationFormDetails != null)
                            {
                                lstDetails.EducationFormModel.EVF_Id                      = getEducationFormDetails.EVF_Id;
                                lstDetails.EducationFormModel.EVF_EmployeeName            = getEducationFormDetails.EmployeeName;
                                lstDetails.EducationFormModel.EVF_Employee_Id             = getEducationFormDetails.EVF_EMP_EmployeeID;
                                lstDetails.EducationFormModel.EVF_City                    = getEducationFormDetails.EVF_City;
                                lstDetails.EducationFormModel.EVF_Address                 = getEducationFormDetails.EVF_Address;
                                lstDetails.EducationFormModel.EVF_AttendedFrom            = getEducationFormDetails.EVF_AttendedFrom;
                                lstDetails.EducationFormModel.EVF_AttendedTo              = getEducationFormDetails.EVF_AttendedTo;
                                lstDetails.EducationFormModel.EVF_OrganizationName        = getEducationFormDetails.EVF_OrgnizationName;
                                lstDetails.EducationFormModel.EVF_SchoolDegreeDiplomaCert = getEducationFormDetails.EVF_SchoolDegreeDiplomaCirtificate;
                                lstDetails.EducationFormModel.EVF_State                   = getEducationFormDetails.EVF_State;
                            }
                        }
                        else if (Obj.FormName == "DirectDepositForm")
                        {
                            var getDirectDepositForm = _FillableFormRepository.GetDirectDepositeDetails(getUserDetails.EmployeeID);
                            if (getDirectDepositForm != null)
                            {
                                lstDetails.DirectDepositFormModel.DDF_AccountNumber_1            = getDirectDepositForm.DDF_AccountNumber_1;
                                lstDetails.DirectDepositFormModel.DDF_AccountNumber_2            = getDirectDepositForm.DDF_AccountNumber_2;
                                lstDetails.DirectDepositFormModel.DDF_AccountType_1              = getDirectDepositForm.DDF_AccountType_1;
                                lstDetails.DirectDepositFormModel.DDF_AccountType_2              = getDirectDepositForm.DDF_AccountType_2;
                                lstDetails.DirectDepositFormModel.DDF_BankName_1                 = getDirectDepositForm.DDF_BankName_1;
                                lstDetails.DirectDepositFormModel.DDF_BankName_2                 = getDirectDepositForm.DDF_BankName_2;
                                lstDetails.DirectDepositFormModel.DDF_BankRountingNumber_1       = getDirectDepositForm.DDF_BankRoutingNumber_1;
                                lstDetails.DirectDepositFormModel.DDF_BankRountingNumber_2       = getDirectDepositForm.DDF_BankRoutingNumber_2;
                                lstDetails.DirectDepositFormModel.DDF_EMP_EmployeeId             = getDirectDepositForm.DDF_EMP_EmployeeID;
                                lstDetails.DirectDepositFormModel.DDF_PercentageOrDollarAmount_1 = getDirectDepositForm.DDF_PrcentageOrDollarAmount_1;
                                lstDetails.DirectDepositFormModel.DDF_VoidCheck = getDirectDepositForm.DDF_VoidCkeck;
                                lstDetails.DirectDepositFormModel.EmployeeName  = getDirectDepositForm.EmployeeName;
                            }
                        }
                        else if (Obj.FormName == "EmergencyContactInfo")
                        {
                            var getEMCForm = _FillableFormRepository.GetEmergencyContactForm(getUserDetails.EmployeeID);
                            if (getEMCForm != null)
                            {
                                lstDetails.EmergencyContactFormModel.ECF_EMP_EmployeeId = getEMCForm.ECF_EMP_EmployeeID;
                                lstDetails.EmergencyContactFormModel.ECF_HomeEmail      = getEMCForm.ECF_HomeEmail;
                                lstDetails.EmergencyContactFormModel.ECF_HomePhone      = getEMCForm.ECF_HomePhone;
                                lstDetails.EmergencyContactFormModel.ECF_Id             = getEMCForm.ECF_Id;
                                lstDetails.EmergencyContactFormModel.ECF_NickName       = getEMCForm.ECF_NickName;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public CommonFormModel GetFormDetails(CommonFormModel Obj)", "Exception While getting details of fillable form.", Obj);
                throw;
            }
            return(lstDetails);
        }
        /// <summary>
        /// Created By : Ashwajit Bansod
        /// Created Date : 24-Oct-2019
        /// Created For : To get details of form.
        /// </summary>
        /// <param name="Obj"></param>
        /// <returns></returns>
        public CommonFormModel GetFormDetails(CommonFormModel Obj)
        {
            var lstDetails     = new CommonFormModel();
            var edu_form       = new EducationFormModel();
            var direct_depo    = new DirectDepositFormModel();
            var w4_Form        = new W4FormModel();
            var emergency_form = new EmergencyContactFormModel();

            try
            {
                if (Obj.UserId > 0)
                {
                    var getUserDetails = _workorderems.UserRegistrations.Where(x => x.UserId == Obj.UserId && x.IsEmailVerify == true && x.IsDeleted == false).FirstOrDefault();
                    if (getUserDetails != null)
                    {
                        if (Obj.FormName == "EducationForm")
                        {
                            var getEducationFormDetails = _FillableFormRepository.GetEducationFormDetails(getUserDetails.EmployeeID);
                            if (getEducationFormDetails != null)
                            {
                                edu_form.EVF_Id                      = getEducationFormDetails.EVF_Id;
                                edu_form.EVF_EmployeeName            = getEducationFormDetails.EmployeeName;
                                edu_form.EVF_Employee_Id             = getEducationFormDetails.EVF_EMP_EmployeeID;
                                edu_form.EVF_City                    = getEducationFormDetails.EVF_City;
                                edu_form.EVF_Address                 = getEducationFormDetails.EVF_Address;
                                edu_form.EVF_AttendedFrom            = getEducationFormDetails.EVF_AttendedFrom.Value.ToString("yyyy-MM-dd");
                                edu_form.EVF_AttendedTo              = getEducationFormDetails.EVF_AttendedTo.Value.ToString("yyyy-MM-dd");
                                edu_form.EVF_OrganizationName        = getEducationFormDetails.EVF_OrgnizationName;
                                edu_form.EVF_SchoolDegreeDiplomaCert = getEducationFormDetails.EVF_SchoolDegreeDiplomaCirtificate;
                                edu_form.EVF_State                   = getEducationFormDetails.EVF_State;
                                lstDetails.EducationFormModel        = edu_form;
                            }
                        }
                        else if (Obj.FormName == "DirectDepositForm")
                        {
                            var getDirectDepositForm = _FillableFormRepository.GetDirectDepositeDetails(getUserDetails.EmployeeID);
                            if (getDirectDepositForm != null)
                            {
                                direct_depo.DDF_AccountNumber_1            = getDirectDepositForm.DDF_AccountNumber_1;
                                direct_depo.DDF_AccountNumber_2            = getDirectDepositForm.DDF_AccountNumber_2;
                                direct_depo.DDF_AccountType_1              = getDirectDepositForm.DDF_AccountType_1;
                                direct_depo.DDF_AccountType_2              = getDirectDepositForm.DDF_AccountType_2;
                                direct_depo.DDF_BankName_1                 = getDirectDepositForm.DDF_BankName_1;
                                direct_depo.DDF_BankName_2                 = getDirectDepositForm.DDF_BankName_2;
                                direct_depo.DDF_BankRountingNumber_1       = getDirectDepositForm.DDF_BankRoutingNumber_1;
                                direct_depo.DDF_BankRountingNumber_2       = getDirectDepositForm.DDF_BankRoutingNumber_2;
                                direct_depo.DDF_EMP_EmployeeId             = getDirectDepositForm.DDF_EMP_EmployeeID;
                                direct_depo.DDF_PercentageOrDollarAmount_1 = getDirectDepositForm.DDF_PrcentageOrDollarAmount_1;
                                direct_depo.DDF_VoidCheck         = getDirectDepositForm.DDF_VoidCkeck;
                                direct_depo.EmployeeName          = getDirectDepositForm.EmployeeName;
                                lstDetails.DirectDepositFormModel = direct_depo;
                            }
                        }
                        else if (Obj.FormName == "EmergencyContactInfo")
                        {
                            var getEMCForm = _FillableFormRepository.GetEmergencyContactForm(getUserDetails.EmployeeID);
                            if (getEMCForm != null)
                            {
                                emergency_form.ECF_EMP_EmployeeId       = getEMCForm.ECF_EMP_EmployeeID;
                                emergency_form.ECF_HomeEmail            = getEMCForm.ECF_HomeEmail;
                                emergency_form.ECF_HomePhone            = getEMCForm.ECF_HomePhone;
                                emergency_form.ECF_Id                   = getEMCForm.ECF_Id;
                                emergency_form.ECF_NickName             = getEMCForm.ECF_NickName;
                                emergency_form.ECF_FirstName            = getEMCForm.ECF_FirstName;
                                emergency_form.ECF_MiddleName           = getEMCForm.ECF_MiddleName;
                                emergency_form.ECF_LastName             = getEMCForm.ECF_LastName;
                                emergency_form.ECF_Address              = getEMCForm.ECF_Address;
                                emergency_form.ECF_Gender               = getEMCForm.ECF_Gender;
                                emergency_form.ECF_Citizenship          = getEMCForm.ECF_Citizenship;
                                emergency_form.ECF_BirthDate            = getEMCForm.ECF_BirthDate;
                                emergency_form.ECF_DriverLicense        = getEMCForm.ECF_DriverLicense;
                                emergency_form.ECF_EmergencyContactName = getEMCForm.ECF_EmergencyContactName;
                                emergency_form.ECF_Mobile               = getEMCForm.ECF_Mobile;
                                emergency_form.ECF_PhoneNumber          = getEMCForm.ECF_PhoneNumber;
                                emergency_form.ECF_SSN                  = getEMCForm.ECF_SSN;
                                emergency_form.ECF_Relationship         = getEMCForm.ECF_Relationship;
                                emergency_form.ECF_HomeAddress          = getEMCForm.ECF_HomeAddress;
                                lstDetails.EmergencyContactFormModel    = emergency_form;
                            }
                        }
                        else if (Obj.FormName == "W-4")
                        {
                            var getW4Form = _FillableFormRepository.GetW4FormData(getUserDetails.EmployeeID);
                            if (getW4Form != null)
                            {
                                w4_Form.EmployeerNameAndAddress = getW4Form.EMA_Address;
                                w4_Form.City                  = getW4Form.EMA_City;
                                w4_Form.State                 = getW4Form.EMA_State;
                                w4_Form.Zip                   = getW4Form.EMA_Zip;
                                w4_Form.FirstName             = getW4Form.EMP_FirstName;
                                w4_Form.LastName              = getW4Form.EMP_LastName;
                                w4_Form.MiddleName            = getW4Form.EMP_MiddleName;
                                w4_Form.w4F_10                = getW4Form.w4F_10;
                                w4_Form.EmployeeMaritalStatus = getW4Form.w4F_3MaritalStatus;
                                w4_Form.w4F_4                 = getW4Form.w4F_4;
                                w4_Form.w4F_5                 = getW4Form.w4F_5;
                                w4_Form.w4F_6                 = getW4Form.w4F_6;
                                w4_Form.w4F_7                 = getW4Form.w4F_7;
                                w4_Form.w4F_8EmployersName    = getW4Form.w4F_8EmployersName;
                                w4_Form.w4F_9                 = getW4Form.w4F_9;
                                w4_Form.EmpId                 = getW4Form.W4F_EMP_EmployeeId;
                                w4_Form.W4FId                 = getW4Form.W4F_Id;
                                w4_Form.SSN                   = getW4Form.W4F_SSN;
                                lstDetails.W4FormModel        = w4_Form;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public CommonFormModel GetFormDetails(CommonFormModel Obj)", "Exception While getting details of fillable form.", Obj);
                throw;
            }
            return(lstDetails);
        }