public EmployeeQualificationDetails objGetEmployeeQualificationDetails(string EmployeeId)
        {
            EmployeeQualificationDetails argEmployeeQualificationDetails = new EmployeeQualificationDetails();
            DataSet DataSetToFill = new DataSet();

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

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

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

            argEmployeeQualificationDetails = this.objCreteEmployeeQualificationDetails((DataRow)DataSetToFill.Tables[0].Rows[0]);

            goto Finish;

ErrorHandlers:

Finish:
            DataSetToFill = null;

            return(argEmployeeQualificationDetails);
        }
        private EmployeeQualificationDetails objCreteEmployeeQualificationDetails(DataRow dr)
        {
            EmployeeQualificationDetails tEmployeeQualificationDetails = new EmployeeQualificationDetails();

            tEmployeeQualificationDetails.SetObjectInfo(dr);

            return(tEmployeeQualificationDetails);
        }
        public void InsertEmployeeQualificationDetails(EmployeeQualificationDetails argEmployeeQualificationDetails, DataAccess da, List <ErrorHandlerClass> lstErr)
        {
            da.Open_Connection();

            SqlParameter[] param = new SqlParameter[14];
            param[0] = new SqlParameter("@EmployeeId", argEmployeeQualificationDetails.EmployeeId);
            param[1] = new SqlParameter("@ClassId", argEmployeeQualificationDetails.ClassId);
            param[2] = new SqlParameter("@ClassName", argEmployeeQualificationDetails.ClassName);
            param[3] = new SqlParameter("@CollegeOrUniversityName", argEmployeeQualificationDetails.CollegeOrUniversityName);
            param[4] = new SqlParameter("@PassingYear", argEmployeeQualificationDetails.PassingYear);
            param[5] = new SqlParameter("@Subject", argEmployeeQualificationDetails.Subject);
            param[6] = new SqlParameter("@Percentage", argEmployeeQualificationDetails.Percentage);
            param[7] = new SqlParameter("@ItemNo", argEmployeeQualificationDetails.ItemNo);

            param[8] = new SqlParameter("@CreatedBy", argEmployeeQualificationDetails.CreatedBy);
            param[9] = new SqlParameter("@ModifiedBy", argEmployeeQualificationDetails.ModifiedBy);

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

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

            param[12]           = new SqlParameter("@returnvalue", SqlDbType.VarChar);
            param[12].Size      = 20;
            param[12].Direction = ParameterDirection.Output;
            param[13]           = new SqlParameter("@EmployeeQualificationId", argEmployeeQualificationDetails.EmployeeQualificationId);
            int i = da.NExecuteNonQuery("Proc_InsertEmployeeQualificationDetails", param);

            string strMessage  = Convert.ToString(param[11].Value);
            string strType     = Convert.ToString(param[10].Value);
            string strRetValue = Convert.ToString(param[12].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 void SaveEmployeeQualificationDetails(EmployeeQualificationDetails objEmployeeQualificationDetails, ref DataAccess da, ref List <ErrorHandlerClass> lstErr)
 {
     try
     {
         if (blnIsEmployeeQualificationDetailsExist(objEmployeeQualificationDetails.EmployeeId, objEmployeeQualificationDetails.ItemNo) == false)
         {
             InsertEmployeeQualificationDetails(objEmployeeQualificationDetails, da, lstErr);
         }
         else
         {
             UpdateEmployeeQualificationDetails(objEmployeeQualificationDetails, da, lstErr);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public ICollection <ErrorHandlerClass> SaveEmployeeQualificationDetails(EmployeeQualificationDetails objEmployeeQualificationDetails)
        {
            List <ErrorHandlerClass> lstErr = new List <ErrorHandlerClass>();
            DataAccess da = new DataAccess();

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

                if (blnIsEmployeeQualificationDetailsExist(objEmployeeQualificationDetails.EmployeeId, objEmployeeQualificationDetails.ItemNo) == false)
                {
                    InsertEmployeeQualificationDetails(objEmployeeQualificationDetails, da, lstErr);

                    foreach (ErrorHandlerClass objerr in lstErr)
                    {
                        if (objerr.Type == "E")
                        {
                            da.ROLLBACK_TRANSACTION();
                            return(lstErr);
                        }
                    }
                    da.COMMIT_TRANSACTION();
                }
                else
                {
                    UpdateEmployeeQualificationDetails(objEmployeeQualificationDetails, 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);
        }