Beispiel #1
0
        public HttpResponseMessage GetDistinctEmployeeId(BDMGetDistinctEmployeeId objId)
        {
            HttpResponseMessage message;

            try
            {
                // BDMAppointmentDetailDAL dal = new BDMAppointmentDetailDAL();
                var dynObj = new { result = _obj.GetDistinctEmployeeId(objId) };
                message = Request.CreateResponse(HttpStatusCode.OK, dynObj);
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, new { msgText = "Something wrong. Try Again!" });

                ErrorLog.CreateErrorMessage(ex, "BDMAppoinmentDetail", "GetDistinctEmployeeId");
            }
            return(message);
        }
        public List <BDMGetDistinctEmployeeId> GetDistinctEmployeeId(BDMGetDistinctEmployeeId objId)
        {
            List <BDMGetDistinctEmployeeId> EmployeeList = new List <BDMGetDistinctEmployeeId>();

            using (DbLayer dbLayer = new DbLayer())
            {
                if (objId.Position != 1)
                {
                    SqlCommand SqlCmd = new SqlCommand("spSelectDistinctEmployeeID");
                    SqlCmd.Parameters.AddWithValue("@ActionBy", objId.ActionBy);
                    SqlCmd.CommandType = CommandType.StoredProcedure;
                    EmployeeList       = dbLayer.GetEntityList <BDMGetDistinctEmployeeId>(SqlCmd);
                }
                else
                {
                    SqlCommand SqlCmd = new SqlCommand("spCEOSelectDistinctEmployeeID");
                    SqlCmd.CommandType = CommandType.StoredProcedure;
                    EmployeeList       = dbLayer.GetEntityList <BDMGetDistinctEmployeeId>(SqlCmd);
                }
            }
            return(EmployeeList);
        }