public void UpdateEmployeeJobDetails(EmployeeJobDetails argEmployeeJobDetails, DataAccess da, List <ErrorHandlerClass> lstErr)
        {
            da.Open_Connection();

            SqlParameter[] param = new SqlParameter[29];
            param[0]  = new SqlParameter("@EmployeeId", argEmployeeJobDetails.EmployeeId);
            param[1]  = new SqlParameter("@ApplicationDate", argEmployeeJobDetails.ApplicationDate);
            param[2]  = new SqlParameter("@InterviewDate", argEmployeeJobDetails.InterviewDate);
            param[3]  = new SqlParameter("@JoiningDate", argEmployeeJobDetails.JoiningDate);
            param[4]  = new SqlParameter("@ConfirmationDate", argEmployeeJobDetails.ConfirmationDate);
            param[5]  = new SqlParameter("@SalartyStopAfter", argEmployeeJobDetails.SalartyStopAfter);
            param[6]  = new SqlParameter("@ContractStartDate", argEmployeeJobDetails.ContractStartDate);
            param[7]  = new SqlParameter("@ContractEndDate", argEmployeeJobDetails.ContractEndDate);
            param[8]  = new SqlParameter("@DateOfTransfer", argEmployeeJobDetails.DateOfTransfer);
            param[9]  = new SqlParameter("@PFStartDate", argEmployeeJobDetails.PFStartDate);
            param[10] = new SqlParameter("@EPSStartDate ", argEmployeeJobDetails.EPSStartDate);
            param[11] = new SqlParameter("@ESISStartDate", argEmployeeJobDetails.ESISStartDate);
            param[12] = new SqlParameter("@Category", argEmployeeJobDetails.Category);
            param[13] = new SqlParameter("@Grade", argEmployeeJobDetails.Grade);
            param[14] = new SqlParameter("@Lavel", argEmployeeJobDetails.Lavel);
            param[15] = new SqlParameter("@Location", argEmployeeJobDetails.Location);
            param[16] = new SqlParameter("@Status", argEmployeeJobDetails.Status);
            param[17] = new SqlParameter("@AdharCardNo", argEmployeeJobDetails.AdharCardNo);
            param[18] = new SqlParameter("PSNo", argEmployeeJobDetails.PSNo);
            param[19] = new SqlParameter("@ESIDispensary", argEmployeeJobDetails.ESIDispensary);
            param[20] = new SqlParameter("@PlacementBy", argEmployeeJobDetails.PlacementBy);
            param[21] = new SqlParameter("@BossReportTo", argEmployeeJobDetails.BossReportTo);

            param[22] = new SqlParameter("@ModifiedBy", argEmployeeJobDetails.ModifiedBy);
            param[23] = new SqlParameter("@NSSNo", argEmployeeJobDetails.NSSNo);
            param[24] = new SqlParameter("@AppointmentLetterIssueDate", argEmployeeJobDetails.AppointmentLetterIssueDate);

            param[25]           = new SqlParameter("@Type", SqlDbType.Char);
            param[25].Size      = 1;
            param[25].Direction = ParameterDirection.Output;

            param[26]           = new SqlParameter("@Message", SqlDbType.VarChar);
            param[26].Size      = 255;
            param[26].Direction = ParameterDirection.Output;

            param[27]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[27].Size      = 20;
            param[27].Direction = ParameterDirection.Output;
            param[28]           = new SqlParameter("@EmployeeJobId", argEmployeeJobDetails.EmployeeJobId);
            int i = da.NExecuteNonQuery("Proc_UpdateEmployeeJobDetails", param);

            string strMessage  = Convert.ToString(param[26].Value);
            string strType     = Convert.ToString(param[25].Value);
            string strRetValue = Convert.ToString(param[27].Value);

            objErrorHandlerClass.Type        = strType;
            objErrorHandlerClass.MsgId       = 0;
            objErrorHandlerClass.Message     = strMessage.ToString();
            objErrorHandlerClass.RowNo       = 0;
            objErrorHandlerClass.FieldName   = "";
            objErrorHandlerClass.LogCode     = "";
            objErrorHandlerClass.ReturnValue = strRetValue;
            lstErr.Add(objErrorHandlerClass);
            //return i;
        }
        public EmployeeJobDetails objGetEmployeeJobDetails(string EmployeeId)
        {
            EmployeeJobDetails argEmployeeJobDetails = new EmployeeJobDetails();
            DataSet            DataSetToFill         = new DataSet();

            if (EmployeeId.ToString().Trim() == "")
            {
                goto ErrorHandlers;
            }

            DataSetToFill = this.GetEmployeeJobDetails4ID(EmployeeId.ToString().Trim());

            if (DataSetToFill.Tables[0].Rows.Count <= 0)
            {
                goto Finish;
            }

            argEmployeeJobDetails = this.objCreteEmployeeJobDetails((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;

            return(argEmployeeJobDetails);
        }
        private EmployeeJobDetails objCreteEmployeeJobDetails(DataRow dr)
        {
            EmployeeJobDetails tEmployeeJobDetails = new EmployeeJobDetails();

            tEmployeeJobDetails.SetObjectInfo(dr);

            return(tEmployeeJobDetails);
        }
 public void SaveEmployeeJobDetails(EmployeeJobDetails objEmployeeJobDetails, ref DataAccess da, ref List <ErrorHandlerClass> lstErr)
 {
     try
     {
         if (blnIsEmployeeJobDetailsExist(objEmployeeJobDetails.EmployeeId) == false)
         {
             InsertEmployeeJobDetails(objEmployeeJobDetails, da, lstErr);
         }
         else
         {
             UpdateEmployeeJobDetails(objEmployeeJobDetails, da, lstErr);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        //Anuj

        public ICollection <ErrorHandlerClass> SaveEmployeeMaster(EmployeeMasterDetails objEmployeeMaster, EmployeeJobDetails objEmployeeJobDetails, ICollection <EmployeeQualificationDetails> colEmployeeQualificationDetails, ICollection <EmployeeEarningDetails> colEmployeeEarningDetails, ICollection <EmployeeDeductionDetails> colEmployeeDeductionDetails, ICollection <EmployeeLeaveDetails> colEmployeeLeaveDetails, EmployeeLeftDetails objEmployeeLeftDetails, EmployeeOtherDetails objEmployeeOtherDetails)
        {
            List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>();
            DataAccess da          = new DataAccess();
            string     strretValue = "";

            try
            {
                da.Open_Connection();
                da.BEGIN_TRANSACTION();

                if (blnIsEmployeeMasterExist(objEmployeeMaster.EmployeeId) == false)
                {
                    strretValue = InsertEmployeeMaster(objEmployeeMaster, da, lstErr);
                }
                else
                {
                    strretValue = UpdateEmployeeMaster(objEmployeeMaster, da, lstErr);
                }

                foreach (ErrorHandlerClass objerr in lstErr)
                {
                    if (objerr.Type == "E")
                    {
                        da.ROLLBACK_TRANSACTION();
                        return(lstErr);
                    }

                    if (objerr.Type == "A")
                    {
                        da.ROLLBACK_TRANSACTION();
                        return(lstErr);
                    }
                }

                if (strretValue != "")
                {
                    if (objEmployeeJobDetails != null)
                    {
                        objEmployeeJobDetails.EmployeeId = Convert.ToString(strretValue);
                        //objEmployeeJobDetails.EmployeeId = Convert.ToString(strretValue);
                        objEmployeeJobDetailsManager.SaveEmployeeJobDetails(objEmployeeJobDetails);
                    }

                    if (colEmployeeQualificationDetails.Count > 0)
                    {
                        foreach (EmployeeQualificationDetails argEmployeeQualificationDetails in colEmployeeQualificationDetails)
                        {
                            argEmployeeQualificationDetails.EmployeeId = Convert.ToString(strretValue);
                            objEmployeeQualificationDetailsManager.SaveEmployeeQualificationDetails(argEmployeeQualificationDetails);
                        }
                    }

                    if (colEmployeeEarningDetails.Count > 0)
                    {
                        foreach (EmployeeEarningDetails argEmployeeEarningDetails in colEmployeeEarningDetails)
                        {
                            argEmployeeEarningDetails.EmployeeId = Convert.ToString(strretValue);
                            objEmployeeEarningDetailsManager.SaveEmployeeEarningDetails(argEmployeeEarningDetails);
                        }
                    }

                    if (colEmployeeDeductionDetails.Count > 0)
                    {
                        foreach (EmployeeDeductionDetails argEmployeeDeductionDetails in colEmployeeDeductionDetails)
                        {
                            argEmployeeDeductionDetails.EmployeeId = Convert.ToString(strretValue);
                            objEmployeeDeductionDetailsManager.SaveEmployeeDeductionDetails(argEmployeeDeductionDetails);
                        }
                    }

                    if (colEmployeeLeaveDetails.Count > 0)
                    {
                        foreach (EmployeeLeaveDetails argEmployeeLeaveDetails in colEmployeeLeaveDetails)
                        {
                            argEmployeeLeaveDetails.EmployeeId = Convert.ToString(strretValue);
                            objEmployeeLeaveDetailsManager.SaveEmployeeLeaveDetails(argEmployeeLeaveDetails);
                        }
                    }

                    if (objEmployeeLeftDetails != null)
                    {
                        objEmployeeLeftDetails.EmployeeId = Convert.ToString(strretValue);
                        objEmployeeLeftDetailsManager.SaveEmployeeLeftDetails(objEmployeeLeftDetails);
                    }

                    if (objEmployeeOtherDetails != null)
                    {
                        objEmployeeOtherDetails.EmployeeId = Convert.ToString(strretValue);
                        objEmployeeOtherDetailsManager.SaveEmployeeOtherDetails(objEmployeeOtherDetails);
                    }
                }

                da.COMMIT_TRANSACTION();
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandlerClass.Type      = ErrorConstant.strAboartType;
                objErrorHandlerClass.MsgId     = 0;
                objErrorHandlerClass.Message   = ex.Message.ToString();
                objErrorHandlerClass.RowNo     = 0;
                objErrorHandlerClass.FieldName = "";
                objErrorHandlerClass.LogCode   = "";
                lstErr.Add(objErrorHandlerClass);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }
        public ICollection <ErrorHandlerClass> SaveEmployeeJobDetails(EmployeeJobDetails objEmployeeJobDetails)
        {
            List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>();
            DataAccess da = new DataAccess();

            try
            {
                da.Open_Connection();
                da.BEGIN_TRANSACTION();

                if (blnIsEmployeeJobDetailsExist(objEmployeeJobDetails.EmployeeId) == false)
                {
                    InsertEmployeeJobDetails(objEmployeeJobDetails, da, lstErr);

                    foreach (ErrorHandlerClass objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
                else
                {
                    UpdateEmployeeJobDetails(objEmployeeJobDetails, da, lstErr);
                    foreach (ErrorHandlerClass objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
            }
            catch (Exception ex)
            {
                if (da != null)
                {
                    da.ROLLBACK_TRANSACTION();
                }
                objErrorHandlerClass.Type      = ErrorConstant.strAboartType;
                objErrorHandlerClass.MsgId     = 0;
                objErrorHandlerClass.Message   = ex.Message.ToString();
                objErrorHandlerClass.RowNo     = 0;
                objErrorHandlerClass.FieldName = "";
                objErrorHandlerClass.LogCode   = "";
                lstErr.Add(objErrorHandlerClass);
            }
            finally
            {
                if (da != null)
                {
                    da.Close_Connection();
                    da = null;
                }
            }
            return(lstErr);
        }